Quiero integrar un enlace con un evento onclick a una función como <a href="#" onclick="fireMarker(1);">Map Marker URL 1</a> y <a href="#" onclick="fireMarker(2);">Map Marker URL 2</a> en un menú de salto como
<select id="selectbox" name="" onchange="javascript:location.href = this.value;"> <option value="https://www.yahoo.com/" selected>Option1</option> <option value="https://www.google.co.in/">Option2</option> <option value="https://www.gmail.com/">Option3</option> </select>O
<select onchange="fireMarker(this);"> <option value="15">1</option> <option value="16">2</option> <option value="18">3</option> </select>La función de marcador de fuego es:
function fireMarker(id){ google.maps.event.trigger(markers[id], 'click'); markers[id].setAnimation(google.maps.Animation.DROP); markers[id].setVisible(true); }Cuando hago clic en una opción, quiero que ejecute direcciones URL en el formato URL de marcador de mapa. Espero tener varios menús de salto en la misma página. Gracias.
Reemplace onchange="fireMarker(this); con onchange="fireMarker(valor)"
me gusta:
<html> <head> <script type="text/javascript"> function fireMarker(id) { google.maps.event.trigger(markers[id], 'click'); markers[id].setAnimation(google.maps.Animation.DROP); markers[id].setVisible(true); } </script> </head> <body> <select onchange="fireMarker(value)"> <option value="15">1</option> <option value="16">2</option> <option value="18">3</option> </select> </body>