[OpenLayers-Trac] [OpenLayers] #2878: Stranges with projection

OpenLayers trac-20090302 at openlayers.org
Wed Oct 13 05:19:55 EDT 2010


#2878: Stranges with projection
----------------------+-----------------------------------------------------
 Reporter:  Rus       |       Owner:              
     Type:  bug       |      Status:  new         
 Priority:  minor     |   Milestone:  2.11 Release
Component:  general   |     Version:  2.10        
 Keywords:  OSM EPSG  |       State:              
----------------------+-----------------------------------------------------
 Code:

 map = new OpenLayers.Map ("map", {
         controls:[
         new OpenLayers.Control.Navigation(),
         new OpenLayers.Control.PanZoomBar(),
         //                        new OpenLayers.Control.MousePosition(),
         new OpenLayers.Control.Attribution()
         ],
         maxExtent: new
 OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
         maxResolution: 156543.0399,
         numZoomLevels: 19,
         units: 'm',
         projection: new OpenLayers.Projection("EPSG:4326"),
         displayProjection: new OpenLayers.Projection("EPSG:4326")
     } );

     map.addLayer(new OpenLayers.Layer.OSM());

     var lonLat = new OpenLayers.LonLat(lon, lat)
 //    .transform(new OpenLayers.Projection("EPSG:4326"),
 map.getProjectionObject());
     map.setCenter(lonLat, zoom);

 Without ".transform(new OpenLayers.Projection("EPSG:4326"),
 map.getProjectionObject());" openlayers points me to wrong place. Same
 with Point, Line and so on.

 Buy why? I set projection to whole map "EPSG:4326". and only
 OpenLayers.Layer.OSM has different projection... but when i get
 "map.getProjectionObject()" it returns "EPSG:900913".

 Why map is "EPSG:900913" and not "EPSG:4326"?


 This bug prevent me from usage of GeoRSS because items are written in
 wrong position.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/2878>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list