C
C
cester2017-10-27 19:15:05
JavaScript
cester, 2017-10-27 19:15:05

Possibility to choose a map to use or an alternative to Leaflet?

Good afternoon! There is a task to make a map on which there will be a lot of dynamic data, different routes, clustering and a lot of things, but everything is clear with this.
Now there is a task to make it possible for the user to choose which cards to use.
For example, so that you can switch from Google maps to Yandex while saving data (all markers, routes ...).
I found such a thing as Leaflet , it seems to provide such an opportunity.
I don’t quite understand how it works, but each card needs its own token!?
Please explain if Leaflet can solve the problem, what problems can you encounter?
What are the alternatives to this?
And more ... maybe someone came across a map that would provide the ability to build a route for trucks, for example, so that the route bypasses bridges, toll roads, places where a truck or something else cannot pass.
The project itself is in react.
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dom1n1k, 2017-10-27
@cester

Normally, this is impossible to do for legal reasons - both Google and Yandex prohibit the license agreement from using their data anywhere outside their own APIs.
There are plugins for Leaflet that "solve" this problem, but there is a hell of a crutch. The api of the same Yandex is loaded from the leaflet, and the map is shown inside the map, like a nesting doll. All this is very inconvenient, crutch, buggy, incompatible with third-party plugins...
Well, that is, for simple cases, when you just need to show the map and make it move, it will still fit. But if you have "a lot of dynamic data, different routes, clustering and a lot of things" - forget it. You have to choose one engine and stick to it.

F
freeExec, 2017-10-27
@freeExec

Leaflet technically can do all this, just keep in mind that all these Googledexes allow you to use services only through their APIs, i.e. not through Leaflet.
The laying for trucks allows https://www.openrouteservice.org, the data is not based on OpenStreetMap, so if some restrictions are not indicated, you have to go and put them down.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question