Skip to content

Instantly share code, notes, and snippets.

@drecodeam
Last active December 18, 2018 03:21
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 drecodeam/8f2d8357437c8b391296f0074243d455 to your computer and use it in GitHub Desktop.
Save drecodeam/8f2d8357437c8b391296f0074243d455 to your computer and use it in GitHub Desktop.
# By default mapbox would show the hand cursor as opposed to default framer cursor. This is a CSS fix for that
mapboxCSS_fix = """
.mapboxgl-canvas-container.mapboxgl-interactive,
.mapboxgl-ctrl-nav-compass {
cursor: inherit;
}
.mapboxgl-canvas-container.mapboxgl-interactive:active,
.mapboxgl-ctrl-nav-compass:active {
cursor: inherit;
}
"""
initializeMapbox = () ->
# Insert Mapbox GL Javascript and CSS
insertScript("https://api.tiles.mapbox.com/mapbox-gl-js/v0.45.0/mapbox-gl.js")
insertCSS("https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.2/mapbox-gl.css")
# Include Turf.js for some helper map functions
insertScript("https://api.tiles.mapbox.com/mapbox.js/plugins/turf/v2.0.0/turf.min.js")
Utils.insertCSS(mapboxCSS_fix)
# Initialise mapboxgl instance with our access_token
mapboxgl.accessToken = access_token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment