[OpenLayers-Users] Help with get feature info

Ali Khan akhan at unfpa.org
Tue Jun 5 10:23:49 EDT 2007


Thanks for the correction. on the markers.event..I'm still having 
trouble understanding how to get a feature. I tried learning from the 
CIA Factbook. From what i've read the vmap 0 has political boundires and 
some global data. I tried to make it work but when i click on an area i 
simply get the 'Loading ...' line. Below is a link to it. All i'm trying 
to do at this point is get the country name.

http://www.fluxnyc.com/map/map.cfm

Christopher Schmidt wrote:
> On Mon, Jun 04, 2007 at 11:19:03AM -0400, Ali Khan wrote:
>   
>> Hey, so i've got a few markers on a page when i click the marker i want 
>> to query a database and load the result into a div. the latter part i 
>> have down. In the database the URL or Lon/Lat will be stored of the 
>> marker (Each marker will have a unique image).
>>
>> So far i have this
>>     markers.events.register("click", markers, function(e) {
>>             alert(this.icon.url);
>> }
>>
>> however this.icon.url seems to not be valid according to FireBug and 
>> isn't causing an alert box. How can I get the URL of a Marker icon or 
>> perhaps the Lon/Lat instead?
>>     
>
> 'markers' is probably not the object you want to register a click event
> on. You'll need to register these events on each individual marker,
> using markers.events.register("click", marker... ) 
>
> Regards,
>   





More information about the Users mailing list