Skip to content

Instantly share code, notes, and snippets.

@smahood
Created March 3, 2017 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smahood/464eaa974247ae3f382f012ed0afc082 to your computer and use it in GitHub Desktop.
Save smahood/464eaa974247ae3f382f012ed0afc082 to your computer and use it in GitHub Desktop.
(ns quickstart.core
(:require [ol.Map]
[ol.View]
[ol.proj]
[ol.layer.Tile])
(:import [ol.source.OSM]))
(def my-center (ol.proj/fromLonLat #js [37.41 8.82]))
(def my-view (ol.View. #js{:center my-center
:zoom 4}))
(def my-source (ol.source.OSM.))
(def my-tile (ol.layer.Tile. #js {:source my-source}))
(def my-layers #js [my-tile])
(def my-map (ol.Map. #js {:target "map"
:layers my-layers
:view my-view}))
(def my-map (ol.Map. #js {:target "map"
:layers #js [(ol.layer.Tile. #js {:source (ol.source.OSM.)})]
:view (ol.View. #js {:center (ol.proj/fromLonLat #js [37.41 8.82])
:zoom 4})}))
;; Error message - Uncaught TypeError: ol.source.OSM is not a constructor at core.js:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment