Hi all,<br><br>right now getDataExtent() only considers the data added LAST (red).<br>But I need the map to zoom in on ALL data in lgpx (green AND red).<br><br>What's my error?<br><br>Thanks,<br>Jan<br><br> lgpx = new OpenLayers.Layer.GML ("green","separated/20090607172151.gpx",{ <br>
projection: new OpenLayers.Projection("EPSG:4326"),<br> style: {strokeColor: "green", strokeWidth: 5, strokeOpacity: 0.8},<br> format: OpenLayers.Format.GPX,});<br>
map.addLayer(lgpx);<br><br> lgpx = new OpenLayers.Layer.GML ("red","separated/20090607110550.gpx",{ <br> projection: new OpenLayers.Projection("EPSG:4326"),<br>
style: {strokeColor: "red", strokeWidth: 5, strokeOpacity: 0.8},<br> format: OpenLayers.Format.GPX,});<br> map.addLayer(lgpx);<br><br> if( ! map.getCenter() ){<br>
lgpx.events.register('loadend', lgpx, function(){map.zoomToExtent(lgpx.getDataExtent())});<br> map.setCenter(null, null);<br> };<br>