Skip to content

Commit

Permalink
Merge 4dd6c53 into 80d4010
Browse files Browse the repository at this point in the history
  • Loading branch information
akacarlyann committed Jan 31, 2018
2 parents 80d4010 + 4dd6c53 commit ce4b904
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 190 deletions.
37 changes: 37 additions & 0 deletions mapboxgl/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{% extends "main.html" %}

{% block javascript %}
mapboxgl.accessToken = '{{ accessToken }}';

var map = new mapboxgl.Map({
container: 'map',
style: '{{ styleUrl }}',
center: {{ center }},
zoom: {{ zoom }},
transformRequest: (url, resourceType)=> {
return {
url: [url.slice(0, url.indexOf("?")+1), "pluginName=PythonMapboxgl&", url.slice(url.indexOf("?")+1)].join('')
}
}
});

map.addControl(new mapboxgl.NavigationControl());

map.on('style.load', function() {

map.addSource("data", {
"type": "geojson",
"data": {{ geojson_data }},
"buffer": 1,
"maxzoom": 14
});

map.addLayer({
"id": "circle",
"source": "data",
"type": "circle",
"paint": {"circle-radius": 1}
});

});
{% endblock %}

0 comments on commit ce4b904

Please sign in to comment.