This time I will share jQuery Plugin and tutorial about jQuery Plugin For Google Maps API Manipulation – Google Map, hope it will help you in programming stack.
Google Map is a lightweight jQuery plugin that enables you to create maps, markers or routes for your own complete google map using google maps API 3.
Features:
- Allows to create 4 types of maps: road map, satellite map, hybrid and terrain.
- Allows to create map markers with links, infoview and personal icons.
- Allows you to create a route between a start postal address to an arrival postal address or GPS coordinates.
- Callback supported.
Basic Usage:
1. Include jQuery library and jQuery Google Map plugin on the web page
1 |
< script src = "jquery-latest.min.js" ></ script > |
2 |
< script src = "jquery.googlemap.js" ></ script > |
2. Load the Google Maps JavaScript API on the page.
3. Create a container to place your Google Map
1 |
< div id = "map" style = "width: 400px; height: 300px;" ></ div > |
4. Call the plugin to create a simple Google Map
4 |
coords: [48.895651, 2.290569], |
5. Complete settings with default values.
04 |
coords : [48.895651, 2.290569], |
08 |
overviewMapControl: false , |
09 |
streetViewControl: false , |
6. Add a marker & infowindow to the Google Map.
02 |
coords: [48.895651, 2.290569], |
06 |
title: 'Info Window Title' , |
07 |
text: 'HTML Content Here' , |
10 |
success: function (e) { |
11 |
$( "#latitude" ).val(e.lat); |
12 |
$( "#longitude" ).val(e.lon); |
7. Add a route to the Google Map.
02 |
start: "Start Address" , |
03 |
end: [48.895651, 2.290569], |
07 |
[48.85837009999999, 2.2944813000000295], |
08 |
"Porte Maillot, 75017 Paris" , |
8. Remove a marker from the Google Map.
1 |
$( "#map" ).removeMarker( "marker1" ); |
9. Remove all markers & routes from the Google Map.
1 |
$( "#map" ).removeMarker( "marker1" ); |
Changelog:
2019-03-21
- Close infowindow when another marker is clicked
- Doc updated
- Demo updated
2018-10-16
- Get Zipcode in the addMarker success function.
2016-03-21
2015-11-20
- Update jquery.googlemap.js
2015-08-15
2015-07-16
- Update jquery.googlemap.js
2015-06-16
v1.3.1 (2014-04-10)
v1.3.0 (2014-01-09)
- Add waysteps and debug option
This awesome jQuery plugin is developed by Tilotiti. For more Advanced Usages, please check the demo page or visit the official website.