I'd like to add a page containing a google maps component to my Luminus application but I can't figure out how to do this. I've tried to follow the Reagent google maps guide but the map won't show.
This is the Clojurescript code that I've tried:
(ns test.maps
(:require [reagent.core :as r]))
(defn home-render []
[:div {:style {:height "300px"}}])
(defn home-did-mount [this]
(let [map-canvas (r/dom-node this)
map-options (clj->js {"center" (google.maps.LatLng. -34.397, 150.644)
"zoom" 8})]
(js/google.maps.Map. map-canvas map-options)))
(defn map-page []
[:script {:type "text/javascript" :src "https://maps.googleapis.com/maps/api/js?key=<mykey>"}]
[:div.container
[:div.row
[:div.col-md-12
(r/create-class {:reagent-render home-render
:component-did-mount home-did-mount})]]])
I strongly suspect that this is not the right way to add script
tags.
So my question is how do I add a Google Maps component to my Lumius application?