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

search=false in embed url disables route #220

Open
mcnesium opened this issue Apr 22, 2022 · 3 comments
Open

search=false in embed url disables route #220

mcnesium opened this issue Apr 22, 2022 · 3 comments

Comments

@mcnesium
Copy link

When disabling the search box in the embed code by adding search=false to the URL, the resulting embedded page also misses the actual route. Is this intended?

Screenshot from 2022-04-22 09-57-50

Example in Hedgedoc demo

Example code:

<iframe style="height:300px; width:100%; border:none;" src="https://facilmap.org/?search=false#6/51.340/9.140/Topo/n240109189%20to%20r271110%20by%20car"></iframe>

<iframe style="height:300px; width:100%; border:none;" src="https://facilmap.org/?search=true#6/51.340/9.140/Topo/n240109189%20to%20r271110%20by%20car"></iframe>
@cdauth
Copy link
Contributor

cdauth commented Apr 22, 2022

The way it is intended is that the routing form is not shown. The purpose of this parameter is to embed a map into a website without showing the interactive elements of the search form, route form and POI form.

You are right, it would be better if the route was shown anyways if there is one defined in the URL hash. Right now the route is drawn by the form, which is why it is not shown.

How exactly would you want the route to behave? Would you want the start/end/via points to be draggable, and the route form still to be visible? Or should the route be immutable?

If the route should be immutable, I think the better way to do it would be to create a collaborative map, save the route as a line and then embed the read-only link of that map.

@mcnesium
Copy link
Author

Both options are reasonable. What if the route is editable, whenever the form is visible? Maybe the search= flag should be changed to something like editable= then.

Side note: I just discovered facilmap when I searched for OSM-backed alternatives to the embeddable openrouteservice.org maps for a quick "this is where we are gonna go" visual inside a travel-plan notepad. Not sure if I am using this tool the intended way at all but it sure looks pretty neat. Thanks for sharing it 👍

@cdauth
Copy link
Contributor

cdauth commented Apr 22, 2022

I think it's a good idea to only have the route editable when the form is shown. In that case your embedded links should show the route, but it shouldn't show the route form.

Your use case sounds very much like what FacilMap is made for. I would recommend you to use a collaborative map for it, since then the route doesn't have to be recalculated each time, and also the route will still be shown if the routing service has a temporary outage.

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