On Jan 27, 9:59 am, vincent <[email protected]> wrote:
> Hello
> i have a simple map with a google search field.

That's a Local Search bar. It's used to search for businesses and the
like.

> http://www.weltmeer.ch/Divelog/VincentDiveLog.html
> looking for the GPS Position: 27°46.000´N 34°15.200´E
> he don't find it

It's not a business name or type.

> going tohttp://maps.google.ch/
> and looking for the GPS Position it works fine
>
> Why is this? And what should i add to the code it would finde the
> place?

Google Maps uses far more than *just* the API or *just* the Local
Search bar. It will actually recognise a geographic coordinate and not
attempt to search for it at all.

You should be parsing the location yourself in order that you can
create a GLatLng object yourself. The geocoder tries to make sense of
such a string BUT it returns the nearest place that it knows about:
26.820553,30.802498 which is in the Egyptian desert. Probably not a
dive location!

Neither the Local Search bar or the geocoder are appropriate for this.

The easy solution is to put your own input fields on the page, one for
latitude and one for longitude, and then construct a GLatLng using
their content. It will work if you put something like 27.76 for
latitude and 34.26 for longitude and you parseFloat() those text
strings to create numbers.

A harder solution is to use a single text input box and then parse
whatever is put in it to attempt to extract coordinates.

Look up handling form fields with Javascript and how to use parseFloat
().

-- 
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.

Reply via email to