Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Permalink crosshair after swisssearch not taken into account #4666

Open
davidoesch opened this issue Dec 18, 2018 · 9 comments
Open

Permalink crosshair after swisssearch not taken into account #4666

davidoesch opened this issue Dec 18, 2018 · 9 comments

Comments

@procrastinatio
Copy link
Contributor

We discussed this many times.

The thing is the marker has no coordinates of its own, and is placed on the center of the map. If you move the map prior to copy the URL, the marker is not placed where you wanted.

Using the right-click, the view is centered on the bowl (the point you just click), not the previous view.

@davidoesch
Copy link
Contributor Author

I know we discussed this--- obviously we do not have a solution to grab the event to see if the marker is active. If marker is active and share link is activated--- add crosshair permalink parameter

@gjn
Copy link
Contributor

gjn commented Dec 19, 2018

To have this, the original idea was to use the swisssearch paramter. For instance, this gives you the desired results:
https://map.geo.admin.ch/?swisssearch=Seftigenstrasse 90 3007 Bern&topic=ech&lang=de&bgLayer=ch.swisstopo.pixelkarte-farbe&layers=ch.swisstopo.zeitreihen,ch.bfs.gebaeude_wohnungs_register,ch.bav.haltestellen-oev,ch.swisstopo.swisstlm3d-wanderwege&layers_visibility=false,false,false,false&layers_timestamp=18641231,,,&E=2599538.00&N=1198738.00&zoom=10

The problem with this approach is that a) when address is not unique, then no marker appears and the dropdown list of the search and b) we can't share the result of a search

A way to solve this would be to introduce coordinates for the marker in the permalink. E.G. EMarker, NMarker. If not pressent, as current behaviour, if present, put marker at this coordinate. Then the application should make sure to keep track of those 2 coordinates (add it when marker is added via search, remove it when marker is removed, etc)

@davidoesch
Copy link
Contributor Author

+1 for EMarker NMarker (google maps does solve this completely different)

@davidoesch
Copy link
Contributor Author

" E.G. EMarker, NMarker. If not pressent, as current behaviour, if present, put marker at this coordinate. Then the application should make sure to keep track of those 2 coordinates (add it when marker is added via search, remove it when marker is removed, etc)"
@pakb your thoughts?

@procrastinatio
Copy link
Contributor

How do you remove the marker?

@davidoesch
Copy link
Contributor Author

Good question:
brainstorming

  • if marker aktive , the share button is active. (dark grey) if user clicks it marker is deactivated
  • if marker is active, in swisssearch field coords are shown, if user remove coords, maraker is removed
  • other?

@pakb
Copy link
Contributor

pakb commented Jan 11, 2019

We could use the marker param and add some coordinate to it : marker=crosshair,46.63473,7.60423 for exemple.
That will make it easy to track into shared links.

But that leave us with a problem, how do we remove a marker?
On prod, if you reload a page after having moved just a little the map, the marker disappear. But that's the only way to make it disappear.
We could remove it if it receives a right click, what do you think?

@davidoesch
Copy link
Contributor Author

ping @gjn we shoudl decide here

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

No branches or pull requests

4 participants