Copy link to clipboard
Copied
I realize this is less of a coldfusion question and more of a google api question but I figured you guys would know more about the integration within coldfusion than others. I am using the coldfusion/google maps tutorial available here: http://tutorial397.easycfm.com/
I am using the "multiple markers" part. So I have a query that pulls all of the Long and Lat information and it displays it in the map perfectly. It is fully functional with the exception the map does not automatically zoom and center so all of the points are visible. I am currently manually inputing a zoom level and long, lat to center. Does anyone here have experience with automatically centering and zooming dynamic data in google maps api. I have searched the internet endlessly and have been unable to find a tutorial or peice of code that 'actually' works with the code I am using.
Thanks in advance,
Mark
Copy link to clipboard
Copied
Didn't this code work?
map.centerAndZoom(new GPoint(<cfoutput>#mylng#, #mylat#</cfoutput>), 3);
-- Prasanth
Copy link to clipboard
Copied
The long and lat variables are retrieved off of one single variable #myzipvar#. Seeing as how the map will sometimes have things in multiple zip codes, and the need to automatically center and zoom appropriately, that code you copied and pasted only serves to provide a center/zoom based on a zip code. Is there a way I can take the lat and long of each point and formulate something that automatically centers it and zooms.
Any ideas?