Sha256: 1b3f0af08d371f81c8c7fc65b7866bc5a2bf402b3e7848c3ee8c3dcad234a11e
Contents?: true
Size: 822 Bytes
Versions: 24
Compression:
Stored size: 822 Bytes
Contents
$(function() { return $('#map').gmap(); }); $.fn.gmap = function() { return $(this).each(function() { var $el, addr, coords, infowindow, map, mapOptions, marker, myLatlng; $el = $(this); addr = $el.data('addr'); coords = $el.data('coords'); myLatlng = new google.maps.LatLng(coords[1], coords[0]); mapOptions = { zoom: $el.data('zoom'), center: myLatlng, mapTypeId: google.maps.MapTypeId[$el.data('type')] }; map = new google.maps.Map($el[0], mapOptions); infowindow = new google.maps.InfoWindow({ content: addr }); marker = new google.maps.Marker({ position: myLatlng, map: map, title: addr }); return google.maps.event.addListener(marker, "click", function() { return infowindow.open(map, marker); }); }); };
Version data entries
24 entries across 24 versions & 1 rubygems