📜 ⬆️ ⬇️

How to force Navitel online map to show your city

Some time ago an interesting resource appeared - an alternative online map of the gps-navigation program Navitel . We look and respect: http://map.navitel.su/

With all my respect for Yandex and Google, but comparing at least with the Kurgan region, the online maps (by the way, showing traffic jams as well) Navitel are much more accurate and complete.

On the other hand, the Navitel online card service itself is not usable and ascetic to no ordinary means. For example, a map always opens over the capital of our vast Motherland, and you want to click a “direct link” or insert a blog (I'm not talking about the API) via an iframe or object, and look - your native village or the road to the cottage or other . In the wake of this problem, I set out to find a way to make these cards show the place I want to see.
')
The first method turned out to be indecent, since it involves copying code, files and placing on its server.

The second , to disgrace is simple:

By default, the scripts from openlayers (the Navitel map is made on this base online) use the url string with the coordinates and zoom (approximation level) parameters. All these functions are also available in the Navitel map, but are not indicated in the interface by buttons or links.

For example, a link to the Kurgan map for Navitel map looks like this:

map.navitel.su/?lat=55.44&lon=65.33&zoom=12

55.44 - latitude
65.33 - longitude
12 - zoom

By changing these parameters, you can get a link that will immediately open the map to the place you need.

Well, using this link to get a map for your blog and website is not so difficult:

example:
insert into blog via object
<object type="text/html" width="500" height="500" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" data="http://map.navitel.su/?lat=55.44&lon=65.33&zoom=12"></object><br /><a href="http://map.navitel.su/?lat=55.44&lon=65.33&zoom=12"> </a>

insert to blog via iframe
<iframe width="500" height="500" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://map.navitel.su/?lat=55.44&lon=65.33&zoom=12"></iframe><br /><a href="http://map.navitel.su/?lat=55.44&lon=65.33&zoom=12"> </a>

PS: Lord Navitel developers, would you bring to mind the online service!

Source: https://habr.com/ru/post/95560/


All Articles