Difference between revisions of "Range test"
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
<script> | <script> | ||
+ | // create map | ||
+ | var map = L.map('map').setView([10, 110], 4); | ||
+ | |||
+ | // Open maps | ||
+ | var osm=new L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',{attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(map); | ||
+ | var topo=new L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',{attribution: '© <a href="http://osm.org/copyright">OpenTopoMap</a> contributors'}).addTo(map); | ||
+ | |||
// GEOJSON FILES | // GEOJSON FILES | ||
var hoolockhoolock = 'files/gibbon/Hoolock_hoolock.geojson'; | var hoolockhoolock = 'files/gibbon/Hoolock_hoolock.geojson'; | ||
var hoolockleuconedys = 'files/gibbon/Hoolock_leuconedys.geojson'; | var hoolockleuconedys = 'files/gibbon/Hoolock_leuconedys.geojson'; | ||
− | + | // Popup | |
− | + | function forEachFeature(feature, layer) { var popupContent = "<p><b>Species: </b>"+ feature.properties.BINOMIAL +'</p>'; layer.bindPopup(popupContent); } | |
− | |||
− | |||
− | |||
− | function forEachFeature(feature, layer) { | ||
− | |||
− | |||
− | |||
// Set style function that sets fill color property | // Set style function that sets fill color property | ||
− | + | function stylehoolockleuconedys(feature) {return { fillColor: 'purple',fillOpacity: 0.7,weight: 2,opacity: 0.7,color: 'red',dashArray: '3', }; } | |
− | function | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
function stylehoolockleuconedys(feature) {return { fillColor: 'red',fillOpacity: 0.7,weight: 2,opacity: 0.7,color: 'red',dashArray: '3', }; } | function stylehoolockleuconedys(feature) {return { fillColor: 'red',fillOpacity: 0.7,weight: 2,opacity: 0.7,color: 'red',dashArray: '3', }; } | ||
Line 51: | Line 40: | ||
var hoolockleuconedysLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: stylehoolockleuconedys}); | var hoolockleuconedysLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: stylehoolockleuconedys}); | ||
− | $.getJSON(hoolockhoolock, function(data) { hoolockhoolockLayer.addData(data);}); | + | $.getJSON(hoolockhoolock, function(data) { hoolockhoolockLayer.addData(data);}); hoolockhoolockLayer.addTo(map); |
− | + | $.getJSON(hoolockleuconedys, function(data) { hoolockleuconedysLayer.addData(data);}); hoolockleuconedysLayer.addTo(map); | |
− | |||
− | $.getJSON(hoolockleuconedys, function(data) { hoolockleuconedysLayer.addData(data);}); | ||
− | |||
// for Layer Control | // for Layer Control |
Revision as of 08:50, 7 March 2022
Species | Shapefile | GeoJSON | Source |
---|---|---|---|
Hoolock hoolock | Hoolock hoolock shapefile (ZIP; 110 kB)] |