Skip to content

Commit

Permalink
added always_show_markers option which forces the map to display mark…
Browse files Browse the repository at this point in the history
…ers on all zoom levels (so they remain visible when zooming in and out)
  • Loading branch information
mokolabs authored and brianjlandau committed Jan 28, 2011
1 parent dff37cc commit f82b655
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ These are options that can be passed to the `jMapping` function to change specif
* `force_zoom_level`:
* *Default*: *N/A*
* This will force the map to **always** be rendered at this zoom level.

* `always_show_markers`:
* *Default*: `false`
* Set this option to `true` if you wish to display markers on all zoom levels. (Normally, the markers may only be visible on certain zoom levels, depending on the normal bounds and zoom level of the marker data.)

Object API
-----------
Expand Down
8 changes: 6 additions & 2 deletions jquery.jmapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,12 @@
};

var updateMarkerManager = function(){
zoom_level = map.getZoom();
min_zoom = (zoom_level < 7) ? 0 : (zoom_level - 7);
if (settings.always_show_markers === true) {
min_zoom = 0;
} else {
zoom_level = map.getZoom();
min_zoom = (zoom_level < 7) ? 0 : (zoom_level - 7);
}
markerManager.addMarkers(gmarkersArray(), min_zoom);
markerManager.refresh();
if (settings.force_zoom_level){
Expand Down

0 comments on commit f82b655

Please sign in to comment.