Skip to content

Commit

Permalink
Add autoOpen option
Browse files Browse the repository at this point in the history
Add option to open automatically a baloon only if there is one single
marker in the map
  • Loading branch information
gioppy committed Mar 5, 2014
1 parent e6f9f78 commit c1f40bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jquery.shakeMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ jQuery.skmap = {
//init clusterer
$.skmap.markerManager.push(new MarkerClusterer($.skmap.mapHash[api.getMap(target)].map, $.skmap.markers[api.getMap(target)], clusterOptions));
}

if($.skmap.markers[api.getMap(target)].length == 1 && settings.autoOpen){
google.maps.event.trigger($.skmap.markers[api.getMap(target)][0], 'click');
}
}

if(update){
Expand Down Expand Up @@ -365,6 +369,7 @@ jQuery.skmap = {
data:"", //string, object
action:"infowindow", //infowindow, infobox, direct, null
markerClick:function(marker){},
autoOpen:false, //used only with one marker
spider:false,
sidebar:{
active:false,
Expand Down

0 comments on commit c1f40bf

Please sign in to comment.