I'm trying to use Python's Flask and Javascript to build a web map. So far I've managed to get Flask to perform an SQL query a ZIP, return some coordinates, and for the map to load that location.
Now I'm trying to control the 'visible:' part of the Javascript.
(function (w) {
var map = new ol.Map({
layers: [
new ol.layer.Tile({
title: 'Water color',
visible: true,
}),
new ol.layer.Tile({
title: 'OSM',
visible: false,
}),
],
target: 'map',
view: new ol.View({
center: ol.proj.transform(w.latLon),
})
});
}(window));
Can that be done? The coordinates are passes in via w.latLon. Replacing visible: true, with visible: w.OSM and setting OSM to the string true doesn't seem to do it.
1and0as Boolean substitutes work instead?