[OpenLayers-Users] WMSgetFeatureInfo fire click event programmatically

Andreas Hocevar ahocevar at opengeo.org
Tue Jan 31 11:43:54 EST 2012


In this case you could open a popup at the xy position. This will pan
the map into view. And on moveend, you fire the click event. Not sure
if this workflow meets your requirements though. If not, you'd have to
pan the map into view programmatically before firing the click event.

Andreas.

On Tue, Jan 31, 2012 at 5:30 PM, Morper-Busch, Lucia
<Lucia.Morper-Busch at sbg.ac.at> wrote:
> Thank you Andreas,
> but when the the lon, lat coordinates are outside of extent of the map?
> I think about a auxiliary map with a big extent...
> Lucia
>
> Dipl.-Geogr. Lucia Morper-Busch | Researcher
> University of Salzburg | Centre for Geoinformatics - Z_GIS
> Schillerstr.30 | Techno-Z, Block 15, 3rd floor, Room 320 | 5020 Salzburg, Austria
> Phone +43 (0)662 8044 5298 | Fax +43 (0)662 8044 5260
>> Z_GIS...experts for the spatial view
>
>
> -----Ursprüngliche Nachricht-----
> Von: andreas.hocevar at gmail.com [mailto:andreas.hocevar at gmail.com] Im Auftrag von Andreas Hocevar
> Gesendet: Dienstag, 31. Jänner 2012 15:26
> An: Morper-Busch, Lucia
> Cc: openlayers-users at lists.osgeo.org
> Betreff: Re: [OpenLayers-Users] WMSgetFeatureInfo fire click event programmatically
>
> Hi,
>
> the least dirty way to do it is to fire a click event on the map:
>
> map.events.triggerEvent("click", {xy: map.getPixelFromLonLat(lon, lat)});
>
> Andreas.
>
> On Tue, Jan 31, 2012 at 2:15 PM, Morper-Busch, Lucia
> <Lucia.Morper-Busch at sbg.ac.at> wrote:
>> Hello,
>>
>> I want to fire the getfeatureinfo event of the
>> OpenLayers.Control.WMSGetFeatureInfo programmatically.
>>
>> I have x and y of a point (from Google geocoder) and want to display the
>> featureinfo at this point without clicking on the map.
>>
>> Has anyone an idea?
>>
>> Best regards
>>
>> Lucia
>>
>>
>>
>> Dipl.-Geogr. Lucia Morper-Busch | Researcher
>>
>> University of Salzburg | Centre for Geoinformatics - Z_GIS
>>
>> Schillerstr.30 | Techno-Z, Block 15, 3rd floor, Room 320 | 5020 Salzburg,
>> Austria
>>
>> Phone +43 (0)662 8044 5298 | Fax +43 (0)662 8044 5260
>>
>>> Z_GIS...experts for the spatial view
>>
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>
>
>
> --
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list