Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

When a polygon is drawn on the map and the map is dragged, the position of the polygon relative to the GM V3 base changes.

function init() {
    var map = new OpenLayers.Map('map');
    var gsat = new OpenLayers.Layer.Google(
        "Google Satellite",
        {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
    );
    drawVctr = new OpenLayers.Layer.Vector("Editable Vector");
    map.addLayers([gsat, drawVctr]);

    // Google.v3 uses EPSG:900913 as projection, so we have to
    // transform our coordinates    
    var lng = "-71.118004"; 
    var lat =  "42.389118"; 
    map.setCenter(new OpenLayers.LonLat(lng, lat).transform(
        new OpenLayers.Projection("EPSG:4326"),
        map.getProjectionObject()
    ), 19);
    drawPlygn = new OpenLayers.Control.DrawFeature(
        drawVctr,
        OpenLayers.Handler.Polygon
    );      
    map.addControl(drawPlygn);
}
share|improve this question
    
Don't want to mark this as a dupe since I'd like to actually see this issued fixed and there's lots of good info here. If this question is resolved then we can close the other as well. gis.stackexchange.com/questions/36774/… –  Vadim Apr 6 '13 at 3:05
add comment

2 Answers

A similar issue has been reported and closed, marked with a comment that it cannot be fixed unless Google Maps fixes an issue on their end. I on the other hand, believe it is fixable by using MVCObject's bindTo. I'll start the conversation on the closed github issue.

share|improve this answer
add comment

Are you using Google Chrome ?

If yes, let me know, I have a hint this may be related to a known problem for Chrome.

https://github.com/openlayers/openlayers/issues/392

best regards,

share|improve this answer
    
This issue is across all browsers, and is due to a delay of Google Maps and OpenLayers staying in sync. –  Andrew Ferk Apr 5 '13 at 16:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.