How to tell KMLLayer about custom map projection?

I have a map with a user-defined projection (for maps.yandex.ru tiles) and a default projection (Google and OSM tiles). When I add KMLLayer to display in the projection by default, it looks fine: Default projection

But switching the map to the maps.yandex layer (in the user projection) ... Custom projection

and kml objects are inappropriate.

How to tell KMLLayer about user projection?

+4
source share
1 answer

As I understand it, any object that has lat / lon (a, b) under the Mercator projection will have a different meaning than (a, b) under the user projection. For example, if your user projection was polar, the object would have a distance from a fixed point and an angle from a fixed direction and would not be / lat at all. So, a way to tell your KMLLayer about a user projection would be to convert the coordinates of each object and rewrite KML.

0
source

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


All Articles