[OpenLayers-Users] Virtual Earth layer: Layers disagreement

IЯON disiron at ya.ru
Mon Aug 10 06:12:11 EDT 2009


Good day! I'm newbie in OpenLayers. I'm using VE layer to track some points.

Conditions:
1. Draw some points & lines between them
2. Set zoom to min.value
3. Move map with dragging to extreme left position (for example)

Results:
1. Base layer haven't moved at all (because map can be visible wholly with minimal zoom & there's no need to move it)
2. Markers have stayed on the correct positions with a map.
3. Lines have moved according to mouse offset. But it's wrong. They must stay with marker's and base layers.

Could you please give me a hint, what can be wrong in my actions?

I place my code below:

map = new OpenLayers.Map("map", mapOptions); 
veLayer = new OpenLayers.Layer.VirtualEarth("Virtual Earth Raods", { 'type': VEMapStyle.Road, 'sphericalMercator': true, numZoomLevels: veMaxZoom });

layerLines = new OpenLayers.Layer.Vector("Lines");  

..



// Get polylines for particular tracks
function GetLines(groupedTracks) {

..
        $(groupItem.TrackData).each(function() {
            var point = new OpenLayers.Geometry.Point(this.lon, this.lat);
            OpenLayers.Projection.transform(point, new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
            layerPoints.push(point);            
        });
        lines.push(new OpenLayers.Feature.Vector(
                new OpenLayers.Geometry.Collection(new OpenLayers.Geometry.LineString(layerPoints)),
                null, GetLineStyle(this)));        
    });
    return lines;
}



More information about the Users mailing list