[OpenLayers-Users] Browsing KML/Marker layer

PPaFin ppafin at gmail.com
Wed Feb 4 03:21:20 EST 2009


Thanks,

This gives me zoom to all of KML points which I have loaded, which is 
needed also.

But what I want is that how do I select first loaded point in loaded KML 
file, zoom into it's location? After this, I would like to step trough 
and auto center every next item in loaded KML trail by pressing 'next' 
button on my webpage.

Goal of mine is to have this kind of GPS trail browser in my web page, 
but I am totally without a clue how to implement this ?

Ideas?

Eric Lemoine wrote:
> 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