thanks, Andrew. My current setup is quite similar to that although not working efficiently just yet.
Thanks again. On Jan 17, 5:18 pm, Andrew Leach <[email protected]> wrote: > On Jan 17, 5:09 pm, NickUk <[email protected]> wrote: > > > The aim of the game is for a user to enter a postcode or address and > > have the nearest office to that address have a marker pop up above it. > > Ok. That should be straightforward. > > > I decided to save the offices in an xml. So I've tried to read the xml > > file's office postcodes, convert them to a GLatLng and save the lat > > and long in the xml file. But of course, I cannot save the xml file in > > javascript. > > The offices don't move, so you really should save the coordinates in > the XML file. Mike has an example: first one on the page > athttp://econym.org.uk/gmap/geomulti.htm > > Once you have the coordinates in the XML, you can read in the data and > store each coordinate as an element in an array. When the user clicks > the map, use GLatLng.distanceFrom() to get the distance for each array > element, so you can calculate the nearest: then add the marker(s) on > the map. It may be useful to put a marker at the click as well as the > office location. > > > Here's my next problem. The client will want this on their server/ > > system, so I haven't been able to use my asp.net super powers - its > > purely a javascript/html jobby. > > It wouldn't be as easy. All client-side is far easier in this case. > What you could do, though, if server-side scripting is available, is > include the data from the XML file in the page you deliver to the > client: that saves a round-trip requesting it. Just write out hard- > coded locations into the Javascript. > > Andrew
-- You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
