[OpenLayers-Users] Browsing KML/Marker layer

Eric Lemoine eric.c2c at gmail.com
Wed Feb 4 00:43:17 EST 2009


Hi

In the loadend listener you can do the following to zoom to the
smallest extent bounding the loaded features:

map.zoomToExtent(gmlLayer.getDataExtent());

Cheers,

Eric

2009/2/3, ppafin <ppafin at gmail.com>:
> Hi,
>
> I've been experimenting a lot with openlayers and I am able to produce
> markers and loading KML file with OpenLayers.Layer.GML() on map.
>
> But now I am stuck with a problem, that I cannot figure out how to
> handle that loaded data on map.
>
> 1. I would like to have small application which loads KML file, displays
> it on map and offers controls on web page to cycle entries on that KML
> map. (I can select KML point and have a pop up from that, but it's not
> what I need).
>
> 2. Question is; how do I fire event to trigger centering and selecting
> item on loaded KML layer ?
>
> (So far I have found out that I have 510 points in my KML file with
> this: kml_layer.events.register('loadend', this, function() {
> alert("Points:"+kml_layer.features.length); }); )
>
> Any ideas?
>
>
>
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list