When I select the map type: Hybrid, the auto zoom zooms in too much that the hybrid map shows "we are sorry but we don't have imagery at this zoom..."

Autozoom does not pose a problem when the map type is: Map, but with Hybrid it is zooming beyond what the satellite image max zoom we get that imagery not available error.

How can I restrict how much zooming the auto zoom does?

Thanks!!

Comments

bdragon’s picture

Status: Active » Fixed

Yep, set "Maximum initial zoom" to something that hybrid has data for.

ethanre’s picture

Where do I add this Value? Gmap page or in node.tpl.php ?

1) In the Gmap module page I don't see a "maximum initial zoom" option.

I only see:

Default zoom - I set this to 9 because I like how the default shows the whole metro area... and then the auto zoom zooms in on the spot.

Under Marker manager I see:

Maximum zoom

Under Marker Defaults I see:

Minimum Zoom
Maximum Zoom

Changing any of these 3 options doesn't make any difference.

I do not have any marker manager so I am selecting "No manager (use addOverlay directly)"

2) in node.tpl.php I have this code, does this need modifying?

      if ( ($location['latitude'] != 0) && ($location['longitude'] != 0) && ($teaser != 1) )
      {
        $homes=array('id' => 'outfittermap',
             'zoom' => 8,
             'autozoom' => 9,
             'width' => '350px',
             'height' => '300px',
             'type' => 'Map',
             'latitude' => $location['latitude'],
             'longitude'=> $location['longitude'],
             'markers' =>
               array( array('markername' => 'blue',
                     'latitude' => $location['latitude'],
                     'longitude' => $location['longitude']
               ))
        );

        $outfittermap = theme('gmap', array('#settings' => $homes));
        print ('Location Map:');
        print $outfittermap;
      }

I changed the Zoom and the autozoom numbers, and saw no difference in the hybrid gmap auto zoom, it still zooms a lot (you can see cars) and I want it to not zoom as much (for those areas where high level zoom images are not available from google).

What else could I try? where can i set "Maximum initial zoom" ?

Thanks

bdragon’s picture

Ahh, yeah, you would need to change your code slightly.

$homes['maxzoom'] is the api equivilent.
Also, your 'autozoom' => 9, line doesn't do anything. (to force autozoom on if it's not a default, you want $homes['behavior']['autozoom'] = TRUE)

ethanre’s picture

Thanks. Sorry I am not understanding your instructions well enough.

I changed the code.. Now the only change is the intial view is for a smaller area, then it zooms but it still zooms far too much. I wanna effect not the initial view but how much zoom happens after the intial view is shown. I must have something wrong in the code:

      if ( ($location['latitude'] != 0) && ($location['longitude'] != 0) && ($teaser != 1) )
      {
        $homes=array('id' => 'outfittermap',  
             'zoom' => 14,
             'maxzoom' => 10,
             'width' => '350px',
             'height' => '300px',
             'type' => 'Map',
             'latitude' => $location['latitude'],
             'longitude'=> $location['longitude'],
             'markers' =>
               array( array('markername' => 'blue',
                     'latitude' => $location['latitude'],
                     'longitude' => $location['longitude']
               ))
        );

        $outfittermap = theme('gmap', array('#settings' => $homes));
        print ('Location Map:');
        print $outfittermap;
      }

I removed 'maxzoom' => 12, and changed the number with no difference
Do I need to add the line: 'autozoom' => TRUE, ?

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.