[OpenLayers-Users] Zooming Bug still there?

coderage code.rage at yahoo.com
Wed Sep 26 06:12:36 EDT 2007


Hi,

I wish i cud give the URL, but cant coz im behind a firewall, but i can
arrange if thats the only way.
Im putting the code here if this helps.
Thanks.

Code
---------------------------------------------------------------------------------

       function init(){
          map = new OpenLayers.Map('map', {controls:[], 'projection':
'EPSG:2345', 'units':'m'}); 
          
          OpenLayers.IMAGE_RELOAD_ATTEMPTS = 5;
          
          var bounds = new
OpenLayers.Bounds(55.5329426294,36.5123,55.9343394982,36.5686827926)
          tiled = new OpenLayers.Layer.WMS(
            "Geoserver layers", "http://localhost:8080/geoserver/wms",
            {
              height: '582',
              width: '800',
              layers: 'mybase',
              styles: '',
              srs: 'EPSG:2345,
              format: 'image/png', tiled: 'true', tilesOrigin :
"55.5329426294,36.5123"
            },
            {maxExtent: bounds, maxResolution: 7.867065187499855E-4,
projection: "EPSG:2345", buffer: 0} 
          );
          map.addLayer(tiled);
           
	      map.addControl(new OpenLayers.Control.PanZoomBar({div:$('nav')}));
		  map.addControl(new
OpenLayers.Control.LayerSwitcher({'ascending':false}));
          map.addControl(new OpenLayers.Control.MouseToolbar());
          map.addControl(new OpenLayers.Control.MousePosition({element:
$('position')}));
          map.addControl(new OpenLayers.Control.OverviewMap());
          map.zoomToExtent(bounds);

		  
		var markers = new OpenLayers.Layer.Markers( "Markers",{'calculateInRange':
function() { return true; }});
		map.addLayer(markers);

		var size = new OpenLayers.Size(12,20);
		var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
		var icon = new OpenLayers.Icon('f:\red.png',size,offset);

		marker = new OpenLayers.Marker(new
OpenLayers.LonLat(55.5664,36.5212),icon.clone());
        marker.setOpacity(1);
        marker.events.register('mousedown', marker, function(evt) {
alert("Hello World"); Event.stop(evt); });
        markers.addMarker(marker);




Christopher Schmidt-4 wrote:
> 
> On Tue, Sep 25, 2007 at 11:56:59AM -0700, coderage wrote:
>> 
>> Hi
>> I read in another post, the error of "displaced markers on zooming " is
>> fixed in OpenLayers ver 2.4, im using same version with GeoServer 1.5.
>> When
>> i zoom in past level 7, markers are displaced. This bug persists or im
>> doing
>> sumthing wrong? I think problem lies in offset calculation but dont know
>> how
>> to fix it.
>> Any suggestions please?
> 
> Do you have a URL that is showing the problem?
> 
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/Zooming-Bug-still-there--tf4517324.html#a12897859
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list