Skip to content

Commit

Permalink
Add option to remove the small sidc icons around edge of map (edgeEna…
Browse files Browse the repository at this point in the history
…bled)
  • Loading branch information
zafrirron committed Sep 8, 2024
1 parent 9becb5a commit cb68260
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ Optional properties for **msg.payload.command** include
- **trackme** - Turns on/off the browser self locating. Boolean false = off, true = cyan circle showing accuracy error, or an object like `{"command":{"trackme":{"name":"Dave","icon":"car","iconColor":"blue","layer":"mytrack","accuracy":false}}}`. Usual marker options can be applied.
- **showmenu** - Show or hide the display of the hamberger menu control in the top right . Values can be "show" or "hide". - `{"command":{"showmenu": "hide"}}`
- **showlayers** - Show or hide the display of selectable layers. Does not control the display of an individual layer, rather a users ability to interact with them. Values can be "show" or "hide". - `{"command":{"showlayers": "hide"}}`
- **edgeenabled** - Show or hide small sidc icons around edge of map for things just outside of view. Values can be true or false (default is true). - `{"command":{"edgeenabled": false}}`

#### To switch layer, move map and zoom

Expand Down
7 changes: 5 additions & 2 deletions worldmap/worldmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ var Lgrid = L.latlngGraticule({
// Add small sidc icons around edge of map for things just outside of view
// This function based heavily on Game Aware code from Måns Beckman
// Copyright (c) 2013 Måns Beckman, All rights reserved.
var edgeAware = function() {
var edgeAware = function () {
map.removeLayer(edgeLayer);
if (!edgeEnabled) { return; }
map.removeLayer(edgeLayer)
edgeLayer = new L.layerGroup();
var mapBounds = map.getBounds();
var mapBoundsCenter = mapBounds.getCenter();
Expand Down Expand Up @@ -3066,6 +3066,9 @@ function doCommand(cmd) {
document.getElementById("maxage").value = cmd.maxage;
setMaxAge();
}
if (cmd.hasOwnProperty("edgeenabled")) {
edgeEnabled = cmd.edgeenabled;
}
// Replace heatmap layer with new array (and optionally options)
if (cmd.hasOwnProperty("heatmap") && heat) {
if (cmd.hasOwnProperty("options")) { heat.setOptions(cmd.options); }
Expand Down

0 comments on commit cb68260

Please sign in to comment.