Difference between revisions of "Range layers"
Jump to navigation
Jump to search
Line 104: | Line 104: | ||
// GEOJSON FILES | // GEOJSON FILES | ||
var hoolockhoolock = 'files/Hoolock_hoolock.geojson'; | var hoolockhoolock = 'files/Hoolock_hoolock.geojson'; | ||
− | + | ||
− | |||
var map = L.map('map').setView([10, 110], 4); | var map = L.map('map').setView([10, 110], 4); | ||
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); | 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); | ||
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 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); | ||
+ | |||
function forEachFeature(feature, layer) { | function forEachFeature(feature, layer) { | ||
Line 119: | Line 119: | ||
function stylehoolockhoolock(feature) { | function stylehoolockhoolock(feature) { | ||
return { | return { | ||
− | fillColor: ' | + | fillColor: 'purple', |
fillOpacity: 0.7, | fillOpacity: 0.7, | ||
weight: 2, | weight: 2, | ||
opacity: 0.7, | opacity: 0.7, | ||
− | color: ' | + | color: 'purple', |
dashArray: '3' | dashArray: '3' | ||
}; | }; | ||
} | } | ||
− | + | // Null variable that will hold layer | |
+ | var hoolockhoolockLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: stylehoolockhoolock}); | ||
− | + | $.getJSON(hoolockhoolock, function(data) { hoolockhoolockLayer.addData(data);}); | |
− | |||
− | |||
− | |||
− | |||
− | $.getJSON(hoolockhoolock, function(data) { hoolockhoolockLayer.addData(data);}); | ||
hoolockhoolockLayer.addTo(map); | hoolockhoolockLayer.addTo(map); | ||
− | |||
// for Layer Control | // for Layer Control | ||
Line 146: | Line 141: | ||
var overlayMaps = { | var overlayMaps = { | ||
"Hoolock hoolock range": hoolockhoolockLayer, | "Hoolock hoolock range": hoolockhoolockLayer, | ||
− | |||
}; | }; | ||
− | |||
− | |||
//Add layer control | //Add layer control | ||
Line 157: | Line 149: | ||
</body> | </body> | ||
</html> | </html> | ||
+ | |||
+ | |||
+ | {|border="1" cellpadding="5" cellspacing="0" <!-- align="right" --> class="gibbon_ranges" !style="background-color:#ccffcc;" | ||
+ | |+'''Download available layers''' | ||
+ | !Species | ||
+ | !Shapefile | ||
+ | !GeoJSON | ||
+ | !Source | ||
+ | |- | ||
+ | |Hoolock hoolock | ||
+ | |[https://iucnapesportal.org/wiki/files/Hoolock_hoolock.zip ''Hoolock hoolock shapefile''] (ZIP; 110 kB)] | ||
+ | | | ||
+ | | | ||
+ | |} |
Revision as of 05:33, 6 March 2022
Species | Shapefile | GeoJSON | Source |
---|---|---|---|
Hoolock hoolock | Hoolock hoolock shapefile (ZIP; 110 kB)] |
Test
Species | Shapefile | GeoJSON | Source |
---|---|---|---|
Hoolock hoolock | Hoolock hoolock shapefile (ZIP; 110 kB)] |