L'API Google Maps v3 - TypeError: Résultat de l'expression " de google.cartes.LatLng' [non défini] n'est pas un constructeur
Je crée une page html statique à afficher un certain nombre de sites à partir d'un ensemble de données. J'ai juste copié l'un des échantillons et travaillent en arrière, mais j'obtiens l'erreur suivante dans le Safari Inspecteur:
main.js:1SyntaxError: Parse error
sample.htm:10TypeError: Result of expression 'google.maps.LatLng' [undefined] is not a constructor.
Voici mon code html:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Multi Markers Sample via Google Maps</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var myLatlng = new google.maps.LatLng(-30.2965590,153.1152650);
var myLatlng1 = new google.maps.LatLng(-30.2956470,153.1123707);
var myLatlng2 = new google.maps.LatLng(-30.2864430,153.1360230);
var myOptions = {
zoom: 13,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
icon: 'http://www.google.com/intl/en_us/mapfiles/ms/icons/blue-dot.png',
title:"Original Location" });
var marker = new google.maps.Marker({
position: myLatlng1,
map: map,
title:"Tom Cruise" });
var marker = new google.maps.Marker({
position: myLatlng2,
map: map,
title:"Lady Gaga" });
}
</script>
</head>
<body onLoad="initialize()">
<div id="map_canvas"></div>
</body>
</html>
Je ne suis pas sûr de ce que je fais mal ici - cela fonctionne réellement dans IE v8 sur Windows mais pas dans Safari et j'ai besoin de le faire pour les deux.
Vous devez vous connecter pour publier un commentaire.
Ajouter la fonction de rappel de votre demande de google maps.
Il sera exécuté après que Google en charge tout ce dont il a besoin.
salut s'il vous plaît utiliser ce code à l'aide de JQuery
`