javascript - Creating a link to a certain marker on a google map -
I use this example to implement a Google Maps Store Locator:
It works fine But I'm trying to show in the list instead of the drop down list in the actual It is currently linked to the selected option in the dropdown, but I Instead every Then you can add click events to all Lee items and pass the marker number in it you can click on this kind of event: This selection maker should apply to all Li to make it work. ul I've changed the results to show the result as
li but I Link can not be found to work
li links I want to make it requires a little change I:
function load () {map = new google.maps.Map (document.getElementById ( "map"), {center: new google.maps lots Long (53.438065, -1.823730), Zoom 4, map Taipiid 'roadmap' map type Kantrolopts: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}}); InfoWindow = new google.maps.InfoWindow (); Choose Location = Document. GetElementById ("Choose Location"); LocationSelect.onchange = function () {var markerNum = locationSelect.options [locationSelect.selectedIndex] .value; If (MarkerNum! = "None") {google.maps.event.trigger (marker [markmarknum], 'click'); }}; } Function search location () {var address = document.getElementById ("addressInput"). Values; Var Geocoder = new google.maps.Geocoder (); Geocoderkgeocode (address {Address}, function (result, status) {if (state == google.maps.GeocoderStatus.OK) {searchLocationsNear (results [0] .geometry.location);} and {alert (n + ' did not get'); } }); }
select the function markers (markers New) {google.maps.event.trigger (marker [Markrnm], "click") are; };
Comments
Post a Comment