I'm having a bit of trouble getting some JavaScript working with CFMAP.  I
currently use a link to center the map and zoom in on a specific location;
this code works fine:

<a
href="javascript:ColdFusion.Map.setCenter('map1',{latitude:#getMapLocations.latitude#,longitude:#getMapLocations.longitude#});javascript:ColdFusion.Map.setZoomLevel('map1',10);">Zoom</a>

Due to the number of locations on the map, I want to provide users with a
way of selecting a location from a dropdown list, and then having the map
zoom and center on the selected location using an onchange event handler in
the select tag.  I feel like this would work, but it doesn't:

<form>
<select name="location" onChange="ColdFusion.Map.setCenter('map1',
this.options[this.selectedIndex].value);ColdFusion.Map.setZoomLevel('map1',10);">
 <option>Select Location</option>
 <cfloop query="getMapLocations"><option
value="{latitude:#getMapLocations.latitude#,longitude:#getMapLocations.longitude#}">#getMapLocations.name#</option>
 </cfloop>
 </select>
</form>

The error that I'm getting is:

Uncaught ColdFusion.Map.setCenter: center should be a textual address or
latitude/longitude pair, id: map1

Any ideas?

Thanks,

Pete


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335093
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to