Skip to content

Instantly share code, notes, and snippets.

@bensu
Last active February 1, 2016 21:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bensu/edd68d11102c2197a729 to your computer and use it in GitHub Desktop.
Save bensu/edd68d11102c2197a729 to your computer and use it in GitHub Desktop.
google maps config
(ns component.maps
(:require [google.maps])
(defn map-opts []
"Default initial map options."
{:zoom 3
:mapTypeId google.maps.MapTypeId.ROADMAP
:center (google.maps.LatLng. 59, 18)
:mapTypeControl false
:styles [{:stylers [{:visibility "on"}]}]})
(google.maps.Map. map-node map-opts)
:dependencies [[cljsjs/google-maps "3.18-1"]]
:compiler {:output-to "resources/public/js/cljs/app.js"
:foreign-libs [{:file ~(str "https://maps.googleapis.com/maps/api/js?key="
(System/getenv "GOOGLE_MAPS_KEY")
"&libraries=places")
:provides ["google.maps"]}]
:optimizations :none}
@bensu
Copy link
Author

bensu commented Feb 1, 2016

This is a bad idea: you fetch the google maps file at compile time and they come with another key which then expires then your compiled artifacts suddenly start failing.

Add <script src=https: the usual way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment