A Leaflet TileLayer with getColor(latLng)
// factory
var layer = L.tilelayer.colorPicker(cors_enabled_url_template,options);
layer.addTo(map);
// getColor(latLng) returns Uint8Array ([r,g,b,a]) or null
var color = layer.getColor(map.getCenter());
var red = color[0];
var green = color[1];
var blue = color[2];
- CORS enabled Tiles are required.
crossOrigin
option is set to anonymous by default, DO NOT set to false manually.
See also : https://www.mapbox.com/blog/terrain-rgb/
See also : http://maps.gsi.go.jp/development/demtile.html
See also : https://pacific-data.sprep.org/dataset/landsat-8-satellite-imagery-collection-1-papua-new-guinea