Sorry, the forums are locked while I handle some maintenance.

 
This Forum is Currently Locked – Access is Read Only
You must be logged in to post Login


Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Setting Zoom Level

UserPost

6:47 am
January 27, 2010


Chris

UK

New Member

posts 1

Great pluggin, and after a bit of tinkering around, I managed to get it working. Just one question, is there a way to control what the default ZOOM level is on the map?

Here is an example of where I am using it:

http://www.theoutdoors.org.uk/barrington…..-loop.html

I would like the default zoom level to be FOUR ZOOMS OUT from the default (if that makes sense?) i.e. click on – symbol 4 times. Is this possible?

12:23 pm
January 27, 2010


AaronCampbell

Admin

posts 242

There's no functionality in the plugin to handle this.  The Javascript could be modified to do it, but I don't know what modifications would be needed off the top of my head.

Upset at my slow responses recently? Please read my explanation.

2:09 pm
February 5, 2010


daymobrew@yahoo.com

Dublin, Ireland

New Member

posts 1

In wp-google-maps.js the default zoom is 13:

  wpGMaps.map[mapNum]['map'].setCenter(point, 13);

This line could be replaced by the following 4 lines:

  if (!this.map[mapNum]['mapInfo'].get('zoom')) {

    this.map[mapNum]['zoom'] = this.map[mapNum]['mapInfo'].get('zoom');

  }

  wpGMaps.map[mapNum]['map'].setCenter(point, this.map[mapNum]['zoom']);

Of course this is less than half the story – the wp-google-maps.php code will have to be modified to prompt for the required zoom.

7:02 pm
March 11, 2010


office@myrivne.org

Rivne, Ukraine

New Member

posts 1

it is impossible to set zoom level?

I guess it is veryy needed for many people.

Some other plugins can do it???

 

Thank you,

 

1:39 pm
May 16, 2010


spblinux

New Member

posts 2

Post edited 1:51 pm – May 16, 2010 by spblinux


Added support for zoomlevel and satellite view.

Example:

 

zoomlevel, satellite

php file: wp-google-maps.php (changes as diff below)

— bak/wp-google-maps.php    2010-01-05 18:22:00.000000000 +0100
+++ wp-google-maps.php    2010-05-16 21:14:22.000000000 +0200
@@ -232,6 +232,8 @@
 
         $mapInfo = (object)shortcode_atts(array('name'              => '',
                                                 'mousewheel'        => 'true',
+                                                'zoomlevel'        => '15',
+                                                'satellite'        => 'false',
                                                 'zoompancontrol'    => 'true',
                                                 'typecontrol'       => 'true',
                                                 'directions_to'     => 'true',
@@ -311,11 +313,20 @@
                 </td>
             </tr>
             <tr valign="top">
+                <th scope="row"><label for="wpGoogleMaps_zoomlevel"><?php _e('Zoom Level (0..15..19):')?></label></th>
+                <td>
+                    <input type="text" size="4" name="wpGoogleMaps[zoomlevel]" id="wpGoogleMaps_zoomlevel" />
+                </td>
+            </tr>
+            <tr valign="top">
                 <th scope="row"><label for="wpGoogleMaps_description"><?php _e('Options:')?></label></th>
                 <td>
                     <input type="hidden" name="wpGoogleMaps[mousewheel]" id="wpGoogleMaps_mousewheel_" value="false" />
                     <input type="checkbox" name="wpGoogleMaps[mousewheel]" id="wpGoogleMaps_mousewheel" value="" checked="checked" />
                     <label for="wpGoogleMaps_mousewheel">Enable Mouse Wheel Zoom</label><br />
+                    <input type="hidden" name="wpGoogleMaps[satellite]" id="wpGoogleMaps_satellite_" value="" />
+                    <input type="checkbox" name="wpGoogleMaps[satellite]" id="wpGoogleMaps_satellite" value="true" />
+                    <label for="wpGoogleMaps_satellite">Enable satellite view</label><br />
                     <input type="hidden" name="wpGoogleMaps[zoompancontrol]" id="wpGoogleMaps_zoompancontrol_" value="false" />
                     <input type="checkbox" name="wpGoogleMaps[zoompancontrol]" id="wpGoogleMaps_zoompancontrol" value="" checked="checked" />
                     <label for="wpGoogleMaps_zoompancontrol">Enable Zoom/Pan Controls</label><br />

js file: wp-google-maps.js (changes as diff below)

— bak/wp-google-maps.js    2010-05-15 22:14:14.000000000 +0200
+++ wp-google-maps.js    2010-05-16 21:54:26.000000000 +0200
@@ -61,6 +61,7 @@
     },
     wpNewMap          : function(mapNum, mapInfo)
     {
+    var zoomlevel = 15;
         if (this.geocoder) {
             if (!this.map[mapNum]) {
                 this.map[mapNum] = {};
@@ -83,6 +84,12 @@
             if (this.map[mapNum]['mapInfo'].get('mousewheel')) {
                 this.map[mapNum]['map'].enableScrollWheelZoom();
             }
+            if (this.map[mapNum]['mapInfo'].get('satellite')) {
+                        this.map[mapNum]['map'].setMapType(G_SATELLITE_MAP);
+            }
+            if (this.map[mapNum]['mapInfo'].get('zoomlevel')) {
+            zoomlevel = Number(this.map[mapNum]['mapInfo'].get('zoomlevel'));
+            }
 
             this.map[mapNum]['gdir'] = new GDirections(this.map[mapNum]['map'], $('dir_' + mapNum));
             this.geocoder.getLatLng(
@@ -93,6 +100,7 @@
                     } else {
                         wpGMaps.map[mapNum]['mapInfo'].set('point', point);
                         wpGMaps.map[mapNum]['map'].setCenter(point, 13);
+                        wpGMaps.map[mapNum]['map'].setZoom(zoomlevel);
                         wpGMaps.map[mapNum]['marker'] = new GMarker(point);
                         GEvent.addListener(wpGMaps.map[mapNum]['marker'], "click", function() {
                             if (wpGMaps.map[mapNum]['map'].getInfoWindow().isHidden()) {

————————————————————–


About the Xavisys Forum

Forum Timezone: America/Phoenix

Most Users Ever Online: 50

Currently Online:
1 Guest

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 3
Forums: 26
Topics: 410
Posts: 1034

Membership:

There are 792 Members
There has been 1 Guest

There are 2 Admins
There is 1 Moderator

Top Posters:

lkmweb@me.com – 9
Brayne – 8
Xarzu – 8
Iain – 8
Aaron Fineman – 8
checox7@yahoo.com – 6

Recent New Members: puckles@gmail.com, kwelx@kwelx.com, kaufmanauthor@gmail.com, meesfrenkelfrank@hotmail.com, heather@holmpage.com, mark@avantgarde-group.nl

Administrators: AaronCampbell (242 Posts), Imported Questions (1 Post)

Moderators: nancy@mequoda.com (0 Posts)



 
Stop Censorship