DJTommek / better-location

Telegram bot for parsing and generating various of location formats.
https://t.me/BetterLocationBot
MIT License
8 stars 2 forks source link

MapyCz - multiple locations in URL #5

Closed DJTommek closed 4 years ago

DJTommek commented 4 years ago

MapyCZ link can have (at least) three locations in one url:

Examples:

Numeric place ID

https://en.mapy.cz/turisticka?x=16.2845693&y=50.1233926&z=17&pano=1&source=base&id=2107710&pid=66437731&yaw=6.051&fov=1.257&pitch=0.157

Coordinates in place ID

https://en.mapy.cz/turisticka?x=16.2901106&y=50.1243329&z=17&pano=1&source=coor&id=16.290770614266734%2C50.126474095383905&pid=66433150&yaw=3.770&fov=1.257&pitch=0.306

DJTommek commented 4 years ago

Translating panorama ID to coordinates might be possible via https://pro.mapy.cz/panorpc but it's returning list of neighbors (but not coordinates of current position itself).

Solutions:

DJTommek commented 4 years ago

Added support for panorama in e64c0b818f53d8444096ce61c64c223855a93ced.

If panorama is opened and changed, map always will autocenter to currently opened panorama location, so X and Y parameters in URL are the same, as panorama location. But it is possible to move with map away and in that case X an Y is in different location than panorama. Because of that I don't want to rely on that X and Y coordinates so in that commit it is solved via solution 2 described in comment earlier.

DJTommek commented 4 years ago

Done in 091d1ebf706a99fa0910a9baa71d4c47aa594f5c.