/** * DokuWiki Plugin Googlemaps3 * * @license GPL 3 (https://www.gnu.org/licenses/gpl-3.0.html) * @author Bernard Condrau * @version 2021-05-12, for Google Maps v3 API and DokuWiki Hogfather * @see https://www.dokuwiki.org/plugin:googlemaps3 * @see https://www.dokuwiki.org/plugin:googlemaps * * Complete rewrite of Christopher Smith's Google Maps Plugin from 2008 with additional functionality * script.js javascript map initialisation */ // initialise all maps, corresponding markers, and kml function initMap() { var nodes = document.body.getElementsByTagName('div'); var i=0; for (var j=0; j 0) { for (j=0; j' + (options.title ? '

'+options.title+'

' : '') + (options.img ? '' : '') + (options.info ? '

'+options.info+'

' : '') + (options.dir ? '

'+options.dir+'

' : '') + ''; const infoWindow = new google.maps.InfoWindow({content: markerInfo,}); marker.addListener('click', () => { infoWindow.open(map, marker); }); } } function attachAddressMarker(map, options) { const geocoder = new google.maps.Geocoder(); geocoder.geocode({'address': options.lng}, function(results, status) { if (status=='OK') { attachMarker(map, options, results[0].geometry.location); } else { console.log('Googlemaps3 Plugin: geocode failed, status='+status); } }); } function pantoMapAddress(map, address) { const geocoder = new google.maps.Geocoder(); geocoder.geocode({'address': address}, function(results, status) { if (status=='OK') { map.setCenter(results[0].geometry.location); } else { console.log('Googlemaps3 Plugin: geocode failed, status='+status); } }); } }