You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to be able to specify a maximum zoom when "zoom=auto" is used. This
would limit only the initial load, not what the user can zoom manually.
My use for this is for context-sensitive maps. Readers of my blog will want to
know where in the world I am generically, not what street I am on. If a
particular page of posts includes only one street in one city, I still want a
larger regional view showing the country/state/etc.
Below is the code I added to my own installation to achieve this in version
1.3.8. I just added the new tag, I did not modify the web interface to allow
setting default values.
Usage for my implementation would be:
[geo_mashup_map map_content="context" zoom="auto" auto_zoom_max="5"]
<?php GeoMashup::map('map_content=contextual&&zoom=auto&auto_zoom_max=5'); ?>
geo-mashup.js-1014- if ( this.opts.zoom === 'auto' ) {
geo-mashup.js:1015: var
map_zoom_level,map_max_zoom_level;
geo-mashup.js:1016: map_zoom_level =
this.map.getBoundsZoomLevel( this.location_bounds );
geo-mashup.js-1017- map_max_zoom_level =
parseInt(this.opts.auto_zoom_max, 10);
geo-mashup.js:1018: if (map_zoom_level >
map_max_zoom_level) {
geo-mashup.js:1019: map_zoom_level =
map_max_zoom_level;
geo-mashup.js-1020- }
geo-mashup.js-1021- this.setCenterUpToMaxZoom(
geo-mashup.js-1022-
this.location_bounds.getCenter(),
geo-mashup.js:1023: map_zoom_level,
geo-mashup.js-1024- function() {
GeoMashup.updateVisibleList(); }
geo-mashup.js-1025- );
geo-mashup.js-1026- }
Original issue reported on code.google.com by da...@othalan.net on 2 Dec 2010 at 4:06
The text was updated successfully, but these errors were encountered:
That seems reasonable, thanks for the code.
Just to make it clear, was using zoom="5" not a good option because the auto
zoom will be less in some scenarios?
Original comment by dylankk...@gmail.com on 3 Dec 2010 at 2:25
You are correct.
Readers of my blog will be interested in "where in the world am I today" which
will normally involve relatively short distances for each page of posts. A
static zoom level works great for this most of the time ... unless posts cover
a very big distance (perhaps California,USA to Germany, for example). When
that does happen I want the zoom level to automatically show the wider region
so reader get an overview of where I am talking about.
BTW, brilliant plugin!
Original comment by da...@othalan.net on 3 Dec 2010 at 2:38
This issue was updated by revision r817.
The parameter should continue to work in 1.4, although not with google v3.
That API may require more work due to a delay in the availability of the
calculated auto zoom level.
Original comment by dylankk...@gmail.com on 23 Dec 2010 at 7:30
Original issue reported on code.google.com by
da...@othalan.net
on 2 Dec 2010 at 4:06The text was updated successfully, but these errors were encountered: