Difference between revisions of "Range layers"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
+ | TEST | ||
+ | |||
<html> | <html> | ||
<head> | <head> | ||
Line 20: | Line 22: | ||
// GEOJSON FILES | // GEOJSON FILES | ||
var hoolockhoolock = 'files/Hoolock_hoolock.geojson'; | var hoolockhoolock = 'files/Hoolock_hoolock.geojson'; | ||
− | + | var hoolockleuconedys = 'files/Hoolock_leuconedys.geojson'; | |
+ | |||
var map = L.map('map').setView([10, 110], 4); | var map = L.map('map').setView([10, 110], 4); | ||
Line 35: | Line 38: | ||
function stylehoolockhoolock(feature) { | function stylehoolockhoolock(feature) { | ||
return { | return { | ||
− | fillColor: ' | + | fillColor: 'red', |
fillOpacity: 0.7, | fillOpacity: 0.7, | ||
weight: 2, | weight: 2, | ||
opacity: 0.7, | opacity: 0.7, | ||
− | color: ' | + | color: 'red', |
dashArray: '3' | dashArray: '3' | ||
}; | }; | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | function stylehoolockleuconedys(feature) { | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
return { | return { | ||
− | fillColor: ' | + | fillColor: 'AF1818', |
fillOpacity: 0.7, | fillOpacity: 0.7, | ||
weight: 2, | weight: 2, | ||
opacity: 0.7, | opacity: 0.7, | ||
− | color: ' | + | color: 'AF1818', |
dashArray: '3' | dashArray: '3' | ||
}; | }; | ||
− | + | } | |
// Null variable that will hold layer | // Null variable that will hold layer | ||
− | var hoolockhoolockLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: stylehoolockhoolock}); | + | var hoolockhoolockLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehoolockhoolock}); |
+ | 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); | hoolockhoolockLayer.addTo(map); | ||
+ | |||
+ | $.getJSON(hoolockleuconedys, function(data) { hoolockleuconedysLayer.addData(data);}); | ||
+ | hoolockleuconedysLayer.addTo(map); | ||
// for Layer Control | // for Layer Control | ||
Line 141: | Line 75: | ||
var overlayMaps = { | var overlayMaps = { | ||
"Hoolock hoolock range": hoolockhoolockLayer, | "Hoolock hoolock range": hoolockhoolockLayer, | ||
+ | "Hoolock leuconedys" : hoolockleuconedysLayer, | ||
}; | }; | ||
+ | |||
+ | |||
//Add layer control | //Add layer control | ||
Line 149: | Line 86: | ||
</body> | </body> | ||
</html> | </html> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 02:54, 7 March 2022
TEST