1<img src="place.jpg" alt="Workplace" usemap="#workmap" width="400" height="379">
2
3<map name="workmap">
4 <area shape="rect" coords="34,44,270,350" alt="Computer" href="computer.htm">
5 <area shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm">
6 <area shape="circle" coords="337,300,44" alt="Cup of coffee" href="coffee.htm">
7</map>
1`<!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
5 <title>Directions between places</title>
6<style>
7 html, body {
8 height: 100%;
9 margin: 0;
10 padding: 0;
11 }
12 #map {
13 height: 100%;
14 }
15</style>
16 <script type="text/javascript"
17 src="http://maps.google.com/maps/api/js?sensor=false"></script>
18</head>
19<body>
20 <div id="map"></div>
21 <script type="text/javascript">
22
23 var directionsService = new google.maps.DirectionsService();
24 var directionsDisplay = new google.maps.DirectionsRenderer();
25
26 var map = new google.maps.Map(document.getElementById('map'), {
27 zoom:7,
28 mapTypeId: google.maps.MapTypeId.ROADMAP
29 });
30
31 directionsDisplay.setMap(map);
32
33 var request = {
34 origin: 'bubble origin formatted as address', destination: 'bubble destination formatted as address',
35 travelMode: google.maps.DirectionsTravelMode.DRIVING
36 };
37
38 directionsService.route(request, function(response, status) {
39 if (status == google.maps.DirectionsStatus.OK) {
40 directionsDisplay.setDirections(response);
41 }
42 });
43 </script>
44</body>
45</html>`
46
1the map defines what url will be assigned to that shape over the the image
2
3<style>
4img {
5 display: block;
6 margin: 0 auto;
7 width: 260px;
8 height: 248px;
9}
10 </style>
11 <map name="infographic">
12 <area shape="rect" coords="184,6,253,27"
13 href="https://mozilla.org"
14 target="_blank" alt="Mozilla" />
15 <area shape="circle" coords="130,136,60"
16 href="https://developer.mozilla.org/"
17 target="_blank" alt="MDN" />
18 <area shape="poly" coords="130,6,253,96,223,106,130,39"
19 href="https://developer.mozilla.org/docs/Web/Guide/Graphics"
20 target="_blank" alt="Graphics" />
21 <area shape="poly" coords="253,96,207,241,189,217,223,103"
22 href="https://developer.mozilla.org/docs/Web/HTML"
23 target="_blank" alt="HTML" />
24 <area shape="poly" coords="207,241,54,241,72,217,189,217"
25 href="https://developer.mozilla.org/docs/Web/JavaScript"
26 target="_blank" alt="JavaScript" />
27 <area shape="poly" coords="54,241,6,97,36,107,72,217"
28 href="https://developer.mozilla.org/docs/Web/API"
29 target="_blank" alt="Web APIs" />
30 <area shape="poly" coords="6,97,130,6,130,39,36,107"
31 href="https://developer.mozilla.org/docs/Web/CSS"
32 target="_blank" alt="CSS" />
33</map>
34<img usemap="#infographic" src="https://interactive-examples.mdn.mozilla.net/media/examples/mdn-info.png" alt="MDN infographic" />
35