[OpenLayers-Trac] Re: [OpenLayers] #3050: OpenLayers is drawing layers at wrong coordinates

OpenLayers trac-20090302 at openlayers.org
Wed Feb 9 15:35:28 EST 2011


#3050: OpenLayers is drawing layers at wrong coordinates
-----------------------+----------------------------------------------------
 Reporter:  scap2000   |       Owner:  euzuro      
     Type:  bug        |      Status:  new         
 Priority:  major      |   Milestone:  2.11 Release
Component:  Layer.WMS  |     Version:  2.10        
 Keywords:             |       State:              
-----------------------+----------------------------------------------------

Comment(by scap2000):

 == UPDATE #1: I think this happens on negative coordinates (where both are
 negatives) ==


 Also Marker layers goes wrong, adding


 {{{
             var size = new OpenLayers.Size(21,25);
             var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
             var icon = new
 OpenLayers.Icon('http://www.openlayers.org/dev/img/marker.png', size,
 offset);
             var markers = new OpenLayers.Layer.Markers( "Markers" );
             markers.addMarker(new OpenLayers.Marker(new
 OpenLayers.LonLat(-65.4013118577086, -24.7894029247747),icon));


 }}}

 before the line
 {{{
             map.addLayers([gmap, ghyb, wms]);
 }}}
 and replace this line
 {{{
             map.addLayers([gmap, ghyb, wms]);
 }}}
 with this line
 {{{
             map.addLayers([gmap, ghyb, wms, markers]);
 }}}

 Marker is drawn at (0,0) as shown below

 [[Image(http://i.imgur.com/ZLfZd.png)]]

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3050#comment:1>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list