add icons to search pattern.

fix http link in overalay example to be https
This commit is contained in:
Dave Conway-Jones 2019-03-11 12:59:09 +00:00
parent 7e70f169a0
commit 4c7a0dd2c3
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
2 changed files with 6 additions and 5 deletions

View File

@ -319,7 +319,7 @@ style server by adding a property `wms: true`. (see overlay example below)
msg.payload.command.map = { msg.payload.command.map = {
"name":"OSMhot", "name":"OSMhot",
"url":"http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png", "url":"https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",
"opt":{ "maxZoom":19, "attribution":"© OpenStreetMap" } "opt":{ "maxZoom":19, "attribution":"© OpenStreetMap" }
}; };
@ -399,7 +399,7 @@ in a function node:
msg.payload = { command : { lat:40.74, lon:-74.175, zoom:13 } }; msg.payload = { command : { lat:40.74, lon:-74.175, zoom:13 } };
msg.payload.command.map = { msg.payload.command.map = {
overlay: "New York Historical", overlay: "New York Historical",
url: 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg', url: 'https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
bounds: imageBounds, bounds: imageBounds,
opt: { opacity:1.0, attribution:"© University of Texas" } opt: { opacity:1.0, attribution:"© University of Texas" }
}; };

View File

@ -349,7 +349,6 @@ function doTidyUp(l) {
var d = parseInt(Date.now()/1000); var d = parseInt(Date.now()/1000);
for (var m in markers) { for (var m in markers) {
if ((l && (l == markers[m].lay)) || typeof markers[m].ts != "undefined") { if ((l && (l == markers[m].lay)) || typeof markers[m].ts != "undefined") {
//console.log(m,markers[m].ts,markers[m]);
if ((l && (l == markers[m].lay)) || (markers[m].hasOwnProperty("ts") && (Number(markers[m].ts) < d) && (markers[m].lay !== "_drawing"))) { if ((l && (l == markers[m].lay)) || (markers[m].hasOwnProperty("ts") && (Number(markers[m].ts) < d) && (markers[m].lay !== "_drawing"))) {
//console.log("STALE :",m); //console.log("STALE :",m);
layers[markers[m].lay].removeLayer(markers[m]); layers[markers[m].lay].removeLayer(markers[m]);
@ -401,13 +400,15 @@ function setCluster(v) {
// Search for markers with names of .... // Search for markers with names of ....
function doSearch() { function doSearch() {
var value = document.getElementById('search').value; var value = document.getElementById('search').value;
console.log("search for :",value);
marks = []; marks = [];
marksIndex = 0; marksIndex = 0;
for (var key in markers) { for (var key in markers) {
if ( (~(key.toLowerCase()).indexOf(value.toLowerCase())) && (mb.contains(markers[key].getLatLng()))) { if ( (~(key.toLowerCase()).indexOf(value.toLowerCase())) && (mb.contains(markers[key].getLatLng()))) {
marks.push(markers[key]); marks.push(markers[key]);
} }
if (markers[key].icon === value) {
marks.push(markers[key]);
}
} }
moveToMarks(); moveToMarks();
if (marks.length === 0) { if (marks.length === 0) {
@ -1377,8 +1378,8 @@ function setMarker(data) {
words = "<b>"+data.name+"</b><button style=\"border-radius:4px; float:right; background-color:lightgrey;\" onclick='popped=false;popmark.closePopup();'>X</button><br/>" + words; words = "<b>"+data.name+"</b><button style=\"border-radius:4px; float:right; background-color:lightgrey;\" onclick='popped=false;popmark.closePopup();'>X</button><br/>" + words;
marker.bindPopup(words, {closeButton:false, closeOnClick:false, keepInView:true, minWidth:250}); marker.bindPopup(words, {closeButton:false, closeOnClick:false, keepInView:true, minWidth:250});
marker._popup.dname = data.name; marker._popup.dname = data.name;
marker.lay = lay; // and the layer it is on marker.lay = lay; // and the layer it is on
var rightmenuMarker = L.popup({offset:[0,-12]}).setContent("<b>"+data.name+"</b><br/><button id='delbutton' onclick='delMarker(\""+data.name+"\",true);'>Delete</button>"); var rightmenuMarker = L.popup({offset:[0,-12]}).setContent("<b>"+data.name+"</b><br/><button id='delbutton' onclick='delMarker(\""+data.name+"\",true);'>Delete</button>");
marker.on('contextmenu', function(e) { marker.on('contextmenu', function(e) {
if (hiderightclick !== true) { if (hiderightclick !== true) {