[OpenLayers-Users] Scoping Issue With Yahoo Geocoder

Matt Kenny matthewkenny at gmail.com
Wed Feb 18 15:32:38 EST 2009


Hello Everyone,

I'm having some trouble passing an array of properties to points created
with the yahoo geocoder control:
http://trac.openlayers.org/attachment/ticket/1784/yahoogeocoder.html

I've got a series of address stored in a MySQL database, each of which also
have a 'NAME' property associated with an ambulance company. I'm using a php
script to create a javascript variable which extracts all of these values
from the database. A simple looping function then runs each of them through
the yahoo geocoder

The resulting points are geocoded in the correct location, but attributing
these geocoded points with their respective 'NAME' values is turning out to
be an issue. Each geocoded point is being attributed with the 'NAME' value
for the last row in the array. I 'believe' that the issue is related to
scoping. I 'know' that the issue is related to my knowledge of javascript,
and any help would be greatly appreciated.

I've got a live example running at:
http://www.mkgeomatics.com/apps/air_ambulance/aab_embed_test.php
Clicking on the ambulance markers will yield the result which I have
described above.

The geocoding function for the ambulance companies begins at line 333,
geocodeGroundAmbulance().
The callback function begins at line 358, callbackGroundAmbulance().
Finally, the ID function begins at line 298, IdGroundAmbulance(feat).

Thanks in advance for any tips or suggestions.

-- 
m a t t h e w k e n n y
http://www.mkgeomatics.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090218/87fe7dc6/attachment.html


More information about the Users mailing list