tags:

views:

16

answers:

0

I use to put a flag in the right top corner of a map using Google Map V2.

I don't arrive to migrate my code using Google Map V3, do you have a sample ?

Below, my old obsolete code.

function loadmap(lat,lng,zm,pays)
  {
    if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map"));

    var icon = new GIcon();
    icon.image = "../../satellite/flag/" + pays + ".png";
    icon.shadow = "../../satellite/flag/shadow.png";

    icon.iconSize = new GSize(24, 24);
    icon.shadowSize = new GSize(41, 41);
    icon.iconAnchor = new GPoint(37, -35);

    map.addControl(new GLargeMapControl3D()); 
    map.addControl(new GMenuMapTypeControl());
    map.setCenter(new GLatLng(lat,lng), zm);
    map.setMapType(G_SATELLITE_MAP);
    map.enableDoubleClickZoom();
 var bounds = map.getBounds() ;
 var flag = bounds.getNorthEast();
    map.addOverlay(new GMarker(flag, icon));
    }
  }