0

Hi I created a mashup where a user can enter a location.When using IE7 almost all the location can be geocoded but not with other browsers......what do you think is the issue here or is there a fix for this?I use javascript geocoding like:

 function addToMap(response) {
       var x="Fa, France";
        // Retrieve the object
        if (x.length > 0 && x != "") {
            if (!response || response.Status.code != 200) {
                alert("Please enter a valid location.I cannot geocode it!"); 
            }
            else
            {
                place = response.Placemark[0];

                // Retrieve the latitude and longitude
                point = new GLatLng(place.Point.coordinates[1],
                          place.Point.coordinates[0]);

                // Center the map on this point
                map.setCenter(point, 4);}}

...more code

casperOne
  • 73,706
  • 19
  • 184
  • 253
  • Have you tried using FireBug in Firefox to figure out where the problem is occurring? Try stepping through. – BobbyShaftoe Nov 02 '09 at 00:40
  • I tried it but no errors.....everything is fine. – clrence Nov 02 '09 at 00:43
  • You are missing some code in the sample you entered. Where is the GClientGeocoder? Where do you make your call? I suggest you post "more code" or maybe a link to your test page? – RedBlueThing Nov 02 '09 at 01:25

1 Answers1

1

In recent versions of the API it has become necessary to use Numbers as the parameters for GLatLng(). In previous releases you could often get away with leaving them as String objects, as you are doing.

Try using parseFloat(place.Point.coordinates[1]), parseFloat(place.Point.coordinates[0])

I've no idea why MSIE7 should be any different, or why you're not getting a clear error message in Firebug. Perhaps there's something you're not telling us.

Mike Williams
  • 7,739
  • 2
  • 24
  • 12