WP Google Maps – Pro Add-on
-
Witam!
ta wtyczkagoogle maps pozwala na wyznaczanie trasy między dwoma punktami lecz okienko z komendami do wyznaczania jest po angielsku a ja bym chciał na polski zmienić- zastępowałem słowa „FROM” oraz TO” polskimi ale wtedy wtyczka przestaje działać, chociaż w okienku pojawiają się właściwe polskie słowa.OTO Cały kod tej wtyczki:
<?php
/*
Plugin Name: WP Google Maps – Pro Add-on
Plugin URI: http://www.wpgmaps.com
Description: This is the Pro add-on for WP Google Maps. The Pro add-on enables you to add descriptions, pictures, links and custom icons to your markers as well as allows you to download your markers to a CSV file for quick editing and re-upload them when complete.
Version: 4.03
Author: WP Google Maps
Author URI: http://www.wpgmaps.com
*
* 4.03
* Fixed a firefox styling bug that caused the Directions box to load on the right of the map instead of below.
* Added support code for the new WP Google Maps Visitor Generated Markers plugin
* Added the option for a more advanced way to list your markers below your maps
* Added responsive size functionality
* Added support for Fusion Tables
*
* 4.02
* Fixed the bug that caused the directions box to show above the map by default
* Fixed the bug whereby an address was already hard-coded into the „To” field of the directions box
* Fixed the bug that caused the traffic layer to show by default
*
* 4.01
* Added the functionality to list your markers below the map
* Added more advanced directions functionality
* Fixed small bugs
* Fixed a bug that caused a fatal error when trying to activate the plugin on some hosts.
*
* 4.0
* Plugin now supports multiple maps on one page
* Bicycle directions now added
* Walking directions now added
* „Avoid tolls” now added to the directions functionality
* „Avoid highways” now added to directions functionality
* New setting: open links in a new window
* Added functionality to reset the default marker image if required.
*
* 3.12
* Fixed the bug that told users they had an outdated plugin when in fact they never
*
* 3.11
* Fixed the bug that was causing both the bicycle layer and traffic layer to show all the time
*
* 3.10
* Added the bicycle layer
* Added the traffic layer
* Fixed the bug that was not allowing users to overwrite existing data when uploading a CSV file
*
* 3.9
* Added support for KML/GeoRSS layers.
* Fixed the directions box styling error in Firefox.
* Fixed the bug whereby users couldnt change the default location without adding a marker first.
* When the „Directions” link is clicked on, the „From” field is automatically highlighted for the user.
* Added additional settings
*
* 3.8
* Markers now automatically close when you click on another marker.
* Russian localization added
* The „To” field in the directions box now shows the address and not the GPS co-ords.
*
* 3.7
* Added support for localization
*
* 3.6
* Fixed the bug that caused slow loading times with sites that contain a high number of maps and markers
*
* 3.5
* Fixed the bug where sometimes the short code wasnt working for home pages
*
* 3.4
* Added functionality for 'Titles’ for each marker
*
* 3.3
* Added functionality for WordPress MU
*
* 3.2
* Fixed a bug where in IE the zoom checkbox was showing
* Fixed the bug where the map wasnt saving correctly in some instances* 3.1
* Fixed redirect problem
* Fixed bug that never created the default map on some systems* 3.0
* Added Map Alignment functionality
* Added Map Type functionality
* Started using the Geocoding API Version 3 instead of Version 2 – quicker results!
* Fixed bug that didnt import animation data for CSV files
* Fixed zoom bug* 2.1
* Fixed a few bugs with the jQuery script
* Fixed the shortcode bug where the map wasnt displaying when two or more short codes were one the post/page
* Fixed a bug that wouldnt save the icon on editing a marker in some instances
*
*
*
*/global $wpgmza_pro_version;
global $wpgmza_pro_string;
$wpgmza_pro_version = „4.03”;
$wpgmza_pro_string = „pro”;global $wpgmza_p;
global $wpgmza_t;
$wpgmza_p = true;
$wpgmza_t = „pro”;global $wpgmza_post_nonce;
$wpgmza_post_nonce = md5(time());add_action(’admin_head’, 'wpgmaps_upload_csv’);
add_action(’init’, 'wpgmza_register_pro_version’);function wpgmaps_pro_activate() { wpgmza_cURL_response_pro(„activate”); }
function wpgmaps_pro_deactivate() { wpgmza_cURL_response_pro(„activate”); }function wpgmza_register_pro_version() {
global $wpgmza_pro_version;
global $wpgmza_pro_string;
if (!get_option(’WPGMZA_PRO’)) {
add_option(’WPGMZA_PRO’,array(„version” => $wpgmza_pro_version, „version_string” => $wpgmza_t));
} else {
update_option(’WPGMZA_PRO’,array(„version” => $wpgmza_pro_version, „version_string” => $wpgmza_t));
}
}function wpgmza_pro_menu() {
global $wpgmza_pro_version;
global $wpgmza_p_version;
global $wpgmza_post_nonce;
global $wpgmza_tblname_maps;
global $wpdb;if (!wpgmaps_check_permissions()) { wpgmaps_permission_warning(); }
if ($_GET[’action’] == „edit”) {
}
else if ($_GET[’action’] == „new”) {$def_data = get_option(„WPGMZA_SETTINGS”);
$data[’map_default_starting_lat’] = $map_start_lat;
$data[’map_default_starting_lng’] = $map_start_lng;
$data[’map_default_height’] = $map_height;
$data[’map_default_width’] = $map_width;
$data[’map_default_zoom’] = $map_start_zoom;
$data[’map_default_type’] = $type;
$data[’map_default_alignment’] = $alignment;
$data[’map_default_directions’] = $directions_enabled;
$data[’map_default_bicycle’] = $bicycle_enabled;
$data[’map_default_traffic’] = $traffic_enabled;
$data[’map_default_dbox’] = $dbox;
$data[’map_default_dbox_width’] = $dbox_width;
$data[’map_default_marker’] = $map_default_marker;if (isset($def_data[’map_default_height’])) {
$wpgmza_height = $def_data[’map_default_height’];
} else {
$wpgmza_height = „400”;
}
if (isset($def_data[’map_default_width’])) {
$wpgmza_width = $def_data[’map_default_width’];
} else {
$wpgmza_width = „600”;
}
if (isset($def_data[’map_default_marker’])) {
$wpgmza_def_marker = $def_data[’map_default_marker’];
} else {
$wpgmza_def_marker = „0”;
}
if (isset($def_data[’map_default_alignment’])) {
$wpgmza_def_alignment = $def_data[’map_default_alignment’];
} else {
$wpgmza_def_alignment = „0”;
}
if (isset($def_data[’map_default_directions’])) {
$wpgmza_def_directions = $def_data[’map_default_directions’];
} else {
$wpgmza_def_directions = „0”;
}
if (isset($def_data[’map_default_bicycle’])) {
$wpgmza_def_bicycle = $def_data[’map_default_bicycle’];
} else {
$wpgmza_def_bicycle = „0”;
}
if (isset($def_data[’map_default_traffic’])) {
$wpgmza_def_traffic = $def_data[’map_default_traffic’];
} else {
$wpgmza_def_traffic = „0”;
}
if (isset($def_data[’map_default_dbox’])) {
$wpgmza_def_dbox = $def_data[’map_default_dbox’];
} else {
$wpgmza_def_dbox = „0”;
}
if (isset($def_data[’map_default_dbox_wdith’])) {
$wpgmza_def_dbox_width = $def_data[’map_default_dbox_width’];
} else {
$wpgmza_def_dbox_width = „500”;
}
if (isset($def_data[’map_default_listmarkers’])) {
$wpgmza_def_listmarkers = $def_data[’map_default_listmarkers’];
} else {
$wpgmza_def_listmarkers = „0”;
}
if (isset($def_data[’map_default_listmarkers_advanced’])) {
$wpgmza_def_listmarkers_advanced = $def_data[’map_default_listmarkers_advanced’];
} else {
$wpgmza_def_listmarkers_advanced = „0”;
}
if (isset($def_data[’map_default_type’])) {
$wpgmza_def_type = $def_data[’map_default_type’];
} else {
$wpgmza_def_type = „1”;
}if (isset($def_data[’map_default_zoom’])) {
$start_zoom = $def_data[’map_default_zoom’];
} else {
$start_zoom = 5;
}
if (isset($def_data[’map_default_starting_lat’]) && isset($def_data[’map_default_starting_lng’])) {
$wpgmza_lat = $def_data[’map_default_starting_lat’];
$wpgmza_lng = $def_data[’map_default_starting_lng’];
} else {
$wpgmza_lat = „51.5081290”;
$wpgmza_lng = „-0.1280050”;
}$wpdb->insert( $wpgmza_tblname_maps, array(
„map_title” => „New Map”,
„map_start_lat” => „$wpgmza_lat”,
„map_start_lng” => „$wpgmza_lng”,
„map_width” => „$wpgmza_width”,
„map_height” => „$wpgmza_height”,
„map_start_location” => „$wpgmza_lat,$wpgmza_lng”,
„map_start_zoom” => „$start_zoom”,
„default_marker” => „$wpgmza_def_marker”,
„alignment” => „$wpgmza_def_alignment”,
„styling_enabled” => „0”,
„styling_json” => „”,
„active” => „0”,
„directions_enabled” => „$wpgmza_def_directions”,
„type” => „$wpgmza_def_type”,
„bicycle” => „$wpgmza_def_bicycle”,
„traffic” => „$wpgmza_def_traffic”,
„dbox” => „$wpgmza_def_dbox”,
„dbox_width” => „$wpgmza_def_dbox_width”,
„listmarkers” => „$wpgmza_listmarkers”,
„listmarkers_advanced” => „$wpgmza_listmarkers_advanced”
)
);
$lastid = $wpdb->insert_id;
$_GET[’map_id’] = $lastid;
//wp_redirect( admin_url(’admin.php?page=wp-google-maps-menu&action=edit&map_id=’.$lastid) );
echo „<script>window.location = \””.get_option(’siteurl’).”/wp-admin/admin.php?page=wp-google-maps-menu&action=edit&map_id=”.$lastid.”\”</script>”;
}if (isset($_GET[’map_id’])) {
$res = wpgmza_get_map_data($_GET[’map_id’]);
if (function_exists(wpgmza_register_gold_version)) { $addon_text = __(„including Pro & Gold add-ons”,”wp-google-maps”); } else { $addon_text = __(„including Pro add-on”,”wp-google-maps”); }
if (!$res->map_id || $res->map_id == „”) { $wpgmza_data[’map_id’] = 1; }
if (!$res->default_marker || $res->default_marker == „” || $res->default_marker == „0”) { $display_marker = „<img src=\””.wpgmaps_get_plugin_url().”/images/marker.png\” />”; } else { $display_marker = „<img src=\””.$res->default_marker.”\” />”; }
if ($res->map_start_zoom) { $wpgmza_zoom[intval($res->map_start_zoom)] = „SELECTED”; } else { $wpgmza_zoom[8] = „SELECTED”; }
if ($res->type) { $wpgmza_map_type[intval($res->type)] = „SELECTED”; } else { $wpgmza_map_type[1] = „SELECTED”; }
if ($res->alignment) { $wpgmza_map_align[intval($res->alignment)] = „SELECTED”; } else { $wpgmza_map_align[1] = „SELECTED”; }
if ($res->directions_enabled) { $wpgmza_directions[intval($res->directions_enabled)] = „SELECTED”; } else { $wpgmza_directions[2] = „SELECTED”; }
if ($res->bicycle) { $wpgmza_bicycle[intval($res->bicycle)] = „SELECTED”; } else { $wpgmza_bicycle[2] = „SELECTED”; }
if ($res->traffic) { $wpgmza_traffic[intval($res->traffic)] = „SELECTED”; } else { $wpgmza_traffic[2] = „SELECTED”; }
if ($res->dbox != „1”) { $wpgmza_dbox[intval($res->dbox)] = „SELECTED”; } else { $wpgmza_dbox[1] = „SELECTED”; }if ($res->map_width_type == „%”) { $wpgmza_map_width_type_percentage = „SELECTED”; } else { $wpgmza_map_width_type_px = „SELECTED”; }
if ($res->map_height_type == „%”) { $wpgmza_map_height_type_percentage = „SELECTED”; } else { $wpgmza_map_height_type_px = „SELECTED”; }if ($res->listmarkers == „1”) { $listmarkers_checked = „CHECKED”; } else { }
if ($res->listmarkers_advanced == „1”) { $listmarkers_advanced_checked = „CHECKED”; } else { }$wpgmza_csv = „„.__(„Download this data as a CSV file”,”wp-google-maps”).”„;
}
echo „
<div class=’wrap’>
<h1>WP Google Maps <small>($addon_text)</small></h1>
<div class=’wide’>
„.wpgmza_version_check().”
<h2>”.__(„Create your Map”,”wp-google-maps”).”</h2>
$version_message
<div style=\”display:block; overflow:auto; background-color:#FFFBCC; padding:10px; border:1px solid #E6DB55; margin-top:5px; margin-bottom:5px;\”>
<form action=” method=’post’ id=’wpgmaps_options’ name=’wpgmza_map_form’>
<p></p><input type=’hidden’ name=’http_referer’ value='”.$_SERVER[’PHP_SELF’].”’ />
<input type=’hidden’ name=’wpgmza_id’ id=’wpgmza_id’ value='”.$res->id.”’ />
<input id=’wpgmza_start_location’ name=’wpgmza_start_location’ type=’hidden’ size=’40’ maxlength=’100′ value='”.$res->map_start_location.”’ />
<select id=’wpgmza_start_zoom’ name=’wpgmza_start_zoom’ style=\”display:none;\”>
<option value=\”1\” „.$wpgmza_zoom[1].”>1</option>
<option value=\”2\” „.$wpgmza_zoom[2].”>2</option>
<option value=\”3\” „.$wpgmza_zoom[3].”>3</option>
<option value=\”4\” „.$wpgmza_zoom[4].”>4</option>
<option value=\”5\” „.$wpgmza_zoom[5].”>5</option>
<option value=\”6\” „.$wpgmza_zoom[6].”>6</option>
<option value=\”7\” „.$wpgmza_zoom[7].”>7</option>
<option value=\”8\” „.$wpgmza_zoom[8].”>8</option>
<option value=\”9\” „.$wpgmza_zoom[9].”>9</option>
<option value=\”10\” „.$wpgmza_zoom[10].”>10</option>
<option value=\”11\” „.$wpgmza_zoom[11].”>11</option>
<option value=\”12\” „.$wpgmza_zoom[12].”>12</option>
<option value=\”13\” „.$wpgmza_zoom[13].”>13</option>
<option value=\”14\” „.$wpgmza_zoom[14].”>14</option>
<option value=\”15\” „.$wpgmza_zoom[15].”>15</option>
<option value=\”16\” „.$wpgmza_zoom[16].”>16</option>
<option value=\”17\” „.$wpgmza_zoom[17].”>17</option>
<option value=\”18\” „.$wpgmza_zoom[18].”>18</option>
<option value=\”19\” „.$wpgmza_zoom[19].”>19</option>
<option value=\”20\” „.$wpgmza_zoom[20].”>20</option>
<option value=\”21\” „.$wpgmza_zoom[21].”>21</option>
</select><table class=’form-table’>
<tr>
<td>”.__(„Short code”,”wp-google-maps”).”:</td>
<td><input type=’text’ readonly name=’shortcode’ style=’font-size:18px; text-align:center;’ value='[wpgmza id=\””.$res->id.”\”]’ /> <small><i>”.__(„copy this into your post or page to display the map”,”wp-google-maps”).”</i></td>
</tr>
<tr>
<td>”.__(„Map Name”,”wp-google-maps”).”:</td>
<td><input id=’wpgmza_title’ name=’wpgmza_title’ class=’regular-text’ type=’text’ size=’20’ maxlength=’50’ value='”.$res->map_title.”’ /></td>
</tr>
<tr>
<td>”.__(„Map Dimensions”,”wp-google-maps”).”:</td>
<td>
„.__(„Width”,”wp-google-maps”).”: <input id=’wpgmza_width’ name=’wpgmza_width’ type=’text’ size=’4′ maxlength=’4′ class=’small-text’ value='”.$res->map_width.”’ />
<select id=’wpgmza_map_width_type’ name=’wpgmza_map_width_type’>
<option value=\”px\” $wpgmza_map_width_type_px>px</option>
<option value=\”%\” $wpgmza_map_width_type_percentage>%</option>
</select>
„.__(„Height”,”wp-google-maps”).”: <input id=’wpgmza_height’ name=’wpgmza_height’ type=’text’ size=’4′ maxlength=’4′ class=’small-text’ value='”.$res->map_height.”’ />
<select id=’wpgmza_map_height_type’ name=’wpgmza_map_height_type’>
<option value=\”px\” $wpgmza_map_height_type_px>px</option>
<option value=\”%\” $wpgmza_map_height_type_percentage>%</option>
</select></td>
</tr></table>
„.__(„Show advanced options”,”wp-google-maps”).”
„.__(„Hide advanced options”,”wp-google-maps”).”<table class=’form-table’ id=’wpgmaps_advanced_options’ style=’display:none;’>
<tr>
<td>”.__(„Default Marker Image”,”wp-google-maps”).”:</td>
<td><span id=\”wpgmza_mm\”>$display_marker</span> <input id=\”upload_default_marker\” name=\”upload_default_marker\” type=’hidden’ size=’35’ class=’regular-text’ maxlength=’700′ value='”.$res->default_marker.”’ „.$wpgmza_act.”/> <input id=\”upload_default_marker_btn\” type=\”button\” value=\””.__(„Upload Image”,”wp-google-maps”).”\” $wpgmza_act /> -reset- <small><i>”.__(„Get great map markers here„,”wp-google-maps”).”</i></small></td>
</tr><tr>
<td>”.__(„Map type”,”wp-google-maps”).”:</td>
<td><select id=’wpgmza_map_type’ name=’wpgmza_map_type’ class=’postform’>
<option value=\”1\” „.$wpgmza_map_type[1].”>”.__(„Roadmap”,”wp-google-maps”).”</option>
<option value=\”2\” „.$wpgmza_map_type[2].”>”.__(„Satellite”,”wp-google-maps”).”</option>
<option value=\”3\” „.$wpgmza_map_type[3].”>”.__(„Hybrid”,”wp-google-maps”).”</option>
<option value=\”4\” „.$wpgmza_map_type[4].”>”.__(„Terrain”,”wp-google-maps”).”</option>
</select>
</td>
</tr>
<tr>
<td>”.__(„List all Markers”,”wp-google-maps”).”:</td>
<td>
<input id=’wpgmza_listmarkers’ name=’wpgmza_listmarkers’ type=’checkbox’ value=’1′ $listmarkers_checked /> „.__(„List all markers below the map”,”wp-google-maps”).”<input id=’wpgmza_listmarkers_advanced’ name=’wpgmza_listmarkers_advanced’ type=’checkbox’ value=’1′ $listmarkers_advanced_checked /> „.__(„Select this for the advanced listing functionality”,”wp-google-maps”).”
</td>
</tr>
<tr>
<td>”.__(„Map Alignment”,”wp-google-maps”).”:</td>
<td><select id=’wpgmza_map_align’ name=’wpgmza_map_align’ class=’postform’>
<option value=\”1\” „.$wpgmza_map_align[1].”>”.__(„Left”,”wp-google-maps”).”</option>
<option value=\”2\” „.$wpgmza_map_align[2].”>”.__(„Center”,”wp-google-maps”).”</option>
<option value=\”3\” „.$wpgmza_map_align[3].”>”.__(„Right”,”wp-google-maps”).”</option>
<option value=\”4\” „.$wpgmza_map_align[4].”>”.__(„None”,”wp-google-maps”).”</option>
</select>
</td>
</tr><tr>
<td>”.__(„Enable Directions?”,”wp-google-maps”).”:</td>
<td><select id=’wpgmza_directions’ name=’wpgmza_directions’ class=’postform’>
<option value=\”1\” „.$wpgmza_directions[1].”>”.__(„Yes”,”wp-google-maps”).”</option>
<option value=\”2\” „.$wpgmza_directions[2].”>”.__(„No”,”wp-google-maps”).”</option>
</select>
„.__(„Directions Box Open by Default?”,”wp-google-maps”).”:
<select id=’wpgmza_dbox’ name=’wpgmza_dbox’ class=’postform’>
<option value=\”1\” „.$wpgmza_dbox[1].”>”.__(„No”,”wp-google-maps”).”</option>
<option value=\”2\” „.$wpgmza_dbox[2].”>”.__(„Yes, on the left”,”wp-google-maps”).”</option>
<option value=\”3\” „.$wpgmza_dbox[3].”>”.__(„Yes, on the right”,”wp-google-maps”).”</option>
<option value=\”4\” „.$wpgmza_dbox[4].”>”.__(„Yes, above”,”wp-google-maps”).”</option>
<option value=\”5\” „.$wpgmza_dbox[5].”>”.__(„Yes, below”,”wp-google-maps”).”</option>
</select>
„.__(„Directions Box Width”,”wp-google-maps”).”:
<input id=’wpgmza_dbox_width’ name=’wpgmza_dbox_width’ type=’text’ size=’4′ maxlength=’4′ class=’small-text’ value='”.$res->dbox_width.”’ /> px
</td>
</tr>
<tr>
<td>”.__(„Enable Bicycle Layer?”,”wp-google-maps”).”:</td>
<td><select id=’wpgmza_bicycle’ name=’wpgmza_bicycle’ class=’postform’>
<option value=\”1\” „.$wpgmza_bicycle[1].”>”.__(„Yes”,”wp-google-maps”).”</option>
<option value=\”2\” „.$wpgmza_bicycle[2].”>”.__(„No”,”wp-google-maps”).”</option>
</select>
„.__(„Enable Traffic Layer?”,”wp-google-maps”).”:
<select id=’wpgmza_traffic’ name=’wpgmza_traffic’ class=’postform’>
<option value=\”1\” „.$wpgmza_traffic[1].”>”.__(„Yes”,”wp-google-maps”).”</option>
<option value=\”2\” „.$wpgmza_traffic[2].”>”.__(„No”,”wp-google-maps”).”</option>
</select></td>
</tr>
<tr></tr>
<tr>
<td></td>
</tr>
<tr>
<td>”.__(„KML/GeoRSS URL”,”wp-google-maps”).”:</td>
<td>
<input id=’wpgmza_kml’ name=’wpgmza_kml’ type=’text’ size=’100′ maxlength=’700′ class=’regular-text’ value='”.$res->kml.”’ /> <small>”.__(„The KML/GeoRSS layer will over-ride most of your map settings”,”wp-google-maps”).”</small></td>
</td>
</tr>
<tr>
<td>”.__(„Fusion table ID”,”wp-google-maps”).”:</td>
<td>
<input id=’wpgmza_fusion’ name=’wpgmza_fusion’ type=’text’ size=’20’ maxlength=’200′ class=’small-text’ value='”.$res->fusion.”’ /> <small>”.__(„Read data directly from your Fusion Table. For more information, see http://googlemapsmania.blogspot.com/2010/05/fusion-tables-google-maps-api.html„,”wp-google-maps”).”</small></td>
</td>
</tr>
</table>
<div id=\”wpgmaps_save_reminder\” style=\”display:none;\”><span style=\”font-size:16px; color:#1C62B9;\”>
„.__(„Remember to save your map!”,”wp-google-maps”).”
</span></div></div>
<p class=’submit’><input type=’submit’ name=’wpgmza_savemap’ class=’button-primary’ value='”.__(„Save Map”,”wp-google-maps”).” »’ /></p>
<p style=\”width:600px; color:#808080;\”>
„.__(„Tip: Use your mouse to change the layout of your map. When you have positioned the map to your desired location, press \”Save Map\” to keep your settings.”,”wp-google-maps”).”</p><div id=\”wpgmza_map\”> </div>
<div style=\”display:block; overflow:auto; background-color:#FFFBCC; padding:10px; border:1px solid #E6DB55; margin-top:5px; margin-bottom:5px;\”>
<h2 style=\”padding-top:0; margin-top:0;\”>”.__(„Add a marker”,”wp-google-maps”).”</h2>
<input type=\”hidden\” name=\”wpgmza_edit_id\” id=\”wpgmza_edit_id\” value=\”\” />
<p>
<table>
<tr>
<td>”.__(„Title”,”wp-google-maps”).”: </td>
<td><input id=’wpgmza_add_title’ name=’wpgmza_add_title’ type=’text’ size=’35’ maxlength=’200′ value=” />
</td></tr>
<tr>
<td>”.__(„Address/GPS”,”wp-google-maps”).”: </td>
<td><input id=’wpgmza_add_address’ name=’wpgmza_add_address’ type=’text’ size=’35’ maxlength=’200′ value=” />
</td></tr>
<tr><td valign=’top’>”.__(„Description”,”wp-google-maps”).”: </td>
<td><textarea id=’wpgmza_add_desc’ name=’wpgmza_add_desc’ „.$wpgmza_act.” rows=’3′ cols=’37’></textarea>
</td></tr>
<tr><td>”.__(„Pic URL”,”wp-google-maps”).”: </td>
<td><input id=’wpgmza_add_pic’ name=\”wpgmza_add_pic\” type=’text’ size=’35’ maxlength=’700′ value=” „.$wpgmza_act.”/> <input id=\”upload_image_button\” type=\”button\” value=\””.__(„Upload Image”,”wp-google-maps”).”\” $wpgmza_act /> <small><i>(„.__(„Or paste image URL”,”wp-google-maps”).”)</i></small>
</td></tr>
<tr><td>”.__(„Link URL”,”wp-google-maps”).”: </td>
<td><input id=’wpgmza_link_url’ name=’wpgmza_link_url’ type=’text’ size=’35’ maxlength=’700′ value=” „.$wpgmza_act.” /><small><i> „.__(„Format: http://www.domain.com”,”wp-google-maps”).”</i></small>
</td></tr>
<tr><td>”.__(„Custom Marker”,”wp-google-maps”).”: </td>
<td><span id=\”wpgmza_cmm\”></span><input id=’wpgmza_add_custom_marker’ name=\”wpgmza_add_custom_marker\” type=’hidden’ size=’35’ maxlength=’700′ value=” „.$wpgmza_act.”/> <input id=\”upload_custom_marker_button\” type=\”button\” value=\””.__(„Upload Image”,”wp-google-maps”).”\” $wpgmza_act /> <small><i>(„.__(„ignore if you want to use the default marker”,”wp-google-maps”).”)</i></small>
</td></tr>
<tr>
<td>”.__(„Animation”,”wp-google-maps”).”: </td>
<td>
<select name=\”wpgmza_animation\” id=\”wpgmza_animation\”>
<option value=\”0\”>”.__(„None”,”wp-google-maps”).”</option>
<option value=\”1\”>”.__(„Bounce”,”wp-google-maps”).”</option>
<option value=\”2\”>”.__(„Drop”,”wp-google-maps”).”</option>
</td>
</tr>
<tr>
<td>”.__(„InfoWindow open by default”,”wp-google-maps”).”: </td>
<td>
<select name=\”wpgmza_infoopen\” id=\”wpgmza_infoopen\”>
<option value=\”0\”>”.__(„No”,”wp-google-maps”).”</option>
<option value=\”1\”>”.__(„Yes”,”wp-google-maps”).”</option>
</td>
</tr>
<tr>
<td></td>
<td>
<span id=\”wpgmza_addmarker_div\”><input type=\”button\” id=’wpgmza_addmarker’ class=’button-primary’ value='”.__(„Add Marker”,”wp-google-maps”).”’ /></span> <span id=\”wpgmza_addmarker_loading\” style=\”display:none;\”>”.__(„Adding”,”wp-google-maps”).”…</span>
<span id=\”wpgmza_editmarker_div\” style=\”display:none;\”><input type=\”button\” id=’wpgmza_editmarker’ class=’button-primary’ value='”.__(„Save Marker”,”wp-google-maps”).”’ /></span><span id=\”wpgmza_editmarker_loading\” style=\”display:none;\”>”.__(„Saving”,”wp-google-maps”).”…</span>
</td>
</tr>
</table>
</div>
<p>$wpgmza_act_msg</p>
</form><h2 style=\”padding-top:0; margin-top:0;\”>”.__(„Your Markers”,”wp-google-maps”).”</h2>
<div id=\”wpgmza_marker_holder\”>
„.wpgmza_return_marker_list($_GET[’map_id’]).”
</div>„.wpgmza_return_pro_add_ons().”
<p>
„.__(„WP Google Maps encourages you to make use of the amazing icons created by Nicolas Mollet’s Maps Icons Collection”,”wp-google-maps”).” http://mapicons.nicolasmollet.com/ „.__(„and to credit him when doing so.”,”wp-google-maps”).”</p>
</div>
</div>
„;}
function wpgmaps_action_callback_pro() {
global $wpdb;
global $wpgmza_tblname;
$check = check_ajax_referer( 'wpgmza’, 'security’ );
$table_name = $wpdb->prefix . „wpgmza”;
if ($check == 1) {if ($_POST[’action’] == „add_marker”) {
$ins_array = array( 'map_id’ => $_POST[’map_id’], 'title’ => $_POST[’title’], 'address’ => $_POST[’address’], 'desc’ => $_POST[’desc’], 'pic’ => $_POST[’pic’], 'icon’ => $_POST[’icon’], 'link’ => $_POST[’link’], 'lat’ => $_POST[’lat’], 'lng’ => $_POST[’lng’], 'anim’ => $_POST[’anim’], 'infoopen’ => $_POST[’infoopen’] );$rows_affected = $wpdb->insert( $table_name, $ins_array );
wpgmaps_update_xml_file($_POST[’map_id’]);
echo wpgmza_return_marker_list($_POST[’map_id’]);
}if ($_POST[’action’] == „edit_marker”) {
$desc = $_POST[’desc’];
$link = $_POST[’link’];
$pic = $_POST[’pic’];
$icon = $_POST[’icon’];
$anim = $_POST[’anim’];
$infoopen = $_POST[’infoopen’];
$cur_id = intval($_POST[’edit_id’]);
$rows_affected = $wpdb->query(„UPDATE $table_name SETtitle
= '”.$_POST[’title’].”’,address
= '”.$_POST[’address’].”’,desc
= '$desc’,link
= '$link’,icon
= '$icon’,pic
= '$pic’,lat
= '”.$_POST[’lat’].”’,lng
= '”.$_POST[’lng’].”’,anim
= '$anim’,infoopen
= '$infoopen’ WHEREid
= '$cur_id'”);
wpgmaps_update_xml_file($_POST[’map_id’]);
echo wpgmza_return_marker_list($_POST[’map_id’]);
}if ($_POST[’action’] == „delete_marker”) {
$marker_id = $_POST[’marker_id’];
$wpdb->query(
„
DELETE FROM $wpgmza_tblname
WHEREid
= '$marker_id’
LIMIT 1
„
);
wpgmaps_update_xml_file($_POST[’map_id’]);
echo wpgmza_return_marker_list($_POST[’map_id’]);}
}die(); // this is required to return a proper result
}
function wpgmza_return_pro_add_ons() {
if (function_exists(wpgmza_register_gold_version)) { $wpgmza_ret .= wpgmza_gold_addon_display(); } else { $wpgmza_ret .= „”; }
if (function_exists(wpgmza_register_ugm_version)) { $wpgmza_ret .= wpgmza_ugm_addon_display_mapspage(); } else { $wpgmza_ret .= „”; }
return $wpgmza_ret;
}function wpgmaps_tag_pro( $atts ) {
global $wpgmza_current_map_id;
extract( shortcode_atts( array(
'id’ => '1′
), $atts ) );$wpgmza_current_map_id = $atts[’id’];
$res = wpgmza_get_map_data($atts[’id’]);
//$wpgmza_data = get_option(’WPGMZA’);$map_width_type = $res->map_width_type;
$map_height_type = $res->map_height_type;if (!isset($map_width_type)) { $map_width_type == „px”; }
if (!isset($map_height_type)) { $map_height_type == „px”; }if ($map_width_type == „%” && intval($res->map_width) > 100) { $res->map_width = 100; }
if ($map_height_type == „%” && intval($res->map_height) > 100) { $res->map_height = 100; }$map_align = $res->alignment;
if (!$map_align || $map_align == „” || $map_align == „1”) { $map_align = „float:left;”; }
else if ($map_align == „2”) { $map_align = „margin-left:auto !important; margin-right:auto; !important; align:center;”; }
else if ($map_align == „3”) { $map_align = „float:right;”; }
else if ($map_align == „4”) { $map_align = „”; }
$map_style = „style=\”display:block; overflow:auto; width:”.$res->map_width.””.$map_width_type.”; height:”.$res->map_height.””.$map_height_type.”; $map_align\””;global $short_code_active;
$short_code_active = true;global $wpgmza_short_code_array;
$wpgmza_short_code_array[] = $wpgmza_current_map_id;$d_enabled = $res->directions_enabled;
$map_width = $res->map_width;
$map_width_type = $res->map_width_type;// for marker list
$default_marker = $res->default_marker;
if ($default_marker) { $default_marker = „<img src='”.$default_marker.”’ />”; } else { $default_marker = „<img src='”.wpgmaps_get_plugin_url().”/images/marker.png’ />”; }$dbox_width = $res->dbox_width;
$dbox_option = $res->dbox;
if ($dbox_option == „1”) { $dbox_style = „display:none;”; }
else if ($dbox_option == „2”) { $dbox_style = „float:left; width:”.$dbox_width.”px; padding-right:10px; display:block; overflow:auto;”; }
else if ($dbox_option == „3”) { $dbox_style = „float:right; width:”.$dbox_width.”px; padding-right:10px; display:block; overflow:auto;”; }
else if ($dbox_option == „4”) { $dbox_style = „float:none; width:”.$dbox_width.”px; padding-bottom:10px; display:block; overflow:auto; clear:both;”; }
else if ($dbox_option == „5”) { $dbox_style = „float:none; width:”.$dbox_width.”px; padding-top:10px; display:block; overflow:auto; clear:both;”; }
else { $dbox_style = „display:none;”; }// GET LIST OF MARKERS
if ($res->listmarkers == 1 && $res->listmarkers_advanced == 1) {
$wpgmza_marker_list_output = wpgmza_return_marker_list($atts[’id’],false,$map_width.$map_width_type);
}
else if ($res->listmarkers == 1 && $res->listmarkers_advanced == 0) {
global $wpdb;
global $wpgmza_tblname;$results = $wpdb->get_results(„
SELECT *
FROM $wpgmza_tblname
WHEREmap_id
= '$wpgmza_current_map_id’ ORDER BYid
DESC
„);$wpgmza_marker_list_output .= „
<table id=\”wpgmza_marker_list\” class=\”wpgmza_marker_list_class\” cellspacing=\”0\” cellpadding=\”0\” style=\”width:”.$map_width.”px\”>
<thead>
<tr>
<th></th>
<th></th></tr>
</thead>
<tbody>
„;$wpgmza_settings = get_option(„WPGMZA_OTHER_SETTINGS”);
$wpgmza_image_height = $wpgmza_settings[’wpgmza_settings_image_height’];
$wpgmza_image_width = $wpgmza_settings[’wpgmza_settings_image_width’];
if (!$wpgmza_image_height || !isset($wpgmza_image_height)) { $wpgmza_image_height = „100”; }
if (!$wpgmza_image_width || !isset($wpgmza_image_width)) { $wpgmza_image_width = „100”; }foreach ( $results as $result ) {
$img = $result->pic;
$wpgmaps_id = $result->id;
$link = $result->link;
$icon = $result->icon;
$wpgmaps_lat = $result->lat;
$wpgmaps_lng = $result->lng;
$wpgmaps_address = $result->address;if (!$img) { $pic = „”; } else {
$wpgmza_use_timthumb = $wpgmza_settings[’wpgmza_settings_use_timthumb’];
if ($wpgmza_use_timthumb == „” || !isset($wpgmza_use_timthumb)) {
$pic = „<img src='”.wpgmaps_get_plugin_url().”/timthumb.php?src=”.$result->pic.”&h=”.$wpgmza_image_height.”&w=”.$wpgmza_image_width.”&zc=1′ title=” alt=” style=\”\” />”;
} else {
$pic = „<img src='”.$result->pic.”’ class=’wpgmza_map_image’ style=\”float:right; margin:5px; height:”.$wpgmza_image_height.”px; width:”.$wpgmza_image_width.”.px\” />”;
}
}
if (!$icon) { $icon = $default_marker; } else { $icon = „<img src='”.$result->icon.”’ />”; }
if ($d_enabled == „1”) {
$wpgmaps_dir_text = „
title.”\” class=\”wpgmza_gd\” wpgm_addr_field=\””.$wpgmaps_address.”\” gps=\”$wpgmaps_lat,$wpgmaps_lng\”>”._(„Directions”,”wp-google-maps”).”„;
}
if ($result->desc) {
$wpgmaps_desc_text = „
„.$result->desc.””;
} else {
$wpgmaps_desc_text = „”;
}
$wpgmza_marker_list_output .= „
<tr id=\”wpgmza_marker_”.$result->id.”\” mid=\””.$result->id.”\” mapid=\””.$result->map_id.”\” class=\”wpgmaps_mlist_row\”>
<td height=\”40\” class=\”wpgmaps_mlist_marker\”>”.$icon.”</td>
<td valign=\”top\” align=\”left\” class=\”wpgmaps_mlist_info\”>
title.”\”>”.$result->title.”
$wpgmaps_desc_text
$wpgmaps_dir_text
</td></tr>”;
}
$wpgmza_marker_list_output .= „</tbody></table>”;} else { $wpgmza_marker_list_output = „”; }
$dbox_div = „
<div id=\”wpgmaps_directions_edit_”.$atts[’id’].”\” style=\”$dbox_style\” class=\”wpgmaps_directions_outer_div\”>
<h2>”.__(„Get Directions”,”wp-google-maps”).”</h2>
<div id=\”wpgmaps_directions_editbox_”.$atts[’id’].”\”>
<table>
<tr>
<td>”.__(„For”,”wp-google-maps”).”:</td><td>
<select id=\”wpgmza_dir_type_”.$atts[’id’].”\” name=\”wpgmza_dir_type_”.$atts[’id’].”\”>
<option value=\”DRIVING\” selected=\”selected\”>”.__(„Driving”,”wp-google-maps”).”</option>
<option value=\”WALKING\”>”.__(„Walking”,”wp-google-maps”).”</option>
<option value=\”BICYCLING\”>”.__(„Bicycling”,”wp-google-maps”).”</option>
</select>
„.__(„show options”,”wp-google-maps”).”
„.__(„hide options”,”wp-google-maps”).”
<div style=\”display:none\” id=\”wpgmza_options_box_”.$atts[’id’].”\”>
<input type=\”checkbox\” id=\”wpgmza_tolls_”.$atts[’id’].”\” name=\”wpgmza_tolls_”.$atts[’id’].”\” value=\”tolls\” /> „.__(„Avoid Tolls”,”wp-google-maps”).”
<input type=\”checkbox\” id=\”wpgmza_highways_”.$atts[’id’].”\” name=\”wpgmza_highways_”.$atts[’id’].”\” value=\”highways\” /> „.__(„Avoid Highways”,”wp-google-maps”).”
</div></td>
</tr>
<tr><td>”.__(„From”,”wp-google-maps”).”:</td><td width=’90%’><input type=\”text\” value=\”\” id=\”wpgmza_input_from_”.$atts[’id’].”\” style=’width:80%’ /></td><td></td></tr>
<tr><td>”.__(„To”,”wp-google-maps”).”:</td><td width=’90%’><input type=\”text\” value=\”\” id=\”wpgmza_input_to_”.$atts[’id’].”\” style=’width:80%’ /></td><td></td></tr>
<tr><td>
</td><td>
<input onclick=\”javascript:void(0);\” class=\”wpgmaps_get_directions\” id=\””.$atts[’id’].”\” type=\”button\” value=\””.__(„Go”,”wp-google-maps”).”\”/>
</td>
</tr>
</table>
</div>„;
if ($dbox_option == „5” || $dbox_option == „1” || !isset($dbox_option)) {
$ret_msg = „
<style>
.wpgmza_map img { max-width:none !important; }
</style>
<div id=\”wpgmza_map_”.$atts[’id’].”\” class=’wpgmza_map’ $map_style> </div>
$wpgmza_marker_list_output
<div id=\”display:block; width:100%;\”>$dbox_div
<div id=\”wpgmaps_directions_notification_”.$atts[’id’].”\” style=\”display:none;\”>”.__(„Fetching directions…”,”wp-google-maps”).”…</div>
<div id=\”wpgmaps_directions_reset_”.$atts[’id’].”\” style=\”display:none;\”>„.__(„Reset directions”,”wp-google-maps”).”</div>
<div id=\”directions_panel_”.$atts[’id’].”\”></div>
</div>
</div>„;
} else {
$ret_msg = „
<style>
.wpgmza_map img { max-width:none !important; }
</style><div id=\”display:block; width:100%; overflow:auto;\”>
$dbox_div
<div id=\”wpgmaps_directions_notification_”.$atts[’id’].”\” style=\”display:none;\”>”.__(„Fetching directions…”,”wp-google-maps”).”…</div>
<div id=\”wpgmaps_directions_reset_”.$atts[’id’].”\” style=\”display:none;\”>„.__(„Reset directions”,”wp-google-maps”).”</div>
<div id=\”directions_panel_”.$atts[’id’].”\”></div>
</div>
<div id=\”wpgmza_map_”.$atts[’id’].”\” class=’wpgmza_map’ $map_style> </div>
$wpgmza_marker_list_output
</div>„;
}
$ugm_enabled = $res->ugm_enabled;
if ($ugm_enabled) {
$ret_msg .= wpgmaps_ugm_user_form($atts[’id’]);
}return $ret_msg;
}function wpgmaps_user_javascript_pro() {
global $short_code_active;
global $wpgmza_current_map_id;
global $wpgmza_short_code_array;if ($short_code_active) {
$ajax_nonce = wp_create_nonce(„wpgmza”);?>
<script type=”text/javascript” src=”http://maps.google.com/maps/api/js?sensor=false”></script>
<link rel=”stylesheet” type=”text/css” media=”all” href=”<?php echo wpgmaps_get_plugin_url(); ?>/css/data_table_front.css” />
<script type=”text/javascript” src=”<?php echo wpgmaps_get_plugin_url(); ?>/js/jquery.dataTables.js”></script>
<script type=”text/javascript” >
jQuery(function() {jQuery(document).ready(function(){
<?php
if (function_exists(wpgmaps_ugm_user_javascript)) {
wpgmaps_ugm_user_javascript();
}
?>});
jQuery(„.wpgmaps_mlist_row”).live(„click”, function() {
var wpgmza_markerid = jQuery(this).attr(„mid”);
var wpgmza_mapid = jQuery(this).attr(„mapid”);
openInfoWindow(wpgmza_markerid);
location.hash = „#map” + wpgmza_mapid;
});<?php
foreach ($wpgmza_short_code_array as $wpgmza_cmd) {
$res = wpgmza_get_map_data($wpgmza_cmd);?>
function wpgmza_reinitialisetbl_<?php echo $wpgmza_cmd; ?>() {
wpgmzaTable_<?php echo $wpgmza_cmd; ?>.fnClearTable( 0 );
wpgmzaTable_<?php echo $wpgmza_cmd; ?> = jQuery(’#wpgmza_table_<?php echo $wpgmza_cmd; ?>’).dataTable({
„bProcessing”: true
});
}
wpgmzaTable_<?php echo $wpgmza_cmd; ?> = jQuery(’#wpgmza_table_<?php echo $wpgmza_cmd; ?>’).dataTable({
„bProcessing”: true,
„aaSorting”: [[ 0, „desc” ]]
});
<?php
$wpgmza_settings = get_option(„WPGMZA_OTHER_SETTINGS”);$wpgmza_lat[$wpgmza_cmd] = $res->map_start_lat;
$wpgmza_lng[$wpgmza_cmd] = $res->map_start_lng;
$wpgmza_width[$wpgmza_cmd] = $res->map_width;
$wpgmza_height[$wpgmza_cmd] = $res->map_height;
$wpgmza_width_type[$wpgmza_cmd] = $res->map_width_type;
$wpgmza_height_type[$wpgmza_cmd] = $res->map_height_type;
$wpgmza_map_type[$wpgmza_cmd] = $res->type;
$wpgmza_default_icon[$wpgmza_cmd] = $res->default_marker;
$wpgmza_directions[$wpgmza_cmd] = $res->directions_enabled;
$kml[$wpgmza_cmd] = $res->kml;
$fusion[$wpgmza_cmd] = $res->fusion;
$wpgmza_bicycle[$wpgmza_cmd] = $res->bicycle;
$wpgmza_traffic[$wpgmza_cmd] = $res->traffic;
$wpgmza_dbox[$wpgmza_cmd] = $res->dbox;
$wpgmza_dbox_width[$wpgmza_cmd] = $res->dbox_width;$wpgmza_listmarkers[$wpgmza_cmd] = $res->listmarkers;
$wpgmza_listmarkers_advanced[$wpgmza_cmd] = $res->listmarkers_advanced;if ($wpgmza_default_icon[$wpgmza_cmd] == „0”) { $wpgmza_default_icon[$wpgmza_cmd] = „”; }
if (!$wpgmza_map_type[$wpgmza_cmd] || $wpgmza_map_type[$wpgmza_cmd] == „” || $wpgmza_map_type[$wpgmza_cmd] == „1”) { $wpgmza_map_type[$wpgmza_cmd] = „ROADMAP”; }
else if ($wpgmza_map_type[$wpgmza_cmd] == „2”) { $wpgmza_map_type[$wpgmza_cmd] = „SATELLITE”; }
else if ($wpgmza_map_type[$wpgmza_cmd] == „3”) { $wpgmza_map_type[$wpgmza_cmd] = „HYBRID”; }
else if ($wpgmza_map_type[$wpgmza_cmd] == „4”) { $wpgmza_map_type[$wpgmza_cmd] = „TERRAIN”; }
else { $wpgmza_map_type[$wpgmza_cmd] = „ROADMAP”; }
$start_zoom[$wpgmza_cmd] = $res->map_start_zoom;
if ($start_zoom[$wpgmza_cmd] < 1 || !$start_zoom[$wpgmza_cmd]) { $start_zoom[$wpgmza_cmd] = 5; }
if (!$wpgmza_lat[$wpgmza_cmd] || !$wpgmza_lng[$wpgmza_cmd]) { $wpgmza_lat[$wpgmza_cmd] = „51.5081290”; $wpgmza_lng[$wpgmza_cmd] = „-0.1280050”; }?>
jQuery(„<?php echo „#wpgmza_map_”.$wpgmza_cmd; ?>”).css({
height:'<?php echo $wpgmza_height[$wpgmza_cmd]; ?><?php echo $wpgmza_height_type[$wpgmza_cmd]; ?>’,
width:'<?php echo $wpgmza_width[$wpgmza_cmd]; ?><?php echo $wpgmza_width_type[$wpgmza_cmd]; ?>’});
function InitMap_<?php echo $wpgmza_cmd; ?>() {
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat[$wpgmza_cmd]; ?>,<?php echo $wpgmza_lng[$wpgmza_cmd]; ?>);
MYMAP_<?php echo $wpgmza_cmd; ?>.init(„<?php echo „#wpgmza_map_”.$wpgmza_cmd; ?>”, myLatLng, <?php echo $start_zoom[$wpgmza_cmd]; ?>);
UniqueCode=Math.round(Math.random()*10000);
MYMAP_<?php echo $wpgmza_cmd; ?>.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_cmd); ?>?u=’+UniqueCode,<?php echo $wpgmza_cmd; ?>);
};
InitMap_<?php echo $wpgmza_cmd; ?>();<?php } // end foreach map loop ?>
});
var directionsDisplay = [];
var directionsService = [];<?php foreach ($wpgmza_short_code_array as $wpgmza_cmd) { ?>
// general directions settings and variables
directionsDisplay[<?php echo $wpgmza_cmd; ?>];
directionsService[<?php echo $wpgmza_cmd; ?>] = new google.maps.DirectionsService();
var currentDirections = null;
var oldDirections = [];
var new_gps;var MYMAP_<?php echo $wpgmza_cmd; ?> = {
map: null,
bounds: null,
mc: null
}
MYMAP_<?php echo $wpgmza_cmd; ?>.init = function(selector, latLng, zoom) {var myOptions = {
zoom:zoom,
center: latLng,
scrollwheel: <?php if ($wpgmza_settings[’wpgmza_settings_map_scroll’] == „yes”) { echo „false”; } else { echo „true”; } ?>,
zoomControl: <?php if ($wpgmza_settings[’wpgmza_settings_map_zoom’] == „yes”) { echo „false”; } else { echo „true”; } ?>,
panControl: <?php if ($wpgmza_settings[’wpgmza_settings_map_pan’] == „yes”) { echo „false”; } else { echo „true”; } ?>,
mapTypeControl: <?php if ($wpgmza_settings[’wpgmza_settings_map_type’] == „yes”) { echo „false”; } else { echo „true”; } ?>,
streetViewControl: <?php if ($wpgmza_settings[’wpgmza_settings_map_streetview’] == „yes”) { echo „false”; } else { echo „true”; } ?>,
mapTypeId: google.maps.MapTypeId.<?php echo $wpgmza_map_type[$wpgmza_cmd]; ?>
}this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
this.bounds = new google.maps.LatLngBounds();
directionsDisplay[<?php echo $wpgmza_cmd; ?>] = new google.maps.DirectionsRenderer({
'map’: this.map,
'preserveViewport’: true,
'draggable’: true
});
directionsDisplay[<?php echo $wpgmza_cmd; ?>].setPanel(document.getElementById(„directions_panel_<?php echo $wpgmza_cmd; ?>”));
google.maps.event.addListener(directionsDisplay[<?php echo $wpgmza_cmd; ?>], 'directions_changed’,
function() {
if (currentDirections) {
oldDirections.push(currentDirections);}
currentDirections = directionsDisplay[<?php echo $wpgmza_cmd; ?>].getDirections();
jQuery(„#directions_panel_<?php echo $wpgmza_cmd; ?>”).show();
jQuery(„#wpgmaps_directions_notification_<?php echo $wpgmza_cmd; ?>”).hide();
jQuery(„#wpgmaps_directions_reset_<?php echo $wpgmza_cmd; ?>”).show();
});<?php if ($wpgmza_bicycle[$wpgmza_cmd] == „1”) { ?>
var bikeLayer = new google.maps.BicyclingLayer();
bikeLayer.setMap(this.map);
<?php } ?>
<?php if ($wpgmza_traffic[$wpgmza_cmd] == „1”) { ?>
var trafficLayer = new google.maps.TrafficLayer();
trafficLayer.setMap(this.map);
<?php } ?>
<?php if ($kml[$wpgmza_cmd] != „”) { ?>
var georssLayer = new google.maps.KmlLayer('<?php echo $kml[$wpgmza_cmd]; ?>’);
georssLayer.setMap(this.map);
<?php } ?>
<?php if ($fusion[$wpgmza_cmd] != „”) { ?>
var fusionlayer = new google.maps.FusionTablesLayer('<?php echo $fusion[$wpgmza_cmd]; ?>’, {
suppressInfoWindows: false});
fusionlayer.setMap(this.map);
<?php } ?>
}
var infoWindow = new google.maps.InfoWindow();
<?php
$wpgmza_settings = get_option(„WPGMZA_OTHER_SETTINGS”);
$wpgmza_settings_infowindow_width = $wpgmza_settings[’wpgmza_settings_infowindow_width’];
if (!$wpgmza_settings_infowindow_width || !isset($wpgmza_settings_infowindow_width)) { $wpgmza_settings_infowindow_width = „200”; }
?>
infoWindow.setOptions({maxWidth:<?php echo $wpgmza_settings_infowindow_width; ?>});google.maps.event.addDomListener(window, 'resize’, function() {
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat[$wpgmza_cmd]; ?>,<?php echo $wpgmza_lng[$wpgmza_cmd]; ?>);
MYMAP_<?php echo $wpgmza_cmd; ?>.map.setCenter(myLatLng);
});MYMAP_<?php echo $wpgmza_cmd; ?>.placeMarkers = function(filename,map_id) {
marker_array = [];
jQuery.get(filename, function(xml){
jQuery(xml).find(„marker”).each(function(){
var wpgmza_def_icon = '<?php echo $wpgmza_default_icon[$wpgmza_cmd]; ?>’;
var wpmgza_map_id = jQuery(this).find(’map_id’).text();
var wpmgza_marker_id = jQuery(this).find(’marker_id’).text();if (wpmgza_map_id == map_id) {
var wpmgza_title = jQuery(this).find(’title’).text();
var wpmgza_address = jQuery(this).find(’address’).text();
var wpmgza_show_address = jQuery(this).find(’address’).text();
var wpmgza_mapicon = jQuery(this).find(’icon’).text();
var wpmgza_image = jQuery(this).find(’pic’).text();
var wpmgza_desc = jQuery(this).find(’desc’).text();
var wpmgza_linkd = jQuery(this).find(’linkd’).text();
var wpmgza_anim = jQuery(this).find(’anim’).text();
var wpmgza_infoopen = jQuery(this).find(’infoopen’).text();
if (wpmgza_title != „”) {
wpmgza_title = wpmgza_t
- Temat ‘WP Google Maps – Pro Add-on’ jest zamknięty na nowe odpowiedzi.