Download & Extend

Custom Zoom Level for Single Map Point not set

Project:Mapstraction
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:active

Issue Summary

I have traced this problem to the following code in mapstraction.module (lines 226-233):

<?php
 
// Center and zoom properly for a single point.
 
if (count($rows) == 1 && !empty($rows[0]['markers']) && count($rows[0]['markers']) == 1) {
   
// note we're reusing the initial point zoom value if set
   
$settings['initial_point']['zoom'] = ($settings['initial_point']['zoom_single']) ? $settings['initial_point']['zoom'] : 5;
   
$settings['initial_point']['auto'] = 0;
   
$settings['initial_point']['latitude'] = $rows[0]['markers'][0]['latitude'];
   
$settings['initial_point']['longitude'] = $rows[0]['markers'][0]['longitude'];
  }
?>

Basically, if I go into my view settings and change the zoom level for an auto-detected single point map, the zoom level is not respected. It always remains at the default of 5.

If I change the 'zoom' line to the following, it works, changing the zoom level to 15:

<?php
    $settings
['initial_point']['zoom'] = 15;
?>

It seems the mapstraction_style_map class in mapstraction_map_style.inc is not setting the variable in the array properly, so the zoom level settings aren't being picked up.

Both -alpha and -dev are broken (and have other issues preventing my full adoption of the new version yet).

nobody click here