J'ai écrit un script pour afficher plusieurs marqueurs de carte avec la recherche par code postal, ou adresse pour afficher la distance entre les marqueurs multiples et l'emplacement donné de l'utilisateur mais .. je veux afficher infoWindow avec du contenu que je vais écrire à chacun des marqueurs ... Quelqu'un peut-il m'aider ??Google Maps Javascript Api. Marqueurs de la carte infoWindow
Le script va comme ceci:
var features = [
{
position: new google.maps.LatLng(38.089374, 23.809245),
type: 'info'
}, {
position: new google.maps.LatLng(37.865212, 23.744748),
type: 'info'
}, {
position: new google.maps.LatLng(37.997172, 23.693429),
type: 'info'
}, {
position: new google.maps.LatLng(37.934769, 23.879542),
type: 'info'
}, {
position: new google.maps.LatLng(38.003720, 23.886767),
type: 'info'
}, {
position: new google.maps.LatLng(38.027083, 23.850951),
type: 'info'
}, {
position: new google.maps.LatLng(37.944077, 23.661457),
type: 'info'
}, {
position: new google.maps.LatLng(38.017348, 23.796585),
type: 'info'
}, {
position: new google.maps.LatLng(37.955754, 23.677229),
type: 'info'
}, {
position: new google.maps.LatLng(37.971261, 23.756350),
type: 'info'
}, {
position: new google.maps.LatLng(37.990022, 23.720621),
type: 'info'
}, {
position: new google.maps.LatLng(38.050031, 23.752440),
type: 'info'
}, {
position: new google.maps.LatLng(38.464754,23.615317),
type: 'info'
}, {
position: new google.maps.LatLng(37.943692, 23.748214),
type: 'info'
}, {
position: new google.maps.LatLng(39.544696, 21.775843),
type: 'info'
}, {
position: new google.maps.LatLng(40.668344, 22.889161),
type: 'info'
}, {
position: new google.maps.LatLng(40.662039, 22.911951),
type: 'info'
}, {
position: new google.maps.LatLng(40.573629, 23.025070),
type: 'info'
}, {
position: new google.maps.LatLng(40.303271, 21.804128),
type: 'info'
}
];
// edw oi kaloi oi markers.
features.forEach(function(feature) {
var marker = new google.maps.Marker({
position: feature.position,
icon: icons[feature.type].icon,
map: map
});
});
Il n'y a pas de [InfoWindows] (https://developers.google.com/maps/documentation/javascript/infowindows) dans le code affiché. – geocodezip
oui, parce que peu importe combien j'ai essayé d'insérer InfoWindows, ils ne fonctionnent pas correctement. comme vous pouvez voir les caractéristiques de var sont mes marqueurs et même si je mets n'importe quel morceau de code pour un infowindow ne montre pas, ou je peux voir la fenêtre quand je clique mais son vide ... (pardonnez-moi si je n'ai pas fait cela peut-il être une nouvelle cause?) – elusivesmoke
Pouvez-vous montrer à quoi ressemble votre code lorsque vous essayez d'insérer la fenêtre d'information? Ensuite, nous pouvons vous dire ce que vous avez mal fait. – Jacob