Last active
December 18, 2018 03:21
-
-
Save drecodeam/8f2d8357437c8b391296f0074243d455 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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