Difference between revisions of "Test"
Jump to navigation
Jump to search
Line 17: | Line 17: | ||
<script> | <script> | ||
− | |||
− | + | // initialize the map | |
− | + | var map = L.map('map').setView([42.35, -71.08], 13); | |
− | + | ||
− | + | // load a tile layer | |
− | + | L.tileLayer('http://tiles.mapc.org/basemap/{z}/{x}/{y}.png', | |
+ | { | ||
+ | attribution: 'Tiles by <a href="http://mapc.org">MAPC</a>, Data by <a href="http://mass.gov/mgis">MassGIS</a>', | ||
+ | maxZoom: 17, | ||
+ | minZoom: 9 | ||
+ | }).addTo(map); | ||
// load GeoJSON from an external file | // load GeoJSON from an external file | ||
− | $.getJSON(" | + | $.getJSON("rodents.geojson",function(data){ |
// add GeoJSON layer to the map once the file is loaded | // add GeoJSON layer to the map once the file is loaded | ||
L.geoJson(data).addTo(map); | L.geoJson(data).addTo(map); |
Revision as of 08:44, 25 February 2022