[OpenLayers-Users] Vector layer not drawn when panned with the mouse

Paul Vint pjvint at gmail.com
Tue Jan 24 23:07:22 EST 2012


Good day,

I'm using a KML overlay, and am having an odd problem: When you pan the map
with the mouse, the vector layer is not drawn on the newly visible areas.
If you zoom in or out it will appear. Also, if you pan with the panzoombar
it will display correctly.

As a possible workaround, I added an event:

map.events.on({moveend: function(evt) { alert("Hey"); return true;
trackLogKMLLayer.redraw();} });

The alert & return false I added after to see if it was being triggered.
The interesting thing I found was that this event is not being triggered
when I pan with the mouse, but is when I use the panzoombar.

The layer is being added as follows:

	function activateUploadedTrackLog(f)
	{
		var n = document.getElementById('gpsTrackName').value;
		document.getElementById('gpsTrackName').value = '';
		document.getElementById('gpsTrackFile').value = '';
		trackLogKMLLayer= new OpenLayers.Layer.Vector(n, {
			projection: map.displayProjection,
			strategies: [new OpenLayers.Strategy.Fixed()],
			protocol: new OpenLayers.Protocol.HTTP({
			    url: f,
			    format: new OpenLayers.Format.KML({
				extractStyles: true,
				extractAttributes: true
			    })
			})
		    });

		 map.addLayer(trackLogKMLLayer);

Thoughts?

Thanks

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120124/3be0dd30/attachment.html


More information about the Users mailing list