cannot geocode in other browser
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 开发者_StackOverflow社区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
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.
精彩评论