I've been trying to have a tag occur when I hover over each of the markers on this map, describing what Is here and why to visit these places, but I don't know how. Does anybody know how to make this happen?
What I have tried:
This is what I've been working with. Since I don't know hot to make the tags appear, they are not in the code.
<!DOCTYPE html>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Assignment 10 Part 2
#map {
height: 100%;
}
html, body {
height: 100%;
margin: 0;
padding: 0;
}
<div id="map"></div>
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 3,
center: {lat: 40.699448, lng: -74.010264, zoom: 11}
});
var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var markers = locations.map(function(location, i) {
return new google.maps.Marker({
position: location,
label: labels[i % labels.length]
});
});
// Add a marker clusterer to manage the markers.
var markerCluster = new MarkerClusterer(map, markers,
{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
}
var locations = [
{lat: 40.689290, lng: -74.044490},
{lat: 40.711475, lng: -74.012650},
{lat: 40.782832, lng: -73.966986}
]