On Jan 27, 8:02 pm, "[email protected]" <[email protected]> wrote: > On Jan 27, 7:49 pm, charitywater <[email protected]> wrote: > > > > > Hi, > > > I've been told this can't be done easily, but I thought I'd ask this > > question anyway- > > I've created this > > map:http://www.charitywater.org/projects/map_googlemaps.php > > > And it's searchable by GPS coordinates, so when a user searches a > > given GPS, they are taken to the placemark that's associated with it. > > > Ex: 14.03166667, 39.0025 > > > currently, I've got some simple code that takes them to the marker and > > centers the marker in the middle of the page. > > > So my question is- is it possible to have the marker open > > automatically when a user searches for this GPS? > > Sure. As Marcelo likes to say "anything is possible". > > What is the accuracy with which you want to say that the coordinates > are correct? > > You will need to modify your code to create an array of markers (or > use one o the third party kml parsers that expose the array of markers > or write your own). Then when the user enters a set of coordinates, > search through that array for a marker within your specified > "zone" (you can use GLatLng.distanceFrom() to check how close the > entered point is to each marker), then generate a click event on any > marker that meets your criteria...
Proof of concept: http://www.geocodezip.com/charitywater_org_map_googlemapsA.html opens the infoWindow if the gps coordinates entered are within 10 meters of the marker. Uses this undocumented "trick" with GGeoXml (not future proof) from Mike Williams' tutorial: Part 36 Tricks with GGeoXml http://econym.org.uk/gmap/interceptor.htm -- Larry > > > > > thanks in advance! -- 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.
