What country do we live in? That's right - in Russia.
So why bind yourself to foreign maps from Google?
We live in Russia, and for it there are cards. Native. These are Maps from Yandex.Now,
e-Neighbors are friends with Yandex.Maps. Once logged in, you can see your house or cottage on them, and if you want to compare with Google maps.
The transition to Yandex.Maps was made not only for patriotic reasons :)
In some cases, Google coverage across Russia is far from ideal. At the same time, one cannot say that Yandex.Maps are definitely better. But they sometimes show what is missing on Google maps. Here is a curious example of almost mirroring quality plots:

')
How to be powered by Yandex on your website, if you already have Google settled, read on.
Differences between Yandex and Google
1. GLatLng and YMaps.GeoPoint are used in G and I respectively.
The transition from one system to another is simple:
function G2YA(a){return new YMaps.GeoPoint(a.lng(),a.lat())}
function YA2G(a){return new GLatLng(a.getLat(),a.getLng());}
2. Yandex uses a different projection standard, a bit already epsg: 3395 (
details )
3. Some functions are simply called differently, some work a little differently.
How to connect Yandex and Google maps?
Option - use a proxy (
description of the proxy in the club )
The essence is simple - we wrap up both Google and Yandex interface.
In our case, it was a little easier - we had a centralized address to the coordinates, SET was in one place, GET, we even let it through a proxy.
It turned out something like:
map.getPane=function(a){return 0;}
map.checkResize=function(){this.redraw(true);}
map.disableScrollWheelZoom=function(){this.disableScrollZoom();}
map.enableScrollWheelZoom=function(){this.enableScrollZoom();}
map.fromLatLngToDivPixel=function(a){ YA=G2YA(a);return this.converter.coordinatesToMapPixels(YA);}
map.fromContainerPixelToLatLng=function(a){ return YA2G(geo_map.converter.localPixelsToCoordinates(GP2YA(a)));}
map.getMapCenter=function(){return YA2G(this.getCenter());}
map.setMapType=function(a)
{
if(a==G_NORMAL_MAP )this.setType(YMaps.MapType.MAP);
if(a==G_HYBRID_MAP )this.setType(YMaps.MapType.HYBRID);
if(a==G_PHYSICAL_MAP )this.setType(YMaps.MapType.SATELLITE );
}
map.getCurrentMapType=function()
{
a=this.getType();
if(a==YMaps.MapType.MAP )return G_NORMAL_MAP;
if(a==YMaps.MapType.HYBRID )return G_HYBRID_MAP;
if(a==YMaps.MapType.SATELLITE)return G_PHYSICAL_MAP;
}
YMaps.GeoBounds.prototype.getSouthWest=function(){ return YA2G(this.getLeftBottom());}
YMaps.GeoBounds.prototype.getNorthEast=function(){ return YA2G(this.getRightTop());}
The map shift event is defined as
GEvent.addListener(geo_map, "moveend", map_moveend_event );
In Yandex in a different way - you have to hang up on two events:
YMaps.Events.observe(map, map.Events.Update,map_moveend_event);
YMaps.Events.observe(map, map.Events.MoveEnd,map_moveend_event);
Neighbors do not use markers and “baluns”, but they use overlays, which allow you to display anything on the map.
If you are interested in finding out how this is done,
kashey can describe it in more detail, but in a different topic.
How to make friends overlays G and I?
Again, everything is very simple.
GOverlay.prototype.onAddToMap = function(map,to)
{
this.initialize(map);
to.appendChild(this.div_);
this.onMapUpdate(map);
return obj;
}
GOverlay.prototype.onRemoveFromMap = function(map)
{
return this.remove();
}
GOverlay.prototype.onMapUpdate = function(map)
{
this.redraw(true);
}
The onAddToMap function creates a div (_div) in which you can put any data.
In the case of the G cards, it is added to the card as an initialize function with the command
if(GetMap().getPane(defmappane))
GetMap().getPane(defmappane).appendChild(div);
in the case of I cards, this command simply will not work.
In principle, in a similar way, you can patch GMarker, and it “just works”, or you can write a reverse function. Then the beautiful Yandex. Baluns will earn on G cards ...
We had enough of the described patches to launch a new version of the maps. Perhaps something we did not take into account, but for a week of testing glitches did not come out.