Objective:
Create a plugin to simplify the integration of maps googlemaps (R) with the V3 API. The plugin must return the jQuery object and apply the maps to all selected elements. Why version 3? The second is outdated and simple google has stopped supporting it.
The plugin:
Basic Call:
$ ("# Map"). TekMap ();
is not very useful but it creates a map centered. But we can do more interesting things such as adding bookmarks.
$(“#map”).TekMap({
lat: 42.2,
lng: 3.2,
mapoptions : {
zoom: 12,
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false
},
markers : [{ lat: 42.2, lng: 3.2, draggable:false, infowindow:"Hello" }]
}
)
Added html tag initialization :
<div class="map" data-lat='42.99624282178582' data-lng='1.933349609375' data-markers='[{"lat":42.99624282178582,"lng":1.933349609375,"draggable":false,"infowindow":"Tekmap demo by Comunicatek!"}]'></div>
and then
<pre><p>$ (".map"). TekMap ();</p></pre>
More info at here.