|
63 | 63 | $result = osm_parse_map_data_url($tokens, $next_token); |
64 | 64 | $page = array_merge( $page, $result ); |
65 | 65 |
|
66 | | - |
67 | 66 | if (isset($page['category'])) |
68 | 67 | check_restrictions($page['category']['id']); |
69 | 68 |
|
| 69 | +/* If the config include parameters get them */ |
| 70 | +$zoom = isset($conf['osm_conf']['left_menu']['zoom']) ? $conf['osm_conf']['left_menu']['zoom'] : 2; |
| 71 | +$center = isset($conf['osm_conf']['left_menu']['center']) ? $conf['osm_conf']['left_menu']['center'] : '0,0'; |
| 72 | +$center_arr = preg_split('/,/', $center); |
| 73 | +$center_lat = isset($center_arr) ? $center_arr[0] : 0; |
| 74 | +$center_lng = isset($center_arr) ? $center_arr[1] : 0; |
| 75 | + |
| 76 | +/* If we have zoom and center coordonate, set it otherwise fallback default */ |
| 77 | +$zoom = isset($_GET['zoom']) ? $_GET['zoom'] : $zoom; |
| 78 | +$center_lat = isset($_GET['center_lat']) ? $_GET['center_lat'] : $center_lat; |
| 79 | +$center_lng = isset($_GET['center_lng']) ? $_GET['center_lng'] : $center_lng; |
| 80 | + |
70 | 81 | $local_conf = array(); |
71 | | -$local_conf['zoom'] = '2'; |
72 | | -$local_conf['center_lat'] = '0'; |
73 | | -$local_conf['center_lng'] = '0'; |
74 | | -$local_conf['pinid'] = 1; |
| 82 | +$local_conf['zoom'] = $zoom; |
| 83 | +$local_conf['center_lat'] = $center_lat; |
| 84 | +$local_conf['center_lng'] = $center_lng; |
75 | 85 | $local_conf['contextmenu'] = 'false'; |
76 | | -$local_conf['available_pin'] = ''; |
77 | | -$local_conf['control'] = false; |
| 86 | +$local_conf['control'] = true; |
78 | 87 | $local_conf['img_popup'] = false; |
79 | 88 | $local_conf['paths'] = osm_get_gps($page); |
| 89 | +$local_conf = $local_conf + $conf['osm_conf']['map'] + $conf['osm_conf']['left_menu']; |
80 | 90 |
|
81 | 91 | $js_data = osm_get_items($page); |
82 | 92 | $js = osm_get_js($conf, $local_conf, $js_data); |
83 | | -osm_gen_template($conf, $js, $js_data, 'osm-map.tpl', $template) |
| 93 | +osm_gen_template($conf, $js, $js_data, 'osm-map.tpl', $template); |
84 | 94 | ?> |
0 commit comments