Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced maps, Device Data problem #6

Open
ejanse64 opened this issue Feb 24, 2020 · 1 comment
Open

Advanced maps, Device Data problem #6

ejanse64 opened this issue Feb 24, 2020 · 1 comment

Comments

@ejanse64
Copy link

Hi JP, i think I discovered some unwanted behavior using TTNmapper website’s advanced maps, Device Data.
When I untick the boxes for gateway markers and/or lines and/or circles and click View Map, all are still in view. There is no &gateway, &lines, &points=off added to the URL and by default the options seems to be on.

@MatthewDriver
Copy link

MatthewDriver commented Mar 8, 2020

I noticed this issue also. I've been manually tweaking the URL to get the result I wanted (eg. turning off the lines by adding &lines=off ).

I'm not confident to do a pull request but I think the simplest fix is to leave the form code as-is and fix the /devices/ page.

ttnmapper-web/web/devices/index-logic.js

Current code:

 if(findGetParameter("gateways")!="off") {
    gatewayMarkers.addTo(map);
    gatewayMarkersNoCluster.addTo(map);
  }
  if(findGetParameter("points")!="off") {
    pointMarkers.addTo(map);
  }
  if(findGetParameter("lines")!="off") {
    lineMarkers.addTo(map);
  }
  getData();

Suggested fix:

 if(findGetParameter("gateways")=="on") {
    gatewayMarkers.addTo(map);
    gatewayMarkersNoCluster.addTo(map);
  }
  if(findGetParameter("points")=="on") {
    pointMarkers.addTo(map);
  }
  if(findGetParameter("lines")=="on") {
    lineMarkers.addTo(map);
  }
  getData();

Cheers,

Matthew

PS: I so love ttnmapper!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants