Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Optional properties for **msg.payload** include
- **popped** : set to true to automatically open the popup info box, set to false to close it.
- **popup** : html to fill the popup if you don't want the automatic default of the properties list. Using this overrides photourl, videourl and weblink options.
- **popupOptions** : optional object to help style the popup - See Leaflet popup docs for options - eg to add a custom class - `{className:"mySpecialPopup",width:600}`
- **hideName** : set to true to omit the bold name title from the top of the popup.
- **label** : displays the contents as a permanent label next to the marker, or
- **tooltip** : displays the contents when you hover over the marker. (Mutually exclusive with label. Label has priority)
- **tooltipOptions** : custom tooltip/label options (offset, direction, permanent, sticky, interactive, opacity, className) )
Expand Down
9 changes: 8 additions & 1 deletion worldmap/worldmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2603,6 +2603,8 @@ function setMarker(data) {
if (data.hasOwnProperty("fillColor")) { delete data.fillColor; }
if (data.hasOwnProperty("radius")) { delete data.radius; }
if (data.hasOwnProperty("greatcircle")) { delete data.greatcircle; }
var hideName = data.hideName;
if (data.hasOwnProperty("hideName")) { delete data.hideName; }

if (!data.hasOwnProperty("clickable") || data.clickable == true) {
var wopt = { autoClose:false, closeButton:true, closeOnClick:false, minWidth:200 };
Expand Down Expand Up @@ -2632,7 +2634,12 @@ function setMarker(data) {
words += '<tr><td>lat, lon</td><td>'+ marker.getLatLng().toString().replace('LatLng(','').replace(')','') + '</td></tr>';
words += '</table>';
}
words = "<b>"+data["name"]+"</b><br/>" + words.replace(/\${name}/g,data["name"]); //"<button style=\"border-radius:4px; float:right; background-color:lightgrey;\" onclick='popped=false;popmark.closePopup();'>X</button><br/>" + words;
if (hideName) {
words = words.replace(/\${name}/g,data["name"]);
}
else {
words = "<b>"+data["name"]+"</b><br/>" + words.replace(/\${name}/g,data["name"]); //"<button style=\"border-radius:4px; float:right; background-color:lightgrey;\" onclick='popped=false;popmark.closePopup();'>X</button><br/>" + words;
}

if (longline > 100) { wopt.minWidth="640"; } // make popup wider if it has a long line
marker.bindPopup(words, wopt);
Expand Down