Map page contact qui ne s'affiche pas

Fermé
Lista - 4 avril 2017 à 20:58
Pitet Messages postés 2826 Date d'inscription lundi 11 février 2013 Statut Membre Dernière intervention 21 juillet 2022 - 5 avril 2017 à 11:20
Bonjour,
Malheureusement je ne suis pas un as de l'informatique j'ai donc j'aimi en place un site en se basant sur un modèle en ligne. Pour la page de contact, la carte (map) il génère une erreur : Petit problème... Une erreur s'est produite
Google Maps ne s'est pas chargé correctement sur cette page. Pour plus d'informations techniques sur cette erreur, veuillez consulter la console JavaScript.
comment faire svp, le modèle est en html
 <div id="content" class="no-top">
<section class="no-top" aria-label="map-container">
<div id="map"></div>
</section>


un dossier js
                    // When the window has finished loading create our google map below
google.maps.event.addDomListener(window, 'load', init);

function init() {
// Basic options for a simple Google Map
// For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
var myLatlng = new google.maps.LatLng(48.856614, 2.352222);

var mapOptions = {
// How zoomed in you want the map to start at (always required)
zoom: 15,
disableDefaultUI: true,
scrollwheel: true,

// The latitude and longitude to center the map (always required)

center: myLatlng, // New York

// How you would like to style the map.
// This is where you would paste any style found on Snazzy Maps.
styles: [{"stylers":[{"hue":"#ff1a00"},{"invert_lightness":true},{"saturation":-100},{"lightness":33},{"gamma":0.5}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#2D333C"}]}]
};

// Get the HTML DOM element that will contain your map
// We are using a div with id="map" seen below in the <body>
var mapElement = document.getElementById('map');

// Create the Google Map using out element and options defined above
var map = new google.maps.Map(mapElement, mapOptions);

var marker = new google.maps.Marker({
position: myLatlng,
map: map,
icon: 'images/map-marker.png',
title: 'Lorem Ipsum'
});



}


Merci

A voir également:

1 réponse

Pitet Messages postés 2826 Date d'inscription lundi 11 février 2013 Statut Membre Dernière intervention 21 juillet 2022 524
5 avril 2017 à 11:20
Salut,

Que dit la console javascript de ton navigateur ?

As tu bien inclus chargé l'API Google Map comme indiqué dans la doc ?
https://developers.google.com/maps/documentation/javascript/overview?hl=fr#Loading_the_Maps_API

Bonne journée,
0