/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function createMarker(point, id, name, address, rooms_sale, rooms_rent ) { var marker = new GMarker(point); marker.value = id; GEvent.addListener(marker, "click", function() { console.log('You clicked on ID ' + id); }); GEvent.addListener(marker, "mouseover", function() { var pointInfo = '<h2 style="margin: 0 0 .5em 0;">' + name + '</h2><p><strong>' + address + '</strong><br />' + rooms_sale + ' habitaciones de venta<br />' + rooms_rent + ' habitaciones de alquiler.</p>'; marker.openInfoWindowHtml(pointInfo); }); return marker; }