Beispiel #1
0
                        }
                    }
                }
            } else {
                $minimap_basemap = $lmm_options['minimap_basemap'];
                if ($lmm_options['google_maps_api_status'] == 'disabled' && ($minimap_basemap == 'googleLayer_roadmap' || $minimap_basemap == 'googleLayer_satellite' || $minimap_basemap == 'googleLayer_hybrid' || $minimap_basemap == 'googleLayer_terrain')) {
                    $minimap_basemap = 'osm_mapnik_minimap';
                }
            }
            echo "var miniMap = new L.Control.MiniMap(" . $minimap_basemap . ", {position: '" . $lmm_options['minimap_position'] . "', width: " . intval($lmm_options['minimap_width']) . ", height: " . intval($lmm_options['minimap_height']) . ", zoomLevelOffset: " . intval($lmm_options['minimap_zoomLevelOffset']) . ", " . $zoomlevelfixed . " zoomAnimation: " . $lmm_options['minimap_zoomAnimation'] . ", toggleDisplay: " . $lmm_options['minimap_toggleDisplay'] . ", autoToggleDisplay: " . $lmm_options['minimap_autoToggleDisplay'] . "}).addTo(selectlayer);" . PHP_EOL;
        }
        ?>

		//info: gpx tracks
		<?php 
        if ($gpx_url != NULL && lmm_isValidURL($gpx_url)) {
            $gpx_track_color = '#' . str_replace('#', '', htmlspecialchars($lmm_options['gpx_track_color']));
            $gpx_startIconUrl = $lmm_options['gpx_startIconUrl'] == NULL ? LEAFLET_PLUGIN_URL . 'leaflet-dist/images/gpx-icon-start.png' : trim(htmlspecialchars($lmm_options['gpx_startIconUrl']));
            $gpx_endIconUrl = $lmm_options['gpx_endIconUrl'] == NULL ? LEAFLET_PLUGIN_URL . 'leaflet-dist/images/gpx-icon-end.png' : trim(htmlspecialchars($lmm_options['gpx_endIconUrl']));
            $gpx_shadowUrl = $lmm_options['gpx_shadowUrl'] == NULL ? LEAFLET_PLUGIN_URL . 'leaflet-dist/images/gpx-icon-shadow.png' : trim(htmlspecialchars($lmm_options['gpx_shadowUrl']));
            if (isset($lmm_options['gpx_metadata_name']) == TRUE && $lmm_options['gpx_metadata_name'] == 1) {
                $gpx_metadata_name_js = 'if (gpx.get_name() != undefined) { _c("gpx-name").innerHTML = gpx.get_name(); } else { _c("gpx-name").innerHTML = "n/a"; }';
            } else {
                $gpx_metadata_name_js = '';
            }
            if (isset($lmm_options['gpx_metadata_start']) == TRUE && $lmm_options['gpx_metadata_start'] == 1) {
                $gpx_metadata_start_js = 'if (gpx.get_start_time() != undefined) { _c("gpx-start").innerHTML = gpx.get_start_time().toDateString() + ", " + gpx.get_start_time().toLocaleTimeString(); } else { _c("gpx-start").innerHTML = "n/a"; }';
            } else {
                $gpx_metadata_start_js = '';
            }
            if (isset($lmm_options['gpx_metadata_end']) == TRUE && $lmm_options['gpx_metadata_end'] == 1) {
     $result = $wpdb->prepare("UPDATE `{$table_name_layers}` SET `panel` = %d", $_POST['panel-layer']);
     $wpdb->query($result);
     $wpdb->query("OPTIMIZE TABLE `{$table_name_layers}`");
     echo '<p><div class="updated" style="padding:10px;">' . __('Panel status for all layers has been successfully updated', 'lmm') . '</div><br/><a class="button-secondary" href="' . LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_tools">' . __('Back to Tools', 'lmm') . '</a></p>';
 } elseif ($action == 'listmarkers-layer') {
     $result = $wpdb->prepare("UPDATE `{$table_name_layers}` SET `listmarkers` = %d", $_POST['listmarkers-layer']);
     $wpdb->query($result);
     $wpdb->query("OPTIMIZE TABLE `{$table_name_layers}`");
     echo '<p><div class="updated" style="padding:10px;">' . __('The list marker-status for all layers has been successfully updated', 'lmm') . '</div><br/><a class="button-secondary" href="' . LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_tools">' . __('Back to Tools', 'lmm') . '</a></p>';
 } elseif ($action == 'listmarkers-clustering') {
     $result = $wpdb->prepare("UPDATE `{$table_name_layers}` SET `clustering` = %d", $_POST['listmarkers-clustering']);
     $wpdb->query($result);
     $wpdb->query("OPTIMIZE TABLE `{$table_name_layers}`");
     echo '<p><div class="updated" style="padding:10px;">' . __('The clustering status for all layers has been successfully updated', 'lmm') . '</div><br/><a class="button-secondary" href="' . LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_tools">' . __('Back to Tools', 'lmm') . '</a></p>';
 } elseif ($action == 'gpx-url-layer') {
     if (lmm_isValidURL($_POST['gpx-url-layer']) || $_POST['gpx-url-layer'] == NULL) {
         $result = $wpdb->prepare("UPDATE `{$table_name_layers}` SET `gpx_url` = %s", trim($_POST['gpx-url-layer']));
         $wpdb->query($result);
         $wpdb->query("OPTIMIZE TABLE `{$table_name_layers}`");
         echo '<p><div class="updated" style="padding:10px;">' . __('The URL to GPX track for all layers has been successfully updated', 'lmm') . '</div><br/><a class="button-secondary" href="' . LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_tools">' . __('Back to Tools', 'lmm') . '</a></p>';
     } else {
         echo '<p><div class="error" style="padding:10px;">' . __('The URL to GPX has not been updated - URL to GPX track does not seem to be a valid url!', 'lmm') . '</div><br/><a class="button-secondary" href="' . LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_tools">' . __('Back to Tools', 'lmm') . '</a></p>';
     }
 } elseif ($action == 'gpx-panel-layer') {
     $result = $wpdb->prepare("UPDATE `{$table_name_layers}` SET `gpx_panel` = %d WHERE `gpx_url` != ''", $_POST['gpx-panel-layer']);
     $wpdb->query($result);
     $wpdb->query("OPTIMIZE TABLE `{$table_name_layers}`");
     echo '<p><div class="updated" style="padding:10px;">' . __('The GPX panel status for the selected markers has been successfully updated', 'lmm') . '</div><br/><a class="button-secondary" href="' . LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_tools">' . __('Back to Tools', 'lmm') . '</a></p>';
 } elseif ($action == 'change_marker_id') {
     $old_marker_id_exists = $wpdb->get_var($wpdb->prepare("SELECT `id` from `{$table_name_markers}` WHERE `id` = %d", intval($_POST['marker_id_old'])));
     if ($old_marker_id_exists == NULL) {