create a layer first (e.g. "company locations") and then add markers (e.g. "headquarters", "store A", "store B") assigned to that layer.','lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_layer'); ?>
|
>
' . __('show API links','lmm') . '';
echo '';
}
?>
KML GeoJSON GeoRSS Maps Marker API
';
}
?>
|
|
|
|
( ) |
' . sprintf(__('%1$s requests/%2$s','lmm'), $mapzen_rate_limit, $mapzen_rate_limit_period) . '' . sprintf(__('%1$s out of %2$s requests/%3$s','lmm'), '', $mapzen_rate_limit, $mapzen_rate_limit_period) . '';
} else if ($lmm_options['geocoding_provider'] == 'algolia-places') {
$geocoding_provider_settings_internal_link = '#lmm-geocoding-algolia';
$geocoding_provider_selected_algolia = 'selected';
if ( ($lmm_options['geocoding_algolia_appId'] != NULL) && ($lmm_options['geocoding_algolia_apiKey'] != NULL) ){
$algolia_rate_limit = '100.000';
$algolia_rate_limit_period = __('month','lmm');
} else {
$algolia_rate_limit = '1.000';
$algolia_rate_limit_period = __('day','lmm');
}
$geocoding_provider_rate_limit_details = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/domain/%2$s','lmm'), $algolia_rate_limit, $algolia_rate_limit_period);
} else if ($lmm_options['geocoding_provider'] == 'photon') {
$geocoding_provider_settings_internal_link = '#lmm-geocoding-photon';
$geocoding_provider_selected_photon = 'selected';
$geocoding_provider_rate_limit_details = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/domain/%2$s','lmm'), '1.000', __('day','lmm')) . '' . sprintf(__('%1$s out of %2$s requests/%3$s','lmm'), '', '', __('day','lmm')) . '';
} else if ($lmm_options['geocoding_provider'] == 'mapquest-geocoding') {
$geocoding_provider_settings_internal_link = '#lmm-geocoding-mapquest';
$geocoding_provider_selected_mapquest = 'selected';
$geocoding_provider_rate_limit_details = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), '15.000', __('month','lmm'));
} else if ($lmm_options['geocoding_provider'] == 'google-geocoding') {
$geocoding_provider_settings_internal_link = '#lmm-geocoding-google';
$geocoding_provider_selected_google = 'selected';
$geocoding_provider_rate_limit_details = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), '1.000', __('day','lmm'));
}
//info: Get all the limits for each provider
$geocoding_limits = array();
$mapzen_rate_limit = '30.000';
$mapzen_rate_limit_period = __('day','lmm');
$geocoding_limits['mapzen'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), $mapzen_rate_limit, $mapzen_rate_limit_period) . '' . sprintf(__('%1$s out of %2$s requests/%3$s','lmm'), '', $mapzen_rate_limit, __('day','lmm')) . '';
if ( ($lmm_options['geocoding_algolia_appId'] != NULL) && ($lmm_options['geocoding_algolia_apiKey'] != NULL) ){
$algolia_rate_limit = '100.000';
$algolia_rate_limit_period = __('month','lmm');
$geocoding_limits['algolia'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), $algolia_rate_limit, $algolia_rate_limit_period);
} else {
$algolia_rate_limit = '1.000';
$algolia_rate_limit_period = __('day','lmm');
$geocoding_limits['algolia'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/domain/%2$s','lmm'), $algolia_rate_limit, $algolia_rate_limit_period);
}
$geocoding_limits['photon'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s out of %2$s requests/domain/%3$s','lmm'), '?', '1.000', __('day','lmm'));
$geocoding_limits['mapquest'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), '15.000', __('month','lmm'));
$geocoding_limits['google'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), '1.000', __('day','lmm'));
//info: check if Mapzen Search API key is set
$geocoding_provider_mapzen_disabled = '';
if ($lmm_options['geocoding_mapzen_search_api_key'] == NULL) {
$option_mapzen_inactive = '';
$option_mapzen_active = '';
} else {
$option_mapzen_active = '';
$option_mapzen_inactive = '';
}
//info: check if MapQuest API key is set
$geocoding_provider_mapquest_disabled = '';
if ($lmm_options['geocoding_mapquest_geocoding_api_key'] == NULL) {
$option_mapquest_inactive = '';
$option_mapquest_active = '';
} else {
$option_mapquest_active = '';
$option_mapquest_inactive = '';
}
//info: check if Google Geocoding API key is set
$geocoding_provider_google_disabled = '';
if
(
( ($lmm_options['geocoding_google_geocoding_auth_method'] == 'api-key') && ($lmm_options['geocoding_google_geocoding_api_key'] == NULL) )
||
( ($lmm_options['geocoding_google_geocoding_auth_method'] == 'clientid-signature') && (($lmm_options['geocoding_google_geocoding_premium_client'] == NULL) || ($lmm_options['geocoding_google_geocoding_premium_signature'] == NULL)) )
) {
$option_google_inactive = '';
$option_google_active = '';
} else {
$option_google_active = '';
$option_google_inactive = '';
}
echo '' . __('Geocoding provided by','lmm') . ':';
if (current_user_can('activate_plugins')) {
echo '';
}
echo '
';
echo '';
echo '' . $geocoding_provider_rate_limit_details . '';
?>
|
enter your %2$s-API key or select an alternative geocoding provider!','lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding-google', 'Google Geocoding', LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding');
$location_input_css = 'background:#ff9999;';
} else if (($lmm_options['geocoding_mapquest_geocoding_api_key'] == NULL) && ($lmm_options['geocoding_provider'] == 'mapquest-geocoding')) {
$geocoding_provider_status_text = sprintf(__('Error: please enter your %2$s-API key or select an alternative geocoding provider!','lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding-mapquest', 'MapQuest Geocoding', LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding');
$location_input_css = 'background:#ff9999;';
} else if (($lmm_options['geocoding_mapquest_geocoding_api_key'] != NULL) && ($lmm_options['geocoding_provider'] == 'mapquest-geocoding')) {
$geocoding_provider_status_text = ' ';
$location_input_css = '';
} else if (($lmm_options['geocoding_mapzen_search_api_key'] == NULL) && ($lmm_options['geocoding_provider'] == 'mapzen-search')) {
$geocoding_provider_status_text = sprintf(__('Error: please enter your %2$s-API key or select an alternative geocoding provider!','lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding-mapzen', 'Mapzen Search', LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding');
$location_input_css = 'background:#ff9999;';
} else if ($lmm_options['geocoding_provider'] == $lmm_options['geocoding_provider_fallback']) {
$geocoding_provider_status_text = sprintf(__('Warning: you did not configure an alternative geocoding provider - no fallback will be available if main geocoding provider is unavailable!','lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding');
$location_input_css = 'background:yellow;';
} else {
$geocoding_provider_status_text = ' ';
$location_input_css = '';
}
echo ' ' . $geocoding_provider_status_text . ' ';
$placeholder_text = ( (intval($lmm_options['geocoding_min_chars_search_autostart']) == 0) || (intval($lmm_options['geocoding_min_chars_search_autostart']) == 1) ) ? esc_attr__('Please enter a location','lmm') : sprintf(esc_attr__('Please enter a location (%1$s characters minimum to start typeahead suggestions)','lmm'), intval($lmm_options['geocoding_min_chars_search_autostart']));
echo '';
//info: needed in free version only for geocoding.js
if ($address == NULL) {
echo '';
} else {
echo '';
}
?>
( )
:
:
|
>
>
px
' . __('Global maximum zoom level','lmm') . ': ' . __('pro version only','lmm') . '';
?>
' . __('Upgrade to pro for assigning markers to multiple layers','lmm') . ' ' ?>
" . __('edit layer','lmm') . " (ID ".$layer.") " . __('or','lmm') . "" : "" ?>
' . __('add','lmm') . ' | ' . __('convert','lmm') . ' | ' . __('merge','lmm') . ' | ' . __('settings','lmm') . ' | ' . __('fit bounds','lmm') . ''; ?>
|
'.PHP_EOL;
//info: panel for marker name and API URLs
$panel_state = ($panel == 1) ? 'block' : 'none';
echo ''.PHP_EOL;
echo ' ';
if ( (isset($lmm_options[ 'defaults_marker_panel_directions' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_directions' ] == 1 ) ) {
//info: Google language localization (directions)
if ($lmm_options['google_maps_language_localization'] == 'browser_setting') {
$google_language = '';
} else if ($lmm_options['google_maps_language_localization'] == 'wordpress_setting') {
if ($locale != NULL ) { $google_language = '&hl=' . substr($locale, 0, 2); } else { $google_language = '&hl=en'; }
} else {
$google_language = '&hl=' . $lmm_options['google_maps_language_localization'];
}
//info: build directions provider links
if ($lmm_options['directions_provider'] == 'googlemaps') {
if ( isset($lmm_options['google_maps_base_domain_custom']) && ($lmm_options['google_maps_base_domain_custom'] == NULL) ) { $gmaps_base_domain_directions = $lmm_options['google_maps_base_domain']; } else { $gmaps_base_domain_directions = htmlspecialchars($lmm_options['google_maps_base_domain_custom']); }
if ((isset($lmm_options[ 'directions_googlemaps_route_type_walking' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_walking' ] == 1 )) { $directions_transport_type_icon = 'icon-walk.png'; } else { $directions_transport_type_icon = 'icon-car.png'; }
if ( $address != NULL ) { $google_from = urlencode($address); } else { $google_from = $lat . ',' . $lon; }
$avoidhighways = (isset($lmm_options[ 'directions_googlemaps_route_type_highways' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_highways' ] == 1 ) ? '&dirflg=h' : '';
$avoidtolls = (isset($lmm_options[ 'directions_googlemaps_route_type_tolls' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_tolls' ] == 1 ) ? '&dirflg=t' : '';
$publictransport = (isset($lmm_options[ 'directions_googlemaps_route_type_public_transport' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_public_transport' ] == 1 ) ? '&dirflg=r' : '';
$walking = (isset($lmm_options[ 'directions_googlemaps_route_type_walking' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_walking' ] == 1 ) ? '&dirflg=w' : '';
echo '  ';
} else if ($lmm_options['directions_provider'] == 'yours') {
if ($lmm_options[ 'directions_yours_type_of_transport' ] == 'motorcar') { $directions_transport_type_icon = 'icon-car.png'; } else if ($lmm_options[ 'directions_yours_type_of_transport' ] == 'bicycle') { $directions_transport_type_icon = 'icon-bicycle.png'; } else if ($lmm_options[ 'directions_yours_type_of_transport' ] == 'foot') { $directions_transport_type_icon = 'icon-walk.png'; }
echo '  ';
} else if ($lmm_options['directions_provider'] == 'ors') {
if ($lmm_options[ 'directions_ors_routeOpt' ] == 'Pedestrian') { $directions_transport_type_icon = 'icon-walk.png'; } else if ($lmm_options[ 'directions_ors_routeOpt' ] == 'Bicycle') { $directions_transport_type_icon = 'icon-bicycle.png'; } else { $directions_transport_type_icon = 'icon-car.png'; }
echo '  ';
} else if ($lmm_options['directions_provider'] == 'bingmaps') {
if ( $address != NULL ) { $bing_to = '_' . urlencode($address); } else { $bing_to = ''; }
echo '  ';
}
}
if ( (isset($lmm_options[ 'defaults_marker_panel_kml' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_kml' ] == 1 ) ) {
echo '  ';
}
if ( (isset($lmm_options[ 'defaults_marker_panel_fullscreen' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_fullscreen' ] == 1 ) ) {
echo '  ';
}
if ( (isset($lmm_options[ 'defaults_marker_panel_qr_code' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_qr_code' ] == 1 ) ) {
echo '  ';
}
if ( (isset($lmm_options[ 'defaults_marker_panel_geojson' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_geojson' ] == 1 ) ) {
echo '  ';
}
if ( (isset($lmm_options[ 'defaults_marker_panel_georss' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_georss' ] == 1 ) ) {
echo '  ';
}
echo ' '.PHP_EOL;
echo ' ' . (($markername == NULL) ? __('if set, markername will be displayed here','lmm') : stripslashes($markername)) . ' '.PHP_EOL;
?>
" . __("Settings","lmm") . ")" : "";
} else {
//info: outside next condition to prevent PHP warnings if disabled
$directionslink = '';
$directions_settings_link = '';
//info: needed for geocoding.js, line 426
if ($address == NULL) {
echo '';
} else {
echo '';
}
} ?>
|
';
} ?>
Map Icons Collection', LEAFLET_PLUGIN_ICONS_URL);
$mapicons_user = sprintf( __('If you want to use different icons, please visit the %1$s (offering more than 700 compatible icons) and ask your WordPress admin to upload the new icons to the directory %2$s/','lmm'), 'Map Icons Collection', LEAFLET_PLUGIN_ICONS_URL);
$upload_icons_button_text = '
' . __('You can also upload the icons by clicking the button "upload new icon"','lmm') . ' (' . __('pro version only','lmm') . ')';
if (current_user_can('activate_plugins')) { echo $mapicons_admin . $upload_icons_button_text; } else { echo $mapicons_user . $upload_icons_button_text; }
if (is_multisite()) {
$mapicons_directory = sprintf( __('As you are running your blog within a WordPress Multisite installation, please use this icon directory on your server: %2$s/','lmm'), 'Map Icons Collection', LEAFLET_PLUGIN_ICONS_DIR);
echo ' ' . $mapicons_directory;
}
?>
';
} ?>
|
';
if ($icon != NULL) {
$filename_without_dots = str_replace('.','_',$icon); //info: dots in not allowed in selectors
echo '';
echo '';
echo '';
foreach ($iconlist as $row) {
$filename_without_dots = str_replace('.','_',$row); //info: dots in not allowed in selectors
if ($row == $icon) { $opacity = '1'; $background = '#5e5d5d'; } else { $opacity = '0.4'; $background = 'none'; }
$icon_data = $wp_filesystem->get_contents(LEAFLET_PLUGIN_ICONS_DIR . DIRECTORY_SEPARATOR . $row);
if ($icon_data == NULL) { //info: workaround #1 due to support request
$icon_data = file_get_contents(LEAFLET_PLUGIN_ICONS_DIR . DIRECTORY_SEPARATOR . $row);
}
if ($icon_data == NULL) { //info: workaround #2 due to support request
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, LEAFLET_PLUGIN_ICONS_URL . '/' . $row);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$icon_data = curl_exec($ch);
curl_close($ch);
}
$icon_base64 = 'data:image/png;base64,' . base64_encode($icon_data);
echo ' ';
}
} else {
echo ' ';
echo ' ';
foreach ($iconlist as $row) {
$filename_without_dots = str_replace('.','_',$row); //info: dots in not allowed in selectors
if ($row == $icon) { $opacity = '1'; $background = '#5e5d5d'; } else { $opacity = '0.4'; $background = 'none'; }
$icon_data = $wp_filesystem->get_contents(LEAFLET_PLUGIN_ICONS_DIR . DIRECTORY_SEPARATOR . $row);
if ($icon_data == NULL) { //info: workaround #1 due to support request
$icon_data = file_get_contents(LEAFLET_PLUGIN_ICONS_DIR . DIRECTORY_SEPARATOR . $row);
}
if ($icon_data == NULL) { //info: workaround #2 due to support request
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, LEAFLET_PLUGIN_ICONS_URL . '/' . $row);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$icon_data = curl_exec($ch);
curl_close($ch);
}
$icon_base64 = 'data:image/png;base64,' . base64_encode($icon_data);
echo ' ';
}
}
echo ' ';
echo '  ';
echo '  ';
echo ' ';
} else if ($current_editor == 'advanced') {
if ($icon == NULL) { $opacity = '1'; $background = '#5e5d5d'; } else { $opacity = '0.4'; $background = 'none'; }
echo ' ';
foreach ($iconlist as $row) {
$filename_without_dots = str_replace('.','_',$row); //info: dots in not allowed in selectors
if ($row == $icon) { $opacity = '1'; $background = '#5e5d5d'; } else { $opacity = '0.4'; $background = 'none'; }
$icon_data = $wp_filesystem->get_contents(LEAFLET_PLUGIN_ICONS_DIR . DIRECTORY_SEPARATOR . $row);
if ($icon_data == NULL) { //info: workaround #1 due to support request
$icon_data = file_get_contents(LEAFLET_PLUGIN_ICONS_DIR . DIRECTORY_SEPARATOR . $row);
}
if ($icon_data == NULL) { //info: workaround #2 due to support request
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, LEAFLET_PLUGIN_ICONS_URL . '/' . $row);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$icon_data = curl_exec($ch);
curl_close($ch);
}
$icon_base64 = 'data:image/png;base64,' . base64_encode($icon_data);
echo ' ';
}
echo '  ';
echo '  ';
}
?>
|
>
'; } else { echo ''; } ?>
|
=' ) ) {
$settings = array(
'wpautop' => true,
'tinymce' => array(
'height' => '250',
'content_style' => 'img {' . htmlspecialchars($lmm_options['defaults_marker_popups_image_css']) . '} a {text-decoration:none;} a:hover {text-decoration:underline;}',
'setup' => 'function(ed) {
ed.on("keyup", function(ed,e) {
var popup_panel = "";
marker._popup.setContent(tinymce.activeEditor.getContent()' . $popup_panel . ');
unsaved = true;
});
//info: remove disabled attribute for HTML editor mode only - text mode see line 2600
ed.on("LoadContent", function(ed, e){
jQuery("#submit_top").removeAttr("disabled");
jQuery("#submit_bottom").removeAttr("disabled");
jQuery("#delete").removeAttr("disabled");
});
}'
),
'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,code,close'));
} else {
$settings = array(
'wpautop' => true,
'tinymce' => array(
'theme_advanced_buttons1' => 'bold,italic,underline,strikethrough,|,fontselect,fontsizeselect,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,outdent,indent,blockquote,|,link,unlink,|,ltr,rtl',
'theme' => 'advanced',
'height' => '250',
'content_style' => 'html .mcecontentbody {font:12px/1.4 "Helvetica Neue",Arial,Helvetica,sans-serif; max-width:' . intval($lmm_options['defaults_marker_popups_maxwidth']) + 1 . 'px; /* Default + 1 fix */ word-wrap:break-word;} .mcecontentbody a {text-decoration:none;} .mcecontentbody a:hover {text-decoration:underline;} .mcecontentbody img {' . htmlspecialchars($lmm_options['defaults_marker_popups_image_css']) . '}',
'theme_advanced_statusbar_location' => 'bottom',
'setup' => 'function(ed) {
ed.onKeyUp.add(function(ed, e) {
var popup_panel = "";
marker._popup.setContent(ed.getContent()' . $popup_panel . ');
unsaved = true;
});
ed.onInit.add(function(ed) {
jQuery("#submit_top").removeAttr("disabled");
jQuery("#submit_bottom").removeAttr("disabled");
jQuery("#delete").removeAttr("disabled");
});
}'
),
'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,code,close'));
}
$sanitize_popuptext_from = array(
'#(\s)*( )*(\s)*- #si',
'#
(\s)*( )*(\s)*- #si',
'#
(\s)*( )*(\s)* #si',
'#(\s)*( )*(\s)*- #si',
'#
(\s)*( )*(\s)* #si',
'#( ){1}\s*\s*( ){1}#si',
'#\s*( ){1}#si',
);
$sanitize_popuptext_to = array(
'',
'- ',
'
',
'',
''
);
$popuptext_sanitized = preg_replace($sanitize_popuptext_from, $sanitize_popuptext_to, stripslashes(preg_replace( '/(\015\012)|(\015)|(\012)/',' ', $popuptext)));
//info: strip evil scripts
if ($lmm_options['wp_kses_status'] == 'enabled') {
$popuptext_sanitized = wp_kses($popuptext_sanitized, array_merge($allowedposttags, $additionaltags));
}
wp_editor( $popuptext_sanitized, 'popuptext', $settings);
?>
( )
' . sprintf( esc_attr__('Note: if you add an image, the following CSS definition will be applied: %1$s','lmm'), '' . htmlspecialchars($lmm_options['defaults_marker_popups_image_css']) . '');
if (current_user_can('activate_plugins')) { echo ' (' . __('Settings','lmm') . ')'; }
?>
|
|
|
|
|