WD Google Maps – Google Maps builder Plugin - Version 1.0.19

Version Description

  • Added: Address in infowindow
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 WD Google Maps – Google Maps builder Plugin
Version 1.0.19
Comparing to
See all releases

Code changes from version 1.0.18 to 1.0.19

gmwd_admin_class.php CHANGED
@@ -11,37 +11,37 @@ class GMWDAdmin{
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
- private static $version = '1.0.18';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
18
  public function __construct() {
19
-
20
  // Includes
21
  add_action('init', array($this, 'gmwd_includes'));
22
-
23
-
24
  // Add menu
25
- add_action('admin_menu', array($this,'gmwd_options_panel'));
26
  add_action('admin_init', array($this,'setup_redirect'));
27
-
28
- //Screen options
29
  add_filter('set-screen-option', array($this, 'gmwd_set_option_maps'), 10, 3);
30
  add_filter('set-screen-option', array($this, 'gmwd_set_option_markercategories'), 10, 3);
31
  add_filter('set-screen-option', array($this, 'gmwd_set_option_themes'), 10, 3);
32
  add_filter('set-screen-option', array($this, 'gmwd_set_option_mapstyles'), 10, 3);
33
-
34
  // Add admin styles and scripts
35
  add_action('admin_enqueue_scripts', array($this, 'gmwd_styles'));
36
  add_action('admin_enqueue_scripts', array($this, 'gmwd_scripts'));
37
-
38
  // Add shortcode
39
  add_action('admin_head', array($this,'gmwd_admin_ajax'));
40
  add_action('wp_ajax_gmwd_shortcode', array('GMWDAdmin', 'gmwd_ajax'));
41
-
42
  add_filter('mce_buttons', array($this, 'gmwd_add_button'), 0);
43
- add_filter('mce_external_plugins', array($this, 'gmwd_register'));
44
-
45
  // Ajax
46
  add_action('wp_ajax_select_parent_category', array('GMWDAdmin', 'gmwd_ajax'));
47
  add_action('wp_ajax_remove_poi', array('GMWDAdmin', 'gmwd_ajax'));
@@ -50,16 +50,16 @@ class GMWDAdmin{
50
  add_action('wp_ajax_export', array('GMWDAdmin', 'gmwd_ajax'));
51
  add_action('wp_ajax_import', array('GMWDAdmin', 'gmwd_ajax'));
52
  add_action('wp_ajax_view_maps_pois', array('GMWDAdmin', 'gmwd_ajax'));
53
-
54
-
55
  add_action('wp_ajax_map_data', array('GMWDAdmin', 'gmwd_ajax'));
56
-
57
  }
58
  ////////////////////////////////////////////////////////////////////////////////////////
59
  // Public Methods //
60
  ////////////////////////////////////////////////////////////////////////////////////////
61
 
62
-
63
  public static function gmwd_activate() {
64
 
65
  require_once(GMWD_DIR . '/sql/sql.php');
@@ -74,27 +74,27 @@ class GMWDAdmin{
74
  if ($version && version_compare($version, self::$version, '<')) {
75
  require_once GMWD_DIR . "/update/gmwd_update.php";
76
  gmwd_update($version);
77
- update_option("gmwd_version", self::$version);
78
  }
79
  else {
80
- add_option("gmwd_version", self::$version, '', 'no');
81
  }
82
-
83
  add_option('gmwd_do_activation_set_up_redirect', 1);
84
  add_option('gmwd_download_markers', 0);
85
 
86
- }
87
-
88
-
89
  // Return an instance of this class.
90
-
91
  public static function gmwd_get_instance() {
92
  if (null == self::$instance) {
93
  self::$instance = new self;
94
  }
95
  return self::$instance;
96
- }
97
-
98
  ////////////////////////////////////////////////////////////////////////////////////////
99
  // Getters & Setters //
100
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -104,8 +104,8 @@ class GMWDAdmin{
104
 
105
  public function setup_redirect() {
106
  if (get_option('gmwd_do_activation_set_up_redirect')) {
107
- update_option('gmwd_do_activation_set_up_redirect',0);
108
- wp_safe_redirect( admin_url( 'index.php?page=gmwd_setup' ) );
109
  exit;
110
  }
111
  }
@@ -115,27 +115,27 @@ class GMWDAdmin{
115
 
116
  $gmwd_page = add_submenu_page('maps_gmwd', __('Maps','gmwd'), __('Maps','gmwd'), 'manage_options', 'maps_gmwd', array($this,'gmwd'));
117
  add_action('load-' . $gmwd_page, array($this,'gmwd_maps_per_page_option'));
118
-
119
  $gmwd_marker_categories_page = add_submenu_page('maps_gmwd', __('Marker Categories','gmwd'), __('Marker Categories','gmwd'), 'manage_options', 'markercategories_gmwd', array($this,'gmwd'));
120
  add_action('load-' . $gmwd_marker_categories_page, array($this,'gmwd_markercategories_per_page_option'));
121
-
122
  $gmwd_themes_page = add_submenu_page('maps_gmwd', __('Themes','gmwd'), __('Themes','gmwd'), 'manage_options', 'themes_gmwd', array($this,'gmwd'));
123
- add_action('load-' . $gmwd_themes_page, array($this,'gmwd_themes_per_page_option'));
124
-
125
  $gmwd_options_page = add_submenu_page('maps_gmwd', __('Options','gmwd'), __('Options','gmwd'), 'manage_options', 'options_gmwd', array($this,'gmwd'));
126
- $gmwd_featured_plugins_page = add_submenu_page('maps_gmwd', __('Featured Plugins','gmwd'), __('Featured Plugins','gmwd'), 'manage_options', 'featured_plugins_gmwd', array($this,'gmwd_featured_plugins'));
127
-
128
- $gmwd_featured_themes_page = add_submenu_page('maps_gmwd', __('Featured Themes','gmwd'), __('Featured Themes','gmwd'), 'manage_options', 'featured_themes_gmwd', array($this,'gmwd_featured_themes'));
129
  $gmwd_uninstall_page = add_submenu_page('maps_gmwd', __('Uninstall','gmwd'), __('Uninstall','gmwd'), 'manage_options', 'uninstall_gmwd', array($this,'gmwd'));
130
-
131
- add_menu_page(__('Google Maps WD','gmwd'), __('Google Maps WD Add-ons','gmwd'), 'manage_options', 'gmwd_addons', array($this, "gmwd_addons"), GMWD_URL . '/addons/images/add-ons-icon.png',12);
132
-
133
  }
134
 
135
  // Admin main function
136
  public function gmwd() {
137
-
138
- $page = GMWDHelper::get('page') ? GMWDHelper::get('page') : "maps_gmwd" ;
139
  $controller_class = 'GMWDController' . ucfirst(strtolower($page));
140
  $controller = new $controller_class();
141
  $controller->execute();
@@ -145,11 +145,11 @@ class GMWDAdmin{
145
  check_ajax_referer('nonce_gmwd', 'nonce_gmwd');
146
  $instance = self::gmwd_get_instance();
147
  $page = GMWDHelper::get('page') ? GMWDHelper::get('page') : "maps_gmwd" ;
148
-
149
  $controller_class = 'GMWDController' . ucfirst(strtolower($page));
150
  $controller = new $controller_class();
151
- $controller->execute();
152
- }
153
  // Admin includes
154
  public function gmwd_includes(){
155
  require_once(GMWD_DIR . '/framework/GMWDHelper.php');
@@ -158,21 +158,21 @@ class GMWDAdmin{
158
  require_once(GMWD_DIR . '/admin/models/GMWDModel.php');
159
  require_once(GMWD_DIR . '/admin/views/GMWDView.php');
160
  $page = GMWDHelper::get('page') ? GMWDHelper::get('page') : "maps_gmwd" ;
161
-
162
  if( $page == "maps_gmwd" || $page == "markercategories_gmwd" || $page == "themes_gmwd" || $page == "options_gmwd" || $page == "markers_gmwd" || $page == "circles_gmwd" || $page == "rectangles_gmwd" || $page == "polygons_gmwd" || $page == "polylines_gmwd" || $page == "uninstall_gmwd" || $page == "shortcode_gmwd" ){
163
-
164
  require_once(GMWD_DIR . '/admin/controllers/GMWDController' . ucfirst(strtolower($page)) . '.php');
165
  }
166
- if ($page == 'gmwd_setup' ) {
167
- require_once( 'google-maps-setup.php' );
168
  }
169
- if ($page == 'gmwd_preview' ) {
170
- require_once( 'preview.php' );
171
  }
172
  include_once(GMWD_DIR . '/notices/gmwd-notices.php');
173
 
174
  }
175
-
176
  // Admin styles
177
  public function gmwd_styles() {
178
  $page = GMWDHelper::get('page') ? GMWDHelper::get('page') : "maps_gmwd" ;
@@ -180,17 +180,17 @@ class GMWDAdmin{
180
  if( $page == "maps_gmwd" || $page == "markercategories_gmwd" || $page == "themes_gmwd" || $page == "options_gmwd" || $page == "markers_gmwd" || $page == "circles_gmwd" || $page == "rectangles_gmwd" || $page == "polygons_gmwd" || $page == "polylines_gmwd" || $page == "uninstall_gmwd" || $page == "shortcode_gmwd" ){
181
  wp_enqueue_style( 'gmwd_admin_main-css', GMWD_URL . '/css/admin_main.css', array(), self::$version);
182
  wp_enqueue_style( 'gmwd_simple_slider-css', GMWD_URL . '/css/simple-slider.css', array(), self::$version);
183
- }
184
-
185
- }
186
-
187
  // Admin scripts
188
  public function gmwd_scripts() {
189
 
190
  wp_enqueue_script('thickbox');
191
  wp_enqueue_script( 'gmwd_admin_main-js', GMWD_URL . '/js/admin_main.js');
192
  global $wpdb, $wp_scripts;
193
-
194
  $map_api_url = "https://maps.googleapis.com/maps/api/js?libraries=places,geometry&sensor=false&v=3.exp";
195
 
196
  if(gmwd_get_option("map_language")){
@@ -213,53 +213,53 @@ class GMWDAdmin{
213
  wp_enqueue_script('jquery');
214
  wp_enqueue_script('jquery-ui-tooltip');
215
  wp_enqueue_media();
216
-
217
  $page = GMWDHelper::get('page') ? GMWDHelper::get('page') : "maps_gmwd" ;
218
  if($page == "markers_gmwd" || ($page == "maps_gmwd" && GMWDHelper::get('task') == "edit") || $page == "polygons_gmwd" || $page == "polylines_gmwd" || $page == "options_gmwd" ){
219
  wp_enqueue_script('gmwd_jscolor-js', GMWD_URL . '/js/jscolor/jscolor.js', array(), true );
220
- wp_enqueue_script( 'gmwd_simple_slider-js', GMWD_URL . '/js/simple-slider.js', array(), true);
221
  wp_enqueue_script($page.'-js', GMWD_URL . '/js/'.$page.'.js' , array(), self::$version, false);
222
  }
223
-
224
  if($page == "maps_gmwd" && GMWDHelper::get('task') == "edit"){
225
  wp_enqueue_script( 'gmwd_init_map_admin-js', GMWD_URL . '/js/init_map_admin.js', array(), self::$version, false);
226
 
227
  }
228
 
229
- }
230
-
231
  // Add pagination to map admin pages.
232
  public function gmwd_maps_per_page_option(){
233
- $option = 'per_page';
234
  $args_maps = array(
235
  'label' => __('Maps',"gmwd"),
236
  'default' => 20,
237
  'option' => 'gmwd_maps_per_page'
238
  );
239
- add_screen_option( $option, $args_maps );
240
  }
241
 
242
  public function gmwd_markercategories_per_page_option(){
243
- $option = 'per_page';
244
  $args_markercategories = array(
245
  'label' => __('Marker Categories',"gmwd"),
246
  'default' => 20,
247
  'option' => 'gmwd_markercategories_per_page'
248
  );
249
- add_screen_option( $option, $args_markercategories );
250
  }
251
 
252
  public function gmwd_themes_per_page_option(){
253
- $option = 'per_page';
254
  $args_themes = array(
255
  'label' => __('Themes',"gmwd"),
256
  'default' => 20,
257
  'option' => 'gmwd_themes_per_page'
258
  );
259
- add_screen_option( $option, $args_themes );
260
- }
261
-
262
-
263
  public function gmwd_set_option_maps($status, $option, $value) {
264
  if ( 'gmwd_maps_per_page' == $option ) return $value;
265
  return $status;
@@ -273,7 +273,7 @@ class GMWDAdmin{
273
  return $status;
274
  }
275
 
276
-
277
  public function gmwd_admin_ajax() {
278
  ?>
279
  <script>
@@ -292,32 +292,32 @@ class GMWDAdmin{
292
  $url = GMWD_URL . '/js/gmwd_editor_button.js';
293
  $plugin_array["gmwd_mce"] = $url;
294
  return $plugin_array;
295
- }
296
-
297
  public function gmwd_featured_plugins(){
298
  require_once(GMWD_DIR . '/featured/featured.php');
299
  wp_register_style('gmwd_featured', GMWD_URL . '/featured/style.css', array(), array($this,"gmwd_version"));
300
  wp_print_styles('gmwd_featured');
301
- spider_featured('wd-google-maps');
302
  }
303
-
304
  public function gmwd_featured_themes(){
305
  require_once(GMWD_DIR . '/featured/featured_themes.php');
306
  wp_register_style('gmwd_featured_themes', GMWD_URL . '/featured/themes_style.css', array(), array($this,"gmwd_version"));
307
  wp_print_styles('gmwd_featured_themes');
308
- spider_featured_themes('wd-google-maps');
309
  }
310
-
311
  public function gmwd_addons(){
312
  require_once(GMWD_DIR . '/addons/addons.php');
313
  wp_register_style('gmwd_addons', GMWD_URL . '/addons/style.css', array(), array($this,"gmwd_version"));
314
  wp_print_styles('gmwd_addons');
315
  gmwd_addons_display();
316
 
317
- }
318
  ////////////////////////////////////////////////////////////////////////////////////////
319
  // Listeners //
320
- ////////////////////////////////////////////////////////////////////////////////////////
321
 
322
  }
323
 
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
+ private static $version = '1.0.19';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
18
  public function __construct() {
19
+
20
  // Includes
21
  add_action('init', array($this, 'gmwd_includes'));
22
+
23
+
24
  // Add menu
25
+ add_action('admin_menu', array($this,'gmwd_options_panel'));
26
  add_action('admin_init', array($this,'setup_redirect'));
27
+
28
+ //Screen options
29
  add_filter('set-screen-option', array($this, 'gmwd_set_option_maps'), 10, 3);
30
  add_filter('set-screen-option', array($this, 'gmwd_set_option_markercategories'), 10, 3);
31
  add_filter('set-screen-option', array($this, 'gmwd_set_option_themes'), 10, 3);
32
  add_filter('set-screen-option', array($this, 'gmwd_set_option_mapstyles'), 10, 3);
33
+
34
  // Add admin styles and scripts
35
  add_action('admin_enqueue_scripts', array($this, 'gmwd_styles'));
36
  add_action('admin_enqueue_scripts', array($this, 'gmwd_scripts'));
37
+
38
  // Add shortcode
39
  add_action('admin_head', array($this,'gmwd_admin_ajax'));
40
  add_action('wp_ajax_gmwd_shortcode', array('GMWDAdmin', 'gmwd_ajax'));
41
+
42
  add_filter('mce_buttons', array($this, 'gmwd_add_button'), 0);
43
+ add_filter('mce_external_plugins', array($this, 'gmwd_register'));
44
+
45
  // Ajax
46
  add_action('wp_ajax_select_parent_category', array('GMWDAdmin', 'gmwd_ajax'));
47
  add_action('wp_ajax_remove_poi', array('GMWDAdmin', 'gmwd_ajax'));
50
  add_action('wp_ajax_export', array('GMWDAdmin', 'gmwd_ajax'));
51
  add_action('wp_ajax_import', array('GMWDAdmin', 'gmwd_ajax'));
52
  add_action('wp_ajax_view_maps_pois', array('GMWDAdmin', 'gmwd_ajax'));
53
+
54
+
55
  add_action('wp_ajax_map_data', array('GMWDAdmin', 'gmwd_ajax'));
56
+
57
  }
58
  ////////////////////////////////////////////////////////////////////////////////////////
59
  // Public Methods //
60
  ////////////////////////////////////////////////////////////////////////////////////////
61
 
62
+
63
  public static function gmwd_activate() {
64
 
65
  require_once(GMWD_DIR . '/sql/sql.php');
74
  if ($version && version_compare($version, self::$version, '<')) {
75
  require_once GMWD_DIR . "/update/gmwd_update.php";
76
  gmwd_update($version);
77
+ update_option("gmwd_version", self::$version);
78
  }
79
  else {
80
+ add_option("gmwd_version", self::$version, '', 'no');
81
  }
82
+
83
  add_option('gmwd_do_activation_set_up_redirect', 1);
84
  add_option('gmwd_download_markers', 0);
85
 
86
+ }
87
+
88
+
89
  // Return an instance of this class.
90
+
91
  public static function gmwd_get_instance() {
92
  if (null == self::$instance) {
93
  self::$instance = new self;
94
  }
95
  return self::$instance;
96
+ }
97
+
98
  ////////////////////////////////////////////////////////////////////////////////////////
99
  // Getters & Setters //
100
  ////////////////////////////////////////////////////////////////////////////////////////
104
 
105
  public function setup_redirect() {
106
  if (get_option('gmwd_do_activation_set_up_redirect')) {
107
+ update_option('gmwd_do_activation_set_up_redirect',0);
108
+ wp_safe_redirect( admin_url( 'index.php?page=gmwd_setup' ) );
109
  exit;
110
  }
111
  }
115
 
116
  $gmwd_page = add_submenu_page('maps_gmwd', __('Maps','gmwd'), __('Maps','gmwd'), 'manage_options', 'maps_gmwd', array($this,'gmwd'));
117
  add_action('load-' . $gmwd_page, array($this,'gmwd_maps_per_page_option'));
118
+
119
  $gmwd_marker_categories_page = add_submenu_page('maps_gmwd', __('Marker Categories','gmwd'), __('Marker Categories','gmwd'), 'manage_options', 'markercategories_gmwd', array($this,'gmwd'));
120
  add_action('load-' . $gmwd_marker_categories_page, array($this,'gmwd_markercategories_per_page_option'));
121
+
122
  $gmwd_themes_page = add_submenu_page('maps_gmwd', __('Themes','gmwd'), __('Themes','gmwd'), 'manage_options', 'themes_gmwd', array($this,'gmwd'));
123
+ add_action('load-' . $gmwd_themes_page, array($this,'gmwd_themes_per_page_option'));
124
+
125
  $gmwd_options_page = add_submenu_page('maps_gmwd', __('Options','gmwd'), __('Options','gmwd'), 'manage_options', 'options_gmwd', array($this,'gmwd'));
126
+ $gmwd_featured_plugins_page = add_submenu_page('maps_gmwd', __('Featured Plugins','gmwd'), __('Featured Plugins','gmwd'), 'manage_options', 'featured_plugins_gmwd', array($this,'gmwd_featured_plugins'));
127
+
128
+ $gmwd_featured_themes_page = add_submenu_page('maps_gmwd', __('Featured Themes','gmwd'), __('Featured Themes','gmwd'), 'manage_options', 'featured_themes_gmwd', array($this,'gmwd_featured_themes'));
129
  $gmwd_uninstall_page = add_submenu_page('maps_gmwd', __('Uninstall','gmwd'), __('Uninstall','gmwd'), 'manage_options', 'uninstall_gmwd', array($this,'gmwd'));
130
+
131
+ add_menu_page(__('Google Maps WD','gmwd'), __('Google Maps WD Add-ons','gmwd'), 'manage_options', 'gmwd_addons', array($this, "gmwd_addons"), GMWD_URL . '/addons/images/add-ons-icon.png',12);
132
+
133
  }
134
 
135
  // Admin main function
136
  public function gmwd() {
137
+
138
+ $page = GMWDHelper::get('page') ? GMWDHelper::get('page') : "maps_gmwd" ;
139
  $controller_class = 'GMWDController' . ucfirst(strtolower($page));
140
  $controller = new $controller_class();
141
  $controller->execute();
145
  check_ajax_referer('nonce_gmwd', 'nonce_gmwd');
146
  $instance = self::gmwd_get_instance();
147
  $page = GMWDHelper::get('page') ? GMWDHelper::get('page') : "maps_gmwd" ;
148
+
149
  $controller_class = 'GMWDController' . ucfirst(strtolower($page));
150
  $controller = new $controller_class();
151
+ $controller->execute();
152
+ }
153
  // Admin includes
154
  public function gmwd_includes(){
155
  require_once(GMWD_DIR . '/framework/GMWDHelper.php');
158
  require_once(GMWD_DIR . '/admin/models/GMWDModel.php');
159
  require_once(GMWD_DIR . '/admin/views/GMWDView.php');
160
  $page = GMWDHelper::get('page') ? GMWDHelper::get('page') : "maps_gmwd" ;
161
+
162
  if( $page == "maps_gmwd" || $page == "markercategories_gmwd" || $page == "themes_gmwd" || $page == "options_gmwd" || $page == "markers_gmwd" || $page == "circles_gmwd" || $page == "rectangles_gmwd" || $page == "polygons_gmwd" || $page == "polylines_gmwd" || $page == "uninstall_gmwd" || $page == "shortcode_gmwd" ){
163
+
164
  require_once(GMWD_DIR . '/admin/controllers/GMWDController' . ucfirst(strtolower($page)) . '.php');
165
  }
166
+ if ($page == 'gmwd_setup' ) {
167
+ require_once( 'google-maps-setup.php' );
168
  }
169
+ if ($page == 'gmwd_preview' ) {
170
+ require_once( 'preview.php' );
171
  }
172
  include_once(GMWD_DIR . '/notices/gmwd-notices.php');
173
 
174
  }
175
+
176
  // Admin styles
177
  public function gmwd_styles() {
178
  $page = GMWDHelper::get('page') ? GMWDHelper::get('page') : "maps_gmwd" ;
180
  if( $page == "maps_gmwd" || $page == "markercategories_gmwd" || $page == "themes_gmwd" || $page == "options_gmwd" || $page == "markers_gmwd" || $page == "circles_gmwd" || $page == "rectangles_gmwd" || $page == "polygons_gmwd" || $page == "polylines_gmwd" || $page == "uninstall_gmwd" || $page == "shortcode_gmwd" ){
181
  wp_enqueue_style( 'gmwd_admin_main-css', GMWD_URL . '/css/admin_main.css', array(), self::$version);
182
  wp_enqueue_style( 'gmwd_simple_slider-css', GMWD_URL . '/css/simple-slider.css', array(), self::$version);
183
+ }
184
+
185
+ }
186
+
187
  // Admin scripts
188
  public function gmwd_scripts() {
189
 
190
  wp_enqueue_script('thickbox');
191
  wp_enqueue_script( 'gmwd_admin_main-js', GMWD_URL . '/js/admin_main.js');
192
  global $wpdb, $wp_scripts;
193
+
194
  $map_api_url = "https://maps.googleapis.com/maps/api/js?libraries=places,geometry&sensor=false&v=3.exp";
195
 
196
  if(gmwd_get_option("map_language")){
213
  wp_enqueue_script('jquery');
214
  wp_enqueue_script('jquery-ui-tooltip');
215
  wp_enqueue_media();
216
+
217
  $page = GMWDHelper::get('page') ? GMWDHelper::get('page') : "maps_gmwd" ;
218
  if($page == "markers_gmwd" || ($page == "maps_gmwd" && GMWDHelper::get('task') == "edit") || $page == "polygons_gmwd" || $page == "polylines_gmwd" || $page == "options_gmwd" ){
219
  wp_enqueue_script('gmwd_jscolor-js', GMWD_URL . '/js/jscolor/jscolor.js', array(), true );
220
+ wp_enqueue_script( 'gmwd_simple_slider-js', GMWD_URL . '/js/simple-slider.js', array(), true);
221
  wp_enqueue_script($page.'-js', GMWD_URL . '/js/'.$page.'.js' , array(), self::$version, false);
222
  }
223
+
224
  if($page == "maps_gmwd" && GMWDHelper::get('task') == "edit"){
225
  wp_enqueue_script( 'gmwd_init_map_admin-js', GMWD_URL . '/js/init_map_admin.js', array(), self::$version, false);
226
 
227
  }
228
 
229
+ }
230
+
231
  // Add pagination to map admin pages.
232
  public function gmwd_maps_per_page_option(){
233
+ $option = 'per_page';
234
  $args_maps = array(
235
  'label' => __('Maps',"gmwd"),
236
  'default' => 20,
237
  'option' => 'gmwd_maps_per_page'
238
  );
239
+ add_screen_option( $option, $args_maps );
240
  }
241
 
242
  public function gmwd_markercategories_per_page_option(){
243
+ $option = 'per_page';
244
  $args_markercategories = array(
245
  'label' => __('Marker Categories',"gmwd"),
246
  'default' => 20,
247
  'option' => 'gmwd_markercategories_per_page'
248
  );
249
+ add_screen_option( $option, $args_markercategories );
250
  }
251
 
252
  public function gmwd_themes_per_page_option(){
253
+ $option = 'per_page';
254
  $args_themes = array(
255
  'label' => __('Themes',"gmwd"),
256
  'default' => 20,
257
  'option' => 'gmwd_themes_per_page'
258
  );
259
+ add_screen_option( $option, $args_themes );
260
+ }
261
+
262
+
263
  public function gmwd_set_option_maps($status, $option, $value) {
264
  if ( 'gmwd_maps_per_page' == $option ) return $value;
265
  return $status;
273
  return $status;
274
  }
275
 
276
+
277
  public function gmwd_admin_ajax() {
278
  ?>
279
  <script>
292
  $url = GMWD_URL . '/js/gmwd_editor_button.js';
293
  $plugin_array["gmwd_mce"] = $url;
294
  return $plugin_array;
295
+ }
296
+
297
  public function gmwd_featured_plugins(){
298
  require_once(GMWD_DIR . '/featured/featured.php');
299
  wp_register_style('gmwd_featured', GMWD_URL . '/featured/style.css', array(), array($this,"gmwd_version"));
300
  wp_print_styles('gmwd_featured');
301
+ spider_featured('wd-google-maps');
302
  }
303
+
304
  public function gmwd_featured_themes(){
305
  require_once(GMWD_DIR . '/featured/featured_themes.php');
306
  wp_register_style('gmwd_featured_themes', GMWD_URL . '/featured/themes_style.css', array(), array($this,"gmwd_version"));
307
  wp_print_styles('gmwd_featured_themes');
308
+ spider_featured_themes('wd-google-maps');
309
  }
310
+
311
  public function gmwd_addons(){
312
  require_once(GMWD_DIR . '/addons/addons.php');
313
  wp_register_style('gmwd_addons', GMWD_URL . '/addons/style.css', array(), array($this,"gmwd_version"));
314
  wp_print_styles('gmwd_addons');
315
  gmwd_addons_display();
316
 
317
+ }
318
  ////////////////////////////////////////////////////////////////////////////////////////
319
  // Listeners //
320
+ ////////////////////////////////////////////////////////////////////////////////////////
321
 
322
  }
323
 
js/init_map.js CHANGED
@@ -16,54 +16,54 @@ var gmwdmapDataOptions = [];
16
  function gmwdInitMainMap(el, excludeOverlays, key){
17
 
18
  gmwdmapData["main_map" + key] = new google.maps.Map(document.getElementById(el), {
19
- center: {lat: gmwdmapData["centerLat" + key], lng: gmwdmapData["centerLng" + key]},
20
  zoom: gmwdmapData["zoom" + key],
21
  maxZoom: gmwdmapData["maxZoom" + key],
22
  minZoom: gmwdmapData["minZoom" + key],
23
  scrollwheel: gmwdmapData["mapWhellScrolling" + key],
24
- draggable: gmwdmapData["mapDragable" + key],
25
- disableDoubleClickZoom: gmwdmapData["mapDbClickZoom" + key],
26
  zoomControl: gmwdmapData["enableZoomControl" + key],
27
  mapTypeControl: gmwdmapData["enableMapTypeControl" + key],
28
  scaleControl: gmwdmapData["enableScaleControl" + key],
29
  streetViewControl: gmwdmapData["enableStreetViewControl" + key],
30
  fullscreenControl: gmwdmapData["enableFullscreenControl" + key],
31
- rotateControl: gmwdmapData["enableRotateControl" + key],
32
  zoomControlOptions:{
33
- position: gmwdmapData["zoomControlPosition" + key]
34
  },
35
  mapTypeControlOptions:{
36
  position: gmwdmapData["mapTypeControlPosition" + key],
37
  style: gmwdmapData["mapTypeControlStyle" + key]
38
- },
39
  fullscreenControlOptions:{
40
- position: gmwdmapData["fullscreenControlPosition" + key]
41
- },
42
  streetViewControlOptions:{
43
- position: gmwdmapData["streetViewControlPosition" + key]
44
  },
45
-
46
- });
47
  gmwdmapData["main_map" + key].setTilt(45);
48
  gmwdSetMapTypeId(key);
49
-
50
 
51
- //themes
 
52
  jQuery("#wd-map" + key).css("border-radius", gmwdmapData["mapBorderRadius" + key] + "px");
53
-
54
-
55
  //layers
56
  gmwdSetLayers("bike", key);
57
  gmwdSetLayers("traffic", key);
58
  gmwdSetLayers("transit", key);
59
-
60
  if(excludeOverlays == false){
61
  // overlays
62
  gmwdSetMapMarkers(key);
63
  gmwdSetMapPolygons(key);
64
  gmwdSetMapPolylines(key);
65
  }
66
-
67
  }
68
 
69
  function gmwdSetMapMarkers(_key){
@@ -76,39 +76,39 @@ function gmwdSetMapMarkers(_key){
76
  position: {lat: Number(mapMarker.lat), lng: Number(mapMarker.lng)}
77
  });
78
  gmwdmapData["allMarkers" + _key].push(marker);
79
-
80
  var infoWindow;
81
  if(mapMarker.enable_info_window == 1){
82
  contentString = mapMarker.pic_url ? '<img src="' + mapMarker.pic_url + '" style="float:right; margin-left: 10px; max-width:100px">' : '';
83
- contentString += (mapMarker.title || mapMarker.address) ;
84
 
85
  infoWindow = new google.maps.InfoWindow({
86
  content: contentString,
87
  disableAutoPan: true
88
- });
89
  if(mapMarker.info_window_open == 1){
90
  infoWindow.open(gmwdmapData["main_map" + _key], marker);
91
  }
92
  gmwdmapData["infoWindows" + _key].push(infoWindow);
93
  }
94
-
95
  if(mapMarker.title){
96
  marker.setTitle(mapMarker.title);
97
  }
98
-
99
  if(mapMarker.animation == "BOUNCE"){
100
  marker.setAnimation(google.maps.Animation.BOUNCE)
101
  }
102
  else if(mapMarker.animation == "DROP"){
103
  marker.setAnimation(google.maps.Animation.DROP)
104
- }
105
  else{
106
  marker.setAnimation(null);
107
  }
108
-
109
  //events
110
- (function(overlay, row, overlayWindow, map, openEvent, overlayWindows) {
111
-
112
  google.maps.event.addListener(overlay, 'click', function() {
113
  if(row.link_url){
114
  window.open(row.link_url);
@@ -118,23 +118,23 @@ function gmwdSetMapMarkers(_key){
118
  for(var j=0; j < overlayWindows.length; j++){
119
  overlayWindows[j].open(null, null);
120
  }
121
- overlayWindow.open(map, overlay);
122
  }
123
- }
124
  });
125
- google.maps.event.addListener(overlay, 'mouseover', function() {
126
  if(openEvent == "hover"){
127
  if(overlayWindow && row.enable_info_window == 1){
128
  for(var j=0; j < overlayWindows.length; j++){
129
  overlayWindows[j].open(null, null);
130
  }
131
- overlayWindow.open(map, overlay);
132
  }
133
- }
134
  });
135
-
136
  }(marker, mapMarker, infoWindow, gmwdmapData["main_map" + _key], gmwdmapData["infoWindowOpenOn" + _key], gmwdmapData["infoWindows" + _key]));
137
-
138
  }
139
  }
140
 
@@ -152,17 +152,17 @@ function gmwdSetMapPolygons(_key){
152
  polygonData = mapPolygon.data.substr(1, mapPolygon.data.length-4).split("),(");
153
  for(var j=0; j<polygonData.length; j++){
154
  var polygonMarker = polygonData[j].split(",");
155
- if(mapPolygon.show_markers == 1){
156
  var marker = new google.maps.Marker({
157
  map: gmwdmapData["main_map" + _key],
158
  position: {lat: Number(polygonMarker[0]), lng: Number(polygonMarker[1]) }
159
- });
160
  marker.setMap(gmwdmapData["main_map" + _key]);
161
  gmwdmapData["allPolygonMarkers" + _key].push(marker);
162
  }
163
  polygonCoord.push(new google.maps.LatLng( Number(polygonMarker[0]), Number(polygonMarker[1])));
164
  }
165
-
166
  polygon = new google.maps.Polygon({
167
  strokeWeight:Number(mapPolygon.line_width),
168
  strokeColor: "#" + mapPolygon.line_color,
@@ -171,25 +171,25 @@ function gmwdSetMapPolygons(_key){
171
  fillOpacity: Number(mapPolygon.fill_opacity),
172
  paths: polygonCoord,
173
  });
174
-
175
  gmwdmapData["allPolygons" + _key].push(polygon);
176
  //polygon.setMap(gmwdmapData["main_map" + _key]);
177
  var polygonArea = google.maps.geometry.spherical.computeArea(polygon.getPath());
178
- polygonsByAreas[polygonArea] = [polygon];
179
  polygonsAreas.push(polygonArea);
180
- (function(overlay, row, map) {
181
 
182
  google.maps.event.addListener(overlay,"mouseover",function(){
183
  if(row.title){
184
  this.getMap().getDiv().setAttribute('title',row.title);
185
- }
186
  });
187
  google.maps.event.addListener(overlay,"mouseout",function(){
188
- this.getMap().getDiv().removeAttribute('title');
189
  });
190
-
191
- }(polygon, mapPolygon, gmwdmapData["main_map" + _key]));
192
-
193
  }
194
  }
195
  polygonsAreas.sort(function(a,b){return b - a});
@@ -197,13 +197,13 @@ function gmwdSetMapPolygons(_key){
197
  for(var i=0; i< polygonsAreas.length ; i++){
198
  polygonsByAreas[polygonsAreas[i]][0].setMap(gmwdmapData["main_map" + _key]);
199
  polygonsByAreas[polygonsAreas[i]][0].setOptions({zIndex: i+1});
200
-
201
- }
202
-
203
  }
204
 
205
  function gmwdSetMapPolylines(_key){
206
- var mapPolyline, polyline;
207
  if(Object.keys(gmwdmapData["mapPolylines" + _key]).length > 0){
208
  for(var key in gmwdmapData["mapPolylines" + _key]){
209
  var polylineCoord = [];
@@ -211,17 +211,17 @@ function gmwdSetMapPolylines(_key){
211
  polylineData = mapPolyline.data.substr(1, mapPolyline.data.length-4).split("),(");
212
  for(var j=0; j<polylineData.length; j++){
213
  var polylineMarker = polylineData[j].split(",");
214
- if(mapPolyline.show_markers == 1){
215
  var marker = new google.maps.Marker({
216
  map: gmwdmapData["main_map" + _key],
217
  position: {lat: Number(polylineMarker[0]), lng: Number(polylineMarker[1]) }
218
  });
219
- gmwdmapData["allPolylineMarkers" + _key].push(marker);
220
  marker.setMap(gmwdmapData["main_map" + _key]);
221
- }
222
  polylineCoord.push(new google.maps.LatLng( Number(polylineMarker[0]), Number(polylineMarker[1])));
223
  }
224
-
225
  polyline = new google.maps.Polyline({
226
  strokeWeight:Number(mapPolyline.line_width),
227
  strokeColor: "#" + mapPolyline.line_color,
@@ -231,23 +231,23 @@ function gmwdSetMapPolylines(_key){
231
  });
232
  gmwdmapData["allPolylines" + _key].push(polyline);
233
  polyline.setMap(gmwdmapData["main_map" + _key]);
234
-
235
- (function(overlay, row, map) {
236
  google.maps.event.addListener(overlay,"mouseover",function(){
237
  if(row.title){
238
  this.getMap().getDiv().setAttribute('title',row.title);
239
- }
240
  });
241
  google.maps.event.addListener(overlay,"mouseout",function(){
242
- this.getMap().getDiv().removeAttribute('title');
243
- });
244
-
245
- }(polyline, mapPolyline, gmwdmapData["main_map" + _key]));
246
-
247
-
248
  }
249
  }
250
-
251
  }
252
 
253
 
@@ -261,15 +261,15 @@ function gmwdSetMapTypeId(key){
261
  case "0" :
262
  gmwdmapData["main_map" + key].setMapTypeId(google.maps.MapTypeId.ROADMAP);
263
  break;
264
- case "1" :
265
  gmwdmapData["main_map" + key].setMapTypeId(google.maps.MapTypeId.SATELLITE);
266
  break;
267
- case "2":
268
  gmwdmapData["main_map" + key].setMapTypeId(google.maps.MapTypeId.HYBRID);
269
  break;
270
- case "3":
271
  gmwdmapData["main_map" + key].setMapTypeId(google.maps.MapTypeId.TERRAIN);
272
- break;
273
  }
274
  }
275
 
@@ -287,7 +287,7 @@ function gmwdSetLayers(type, key){
287
  }
288
  }
289
  break;
290
- case "traffic" :
291
  if(gmwdmapData["enableTrafficLayer" + key] == 1){
292
  gmwdmapDataOptions["trafficLayer" + key] = new google.maps.TrafficLayer();
293
  gmwdmapDataOptions["trafficLayer" + key].setMap(gmwdmapData["main_map" + key]);
@@ -296,9 +296,9 @@ function gmwdSetLayers(type, key){
296
  if(gmwdmapDataOptions["trafficLayer" + key]){
297
  gmwdmapDataOptions["trafficLayer" + key].setMap(null);
298
  }
299
- }
300
- break;
301
- case "transit" :
302
  if(gmwdmapData["enableTransitLayer" + key] == 1){
303
  gmwdmapDataOptions["transitLayer" + key] = new google.maps.TransitLayer();
304
  gmwdmapDataOptions["transitLayer" + key].setMap(gmwdmapData["main_map" + key]);
@@ -307,8 +307,8 @@ function gmwdSetLayers(type, key){
307
  if(gmwdmapDataOptions["transitLayer" + key]){
308
  gmwdmapDataOptions["transitLayer" + key].setMap(null);
309
  }
310
- }
311
- break;
312
  }
313
  }
314
 
@@ -326,4 +326,4 @@ function gmwdSetLayers(type, key){
326
  ////////////////////////////////////////////////////////////////////////////////////////
327
  ////////////////////////////////////////////////////////////////////////////////////////
328
  // Listeners //
329
- ////////////////////////////////////////////////////////////////////////////////////////
16
  function gmwdInitMainMap(el, excludeOverlays, key){
17
 
18
  gmwdmapData["main_map" + key] = new google.maps.Map(document.getElementById(el), {
19
+ center: {lat: gmwdmapData["centerLat" + key], lng: gmwdmapData["centerLng" + key]},
20
  zoom: gmwdmapData["zoom" + key],
21
  maxZoom: gmwdmapData["maxZoom" + key],
22
  minZoom: gmwdmapData["minZoom" + key],
23
  scrollwheel: gmwdmapData["mapWhellScrolling" + key],
24
+ draggable: gmwdmapData["mapDragable" + key],
25
+ disableDoubleClickZoom: gmwdmapData["mapDbClickZoom" + key],
26
  zoomControl: gmwdmapData["enableZoomControl" + key],
27
  mapTypeControl: gmwdmapData["enableMapTypeControl" + key],
28
  scaleControl: gmwdmapData["enableScaleControl" + key],
29
  streetViewControl: gmwdmapData["enableStreetViewControl" + key],
30
  fullscreenControl: gmwdmapData["enableFullscreenControl" + key],
31
+ rotateControl: gmwdmapData["enableRotateControl" + key],
32
  zoomControlOptions:{
33
+ position: gmwdmapData["zoomControlPosition" + key]
34
  },
35
  mapTypeControlOptions:{
36
  position: gmwdmapData["mapTypeControlPosition" + key],
37
  style: gmwdmapData["mapTypeControlStyle" + key]
38
+ },
39
  fullscreenControlOptions:{
40
+ position: gmwdmapData["fullscreenControlPosition" + key]
41
+ },
42
  streetViewControlOptions:{
43
+ position: gmwdmapData["streetViewControlPosition" + key]
44
  },
45
+
46
+ });
47
  gmwdmapData["main_map" + key].setTilt(45);
48
  gmwdSetMapTypeId(key);
 
49
 
50
+
51
+ //themes
52
  jQuery("#wd-map" + key).css("border-radius", gmwdmapData["mapBorderRadius" + key] + "px");
53
+
54
+
55
  //layers
56
  gmwdSetLayers("bike", key);
57
  gmwdSetLayers("traffic", key);
58
  gmwdSetLayers("transit", key);
59
+
60
  if(excludeOverlays == false){
61
  // overlays
62
  gmwdSetMapMarkers(key);
63
  gmwdSetMapPolygons(key);
64
  gmwdSetMapPolylines(key);
65
  }
66
+
67
  }
68
 
69
  function gmwdSetMapMarkers(_key){
76
  position: {lat: Number(mapMarker.lat), lng: Number(mapMarker.lng)}
77
  });
78
  gmwdmapData["allMarkers" + _key].push(marker);
79
+
80
  var infoWindow;
81
  if(mapMarker.enable_info_window == 1){
82
  contentString = mapMarker.pic_url ? '<img src="' + mapMarker.pic_url + '" style="float:right; margin-left: 10px; max-width:100px">' : '';
83
+ contentString += (mapMarker.title + "<br>" + mapMarker.address) ;
84
 
85
  infoWindow = new google.maps.InfoWindow({
86
  content: contentString,
87
  disableAutoPan: true
88
+ });
89
  if(mapMarker.info_window_open == 1){
90
  infoWindow.open(gmwdmapData["main_map" + _key], marker);
91
  }
92
  gmwdmapData["infoWindows" + _key].push(infoWindow);
93
  }
94
+
95
  if(mapMarker.title){
96
  marker.setTitle(mapMarker.title);
97
  }
98
+
99
  if(mapMarker.animation == "BOUNCE"){
100
  marker.setAnimation(google.maps.Animation.BOUNCE)
101
  }
102
  else if(mapMarker.animation == "DROP"){
103
  marker.setAnimation(google.maps.Animation.DROP)
104
+ }
105
  else{
106
  marker.setAnimation(null);
107
  }
108
+
109
  //events
110
+ (function(overlay, row, overlayWindow, map, openEvent, overlayWindows) {
111
+
112
  google.maps.event.addListener(overlay, 'click', function() {
113
  if(row.link_url){
114
  window.open(row.link_url);
118
  for(var j=0; j < overlayWindows.length; j++){
119
  overlayWindows[j].open(null, null);
120
  }
121
+ overlayWindow.open(map, overlay);
122
  }
123
+ }
124
  });
125
+ google.maps.event.addListener(overlay, 'mouseover', function() {
126
  if(openEvent == "hover"){
127
  if(overlayWindow && row.enable_info_window == 1){
128
  for(var j=0; j < overlayWindows.length; j++){
129
  overlayWindows[j].open(null, null);
130
  }
131
+ overlayWindow.open(map, overlay);
132
  }
133
+ }
134
  });
135
+
136
  }(marker, mapMarker, infoWindow, gmwdmapData["main_map" + _key], gmwdmapData["infoWindowOpenOn" + _key], gmwdmapData["infoWindows" + _key]));
137
+
138
  }
139
  }
140
 
152
  polygonData = mapPolygon.data.substr(1, mapPolygon.data.length-4).split("),(");
153
  for(var j=0; j<polygonData.length; j++){
154
  var polygonMarker = polygonData[j].split(",");
155
+ if(mapPolygon.show_markers == 1){
156
  var marker = new google.maps.Marker({
157
  map: gmwdmapData["main_map" + _key],
158
  position: {lat: Number(polygonMarker[0]), lng: Number(polygonMarker[1]) }
159
+ });
160
  marker.setMap(gmwdmapData["main_map" + _key]);
161
  gmwdmapData["allPolygonMarkers" + _key].push(marker);
162
  }
163
  polygonCoord.push(new google.maps.LatLng( Number(polygonMarker[0]), Number(polygonMarker[1])));
164
  }
165
+
166
  polygon = new google.maps.Polygon({
167
  strokeWeight:Number(mapPolygon.line_width),
168
  strokeColor: "#" + mapPolygon.line_color,
171
  fillOpacity: Number(mapPolygon.fill_opacity),
172
  paths: polygonCoord,
173
  });
174
+
175
  gmwdmapData["allPolygons" + _key].push(polygon);
176
  //polygon.setMap(gmwdmapData["main_map" + _key]);
177
  var polygonArea = google.maps.geometry.spherical.computeArea(polygon.getPath());
178
+ polygonsByAreas[polygonArea] = [polygon];
179
  polygonsAreas.push(polygonArea);
180
+ (function(overlay, row, map) {
181
 
182
  google.maps.event.addListener(overlay,"mouseover",function(){
183
  if(row.title){
184
  this.getMap().getDiv().setAttribute('title',row.title);
185
+ }
186
  });
187
  google.maps.event.addListener(overlay,"mouseout",function(){
188
+ this.getMap().getDiv().removeAttribute('title');
189
  });
190
+
191
+ }(polygon, mapPolygon, gmwdmapData["main_map" + _key]));
192
+
193
  }
194
  }
195
  polygonsAreas.sort(function(a,b){return b - a});
197
  for(var i=0; i< polygonsAreas.length ; i++){
198
  polygonsByAreas[polygonsAreas[i]][0].setMap(gmwdmapData["main_map" + _key]);
199
  polygonsByAreas[polygonsAreas[i]][0].setOptions({zIndex: i+1});
200
+
201
+ }
202
+
203
  }
204
 
205
  function gmwdSetMapPolylines(_key){
206
+ var mapPolyline, polyline;
207
  if(Object.keys(gmwdmapData["mapPolylines" + _key]).length > 0){
208
  for(var key in gmwdmapData["mapPolylines" + _key]){
209
  var polylineCoord = [];
211
  polylineData = mapPolyline.data.substr(1, mapPolyline.data.length-4).split("),(");
212
  for(var j=0; j<polylineData.length; j++){
213
  var polylineMarker = polylineData[j].split(",");
214
+ if(mapPolyline.show_markers == 1){
215
  var marker = new google.maps.Marker({
216
  map: gmwdmapData["main_map" + _key],
217
  position: {lat: Number(polylineMarker[0]), lng: Number(polylineMarker[1]) }
218
  });
219
+ gmwdmapData["allPolylineMarkers" + _key].push(marker);
220
  marker.setMap(gmwdmapData["main_map" + _key]);
221
+ }
222
  polylineCoord.push(new google.maps.LatLng( Number(polylineMarker[0]), Number(polylineMarker[1])));
223
  }
224
+
225
  polyline = new google.maps.Polyline({
226
  strokeWeight:Number(mapPolyline.line_width),
227
  strokeColor: "#" + mapPolyline.line_color,
231
  });
232
  gmwdmapData["allPolylines" + _key].push(polyline);
233
  polyline.setMap(gmwdmapData["main_map" + _key]);
234
+
235
+ (function(overlay, row, map) {
236
  google.maps.event.addListener(overlay,"mouseover",function(){
237
  if(row.title){
238
  this.getMap().getDiv().setAttribute('title',row.title);
239
+ }
240
  });
241
  google.maps.event.addListener(overlay,"mouseout",function(){
242
+ this.getMap().getDiv().removeAttribute('title');
243
+ });
244
+
245
+ }(polyline, mapPolyline, gmwdmapData["main_map" + _key]));
246
+
247
+
248
  }
249
  }
250
+
251
  }
252
 
253
 
261
  case "0" :
262
  gmwdmapData["main_map" + key].setMapTypeId(google.maps.MapTypeId.ROADMAP);
263
  break;
264
+ case "1" :
265
  gmwdmapData["main_map" + key].setMapTypeId(google.maps.MapTypeId.SATELLITE);
266
  break;
267
+ case "2":
268
  gmwdmapData["main_map" + key].setMapTypeId(google.maps.MapTypeId.HYBRID);
269
  break;
270
+ case "3":
271
  gmwdmapData["main_map" + key].setMapTypeId(google.maps.MapTypeId.TERRAIN);
272
+ break;
273
  }
274
  }
275
 
287
  }
288
  }
289
  break;
290
+ case "traffic" :
291
  if(gmwdmapData["enableTrafficLayer" + key] == 1){
292
  gmwdmapDataOptions["trafficLayer" + key] = new google.maps.TrafficLayer();
293
  gmwdmapDataOptions["trafficLayer" + key].setMap(gmwdmapData["main_map" + key]);
296
  if(gmwdmapDataOptions["trafficLayer" + key]){
297
  gmwdmapDataOptions["trafficLayer" + key].setMap(null);
298
  }
299
+ }
300
+ break;
301
+ case "transit" :
302
  if(gmwdmapData["enableTransitLayer" + key] == 1){
303
  gmwdmapDataOptions["transitLayer" + key] = new google.maps.TransitLayer();
304
  gmwdmapDataOptions["transitLayer" + key].setMap(gmwdmapData["main_map" + key]);
307
  if(gmwdmapDataOptions["transitLayer" + key]){
308
  gmwdmapDataOptions["transitLayer" + key].setMap(null);
309
  }
310
+ }
311
+ break;
312
  }
313
  }
314
 
326
  ////////////////////////////////////////////////////////////////////////////////////////
327
  ////////////////////////////////////////////////////////////////////////////////////////
328
  // Listeners //
329
+ ////////////////////////////////////////////////////////////////////////////////////////
js/init_map_admin.js CHANGED
@@ -21,40 +21,40 @@ var fusionTablesLayer;
21
  function gmwdInitMainMap(el, excludeOverlays){
22
 
23
  map = new google.maps.Map(document.getElementById(el), {
24
- center: {lat: centerLat, lng: centerLng},
25
  zoom: zoom,
26
  maxZoom: maxZoom,
27
  minZoom: minZoom,
28
  scrollwheel: mapWhellScrolling,
29
  draggable: mapDragable,
30
- disableDoubleClickZoom: mapDbClickZoom,
31
  zoomControl: enableZoomControl,
32
  mapTypeControl: enableMapTypeControl,
33
  scaleControl: enableScaleControl,
34
  streetViewControl: enableStreetViewControl,
35
  fullscreenControl: enableFullscreenControl,
36
- rotateControl: enableRotateControl,
37
  zoomControlOptions:{
38
- position: zoomControlPosition
39
  },
40
  mapTypeControlOptions:{
41
  position: mapTypeControlPosition,
42
  style: mapTypeControlStyle
43
- },
44
  fullscreenControlOptions:{
45
- position: fullscreenControlPosition
46
- },
47
  streetViewControlOptions:{
48
- position: streetViewControlPosition
49
- }
50
- });
51
  map.setTilt(45);
52
 
53
  gmwdSetMapTypeId();
54
 
55
  //themes
56
  jQuery("#wd-map3, #wd-map").css("border-radius", mapBorderRadius + "px");
57
-
58
  //layers
59
  gmwdSetLayers("bike");
60
  gmwdSetLayers("traffic");
@@ -68,40 +68,40 @@ function gmwdInitMainMap(el, excludeOverlays){
68
  }
69
  if(el == "wd-map3" || el == "wd-map"){
70
  // map events
71
- google.maps.event.addListener(map, 'drag', function(event) {
72
  var mapCenter = map.getCenter();
73
  jQuery("#center_lat").val(mapCenter.lat());
74
  jQuery("#center_lng").val(mapCenter.lng());
75
  getAddressFromLatLng(mapCenter.lat(), mapCenter.lng(), "address", false);
76
- // map.setCenter({lat:Number(mapCenter.lat()), lng:Number(mapCenter.lng())});
77
  });
78
-
79
- google.maps.event.addListener(map, 'zoom_changed', function(event) {
80
  zoom = map.getZoom();
81
- jQuery("#zoom_level").val(zoom);
82
- // map.setZoom(zoom);
83
  });
84
- }
85
  if(el == "wd-map3"){
86
  google.maps.event.addListener(map, 'rightclick', function(event) {
87
  var geocoder = new google.maps.Geocoder();
88
- geocoder.geocode({
89
- latLng: new google.maps.LatLng(event.latLng.lat(), event.latLng.lng())
90
- },
91
- function(responses) {
92
- if (responses && responses.length > 0) {
93
- jQuery("#address").val(responses[0].formatted_address);
94
  jQuery("#center_lat").val( event.latLng.lat());
95
  jQuery("#center_lng").val( event.latLng.lng());
96
- map.setCenter(event.latLng);
97
- }
98
  });
99
-
100
  });
101
 
102
  }
103
-
104
-
105
  }
106
 
107
 
@@ -114,22 +114,22 @@ function gmwdSetMapMarkers(){
114
  mapMarker = mapMarkers[key];
115
  if(mapMarker.published == 0){
116
  continue;
117
- }
118
  var marker = new google.maps.Marker({
119
  map: map,
120
  position: {lat: Number(mapMarker.lat), lng: Number(mapMarker.lng)}
121
  });
122
-
123
  allMarkers.push(marker);
124
  var infoWindow;
125
  if(mapMarker.enable_info_window == 1){
126
 
127
- contentString = (mapMarker.title || mapMarker.address);
128
 
129
  infoWindow = new google.maps.InfoWindow({
130
  content: contentString,
131
  disableAutoPan: true
132
- });
133
  if(mapMarker.info_window_open == 1){
134
  infoWindow.open(map, marker);
135
  }
@@ -144,37 +144,37 @@ function gmwdSetMapMarkers(){
144
  }
145
  else if(mapMarker.animation == "DROP"){
146
  marker.setAnimation(google.maps.Animation.DROP)
147
- }
148
  else{
149
  marker.setAnimation(null);
150
  }
151
-
152
  //events
153
- (function(overlay, row, overlayWindow, map, overlayWindows) {
154
-
155
  google.maps.event.addListener(overlay, 'click', function() {
156
  if(jQuery("#info_window_open_on :selected").val() == "click"){
157
  if(overlayWindow && row.enable_info_window == 1){
158
  for(var j=0; j < overlayWindows.length; j++){
159
  overlayWindows[j].open(null, null);
160
  }
161
- overlayWindow.open(map, overlay);
162
  }
163
- }
164
  });
165
- google.maps.event.addListener(overlay, 'mouseover', function() {
166
  if(jQuery("#info_window_open_on :selected").val() == "hover"){
167
  if(overlayWindow && row.enable_info_window == 1){
168
  for(var j=0; j < overlayWindows.length; j++){
169
  overlayWindows[j].open(null, null);
170
  }
171
- overlayWindow.open(map, overlay);
172
  }
173
- }
174
  });
175
-
176
- }(marker, mapMarker, infoWindow, map, infoWindows));
177
-
178
  }
179
 
180
  }
@@ -183,7 +183,7 @@ function gmwdSetMapMarkers(){
183
  var allPolygons = [];
184
  var allPolygonMarkers = [];
185
  function gmwdSetMapPolygons(){
186
- var mapPolygon, polygon;
187
  var polygonsByAreas = {};
188
  var polygonsAreas = [];
189
  for(var key in mapPolygons){
@@ -195,7 +195,7 @@ function gmwdSetMapPolygons(){
195
  polygonData = mapPolygon.data.substr(1, mapPolygon.data.length-4).split("),(");
196
  for(var j=0; j<polygonData.length; j++){
197
  var polygonMarker = polygonData[j].split(",");
198
- if(mapPolygon.show_markers == 1){
199
  var marker = new google.maps.Marker({
200
  map: map,
201
  position: {lat: Number(polygonMarker[0]), lng: Number(polygonMarker[1]) }
@@ -206,7 +206,7 @@ function gmwdSetMapPolygons(){
206
 
207
  polygonCoord.push(new google.maps.LatLng( Number(polygonMarker[0]), Number(polygonMarker[1])));
208
  }
209
-
210
  polygon = new google.maps.Polygon({
211
  strokeWeight:Number(mapPolygon.line_width),
212
  strokeColor: "#" + mapPolygon.line_color,
@@ -215,41 +215,41 @@ function gmwdSetMapPolygons(){
215
  fillOpacity: Number(mapPolygon.fill_opacity),
216
  paths: polygonCoord,
217
  });
218
-
219
  allPolygons.push(polygon);
220
  var polygonArea = google.maps.geometry.spherical.computeArea(polygon.getPath());
221
- polygonsByAreas[polygonArea] = [polygon];
222
- polygonsAreas.push(polygonArea);
223
  //polygon.setMap(map);
224
-
225
  (function(overlay, row, map) {
226
-
227
  google.maps.event.addListener(overlay,"mouseover",function(){
228
  if(row.title){
229
  this.getMap().getDiv().setAttribute('title',row.title);
230
- }
231
  });
232
  google.maps.event.addListener(overlay,"mouseout",function(){
233
- this.getMap().getDiv().removeAttribute('title');
234
- });
235
-
236
- }(polygon, mapPolygon, map));
237
-
238
  }
239
  polygonsAreas.sort(function(a,b){return b - a});
240
 
241
  for(var i=0; i< polygonsAreas.length ; i++){
242
  polygonsByAreas[polygonsAreas[i]][0].setMap(map);
243
- polygonsByAreas[polygonsAreas[i]][0].setOptions({zIndex: i+1});
244
- }
245
-
246
  }
247
 
248
 
249
  var allPolylines = [];
250
  var allPolylineMarkers = [];
251
  function gmwdSetMapPolylines(){
252
- var mapPolyline, polyline;
253
 
254
  for(var key in mapPolylines){
255
  var polylineCoord = [];
@@ -260,17 +260,17 @@ function gmwdSetMapPolylines(){
260
  polylineData = mapPolyline.data.substr(1, mapPolyline.data.length-4).split("),(");
261
  for(var j=0; j<polylineData.length; j++){
262
  var polylineMarker = polylineData[j].split(",");
263
- if(mapPolyline.show_markers == 1){
264
  var marker = new google.maps.Marker({
265
  map: map,
266
  position: {lat: Number(polylineMarker[0]), lng: Number(polylineMarker[1]) }
267
- });
268
  allPolylineMarkers.push(marker);
269
 
270
  }
271
  polylineCoord.push(new google.maps.LatLng( Number(polylineMarker[0]), Number(polylineMarker[1])));
272
  }
273
-
274
  polyline = new google.maps.Polyline({
275
  strokeWeight:Number(mapPolyline.line_width),
276
  strokeColor: "#" + mapPolyline.line_color,
@@ -281,21 +281,21 @@ function gmwdSetMapPolylines(){
281
 
282
  allPolylines.push(polyline);
283
  polyline.setMap(map);
284
-
285
- (function(overlay, row, map) {
286
-
287
  google.maps.event.addListener(overlay,"mouseover",function(){
288
  if(row.title){
289
  this.getMap().getDiv().setAttribute('title',row.title);
290
- }
291
  });
292
  google.maps.event.addListener(overlay,"mouseout",function(){
293
- this.getMap().getDiv().removeAttribute('title');
294
- });
295
-
296
- }(polyline, mapPolyline, map));
297
-
298
-
299
  }
300
 
301
  }
@@ -311,15 +311,15 @@ function gmwdSetMapTypeId(){
311
  case "0" :
312
  map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
313
  break;
314
- case "1" :
315
  map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
316
  break;
317
- case "2":
318
  map.setMapTypeId(google.maps.MapTypeId.HYBRID);
319
  break;
320
- case "3":
321
  map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
322
- break;
323
  }
324
  }
325
 
@@ -337,7 +337,7 @@ function gmwdSetLayers(type){
337
  }
338
  }
339
  break;
340
- case "traffic" :
341
  if(enableTrafficLayer == 1){
342
  trafficLayer = new google.maps.TrafficLayer();
343
  trafficLayer.setMap(map);
@@ -346,9 +346,9 @@ function gmwdSetLayers(type){
346
  if(trafficLayer){
347
  trafficLayer.setMap(null);
348
  }
349
- }
350
- break;
351
- case "transit" :
352
  if(enableTransitLayer == 1){
353
  transitLayer = new google.maps.TransitLayer();
354
  transitLayer.setMap(map);
@@ -357,8 +357,8 @@ function gmwdSetLayers(type){
357
  if(transitLayer){
358
  transitLayer.setMap(null);
359
  }
360
- }
361
- break;
362
  }
363
  }
364
 
@@ -374,4 +374,4 @@ function gmwdSetLayers(type){
374
  ////////////////////////////////////////////////////////////////////////////////////////
375
  ////////////////////////////////////////////////////////////////////////////////////////
376
  // Listeners //
377
- ////////////////////////////////////////////////////////////////////////////////////////
21
  function gmwdInitMainMap(el, excludeOverlays){
22
 
23
  map = new google.maps.Map(document.getElementById(el), {
24
+ center: {lat: centerLat, lng: centerLng},
25
  zoom: zoom,
26
  maxZoom: maxZoom,
27
  minZoom: minZoom,
28
  scrollwheel: mapWhellScrolling,
29
  draggable: mapDragable,
30
+ disableDoubleClickZoom: mapDbClickZoom,
31
  zoomControl: enableZoomControl,
32
  mapTypeControl: enableMapTypeControl,
33
  scaleControl: enableScaleControl,
34
  streetViewControl: enableStreetViewControl,
35
  fullscreenControl: enableFullscreenControl,
36
+ rotateControl: enableRotateControl,
37
  zoomControlOptions:{
38
+ position: zoomControlPosition
39
  },
40
  mapTypeControlOptions:{
41
  position: mapTypeControlPosition,
42
  style: mapTypeControlStyle
43
+ },
44
  fullscreenControlOptions:{
45
+ position: fullscreenControlPosition
46
+ },
47
  streetViewControlOptions:{
48
+ position: streetViewControlPosition
49
+ }
50
+ });
51
  map.setTilt(45);
52
 
53
  gmwdSetMapTypeId();
54
 
55
  //themes
56
  jQuery("#wd-map3, #wd-map").css("border-radius", mapBorderRadius + "px");
57
+
58
  //layers
59
  gmwdSetLayers("bike");
60
  gmwdSetLayers("traffic");
68
  }
69
  if(el == "wd-map3" || el == "wd-map"){
70
  // map events
71
+ google.maps.event.addListener(map, 'drag', function(event) {
72
  var mapCenter = map.getCenter();
73
  jQuery("#center_lat").val(mapCenter.lat());
74
  jQuery("#center_lng").val(mapCenter.lng());
75
  getAddressFromLatLng(mapCenter.lat(), mapCenter.lng(), "address", false);
76
+ // map.setCenter({lat:Number(mapCenter.lat()), lng:Number(mapCenter.lng())});
77
  });
78
+
79
+ google.maps.event.addListener(map, 'zoom_changed', function(event) {
80
  zoom = map.getZoom();
81
+ jQuery("#zoom_level").val(zoom);
82
+ // map.setZoom(zoom);
83
  });
84
+ }
85
  if(el == "wd-map3"){
86
  google.maps.event.addListener(map, 'rightclick', function(event) {
87
  var geocoder = new google.maps.Geocoder();
88
+ geocoder.geocode({
89
+ latLng: new google.maps.LatLng(event.latLng.lat(), event.latLng.lng())
90
+ },
91
+ function(responses) {
92
+ if (responses && responses.length > 0) {
93
+ jQuery("#address").val(responses[0].formatted_address);
94
  jQuery("#center_lat").val( event.latLng.lat());
95
  jQuery("#center_lng").val( event.latLng.lng());
96
+ map.setCenter(event.latLng);
97
+ }
98
  });
99
+
100
  });
101
 
102
  }
103
+
104
+
105
  }
106
 
107
 
114
  mapMarker = mapMarkers[key];
115
  if(mapMarker.published == 0){
116
  continue;
117
+ }
118
  var marker = new google.maps.Marker({
119
  map: map,
120
  position: {lat: Number(mapMarker.lat), lng: Number(mapMarker.lng)}
121
  });
122
+
123
  allMarkers.push(marker);
124
  var infoWindow;
125
  if(mapMarker.enable_info_window == 1){
126
 
127
+ contentString = (mapMarker.title + "<br>" + mapMarker.address);
128
 
129
  infoWindow = new google.maps.InfoWindow({
130
  content: contentString,
131
  disableAutoPan: true
132
+ });
133
  if(mapMarker.info_window_open == 1){
134
  infoWindow.open(map, marker);
135
  }
144
  }
145
  else if(mapMarker.animation == "DROP"){
146
  marker.setAnimation(google.maps.Animation.DROP)
147
+ }
148
  else{
149
  marker.setAnimation(null);
150
  }
151
+
152
  //events
153
+ (function(overlay, row, overlayWindow, map, overlayWindows) {
154
+
155
  google.maps.event.addListener(overlay, 'click', function() {
156
  if(jQuery("#info_window_open_on :selected").val() == "click"){
157
  if(overlayWindow && row.enable_info_window == 1){
158
  for(var j=0; j < overlayWindows.length; j++){
159
  overlayWindows[j].open(null, null);
160
  }
161
+ overlayWindow.open(map, overlay);
162
  }
163
+ }
164
  });
165
+ google.maps.event.addListener(overlay, 'mouseover', function() {
166
  if(jQuery("#info_window_open_on :selected").val() == "hover"){
167
  if(overlayWindow && row.enable_info_window == 1){
168
  for(var j=0; j < overlayWindows.length; j++){
169
  overlayWindows[j].open(null, null);
170
  }
171
+ overlayWindow.open(map, overlay);
172
  }
173
+ }
174
  });
175
+
176
+ }(marker, mapMarker, infoWindow, map, infoWindows));
177
+
178
  }
179
 
180
  }
183
  var allPolygons = [];
184
  var allPolygonMarkers = [];
185
  function gmwdSetMapPolygons(){
186
+ var mapPolygon, polygon;
187
  var polygonsByAreas = {};
188
  var polygonsAreas = [];
189
  for(var key in mapPolygons){
195
  polygonData = mapPolygon.data.substr(1, mapPolygon.data.length-4).split("),(");
196
  for(var j=0; j<polygonData.length; j++){
197
  var polygonMarker = polygonData[j].split(",");
198
+ if(mapPolygon.show_markers == 1){
199
  var marker = new google.maps.Marker({
200
  map: map,
201
  position: {lat: Number(polygonMarker[0]), lng: Number(polygonMarker[1]) }
206
 
207
  polygonCoord.push(new google.maps.LatLng( Number(polygonMarker[0]), Number(polygonMarker[1])));
208
  }
209
+
210
  polygon = new google.maps.Polygon({
211
  strokeWeight:Number(mapPolygon.line_width),
212
  strokeColor: "#" + mapPolygon.line_color,
215
  fillOpacity: Number(mapPolygon.fill_opacity),
216
  paths: polygonCoord,
217
  });
218
+
219
  allPolygons.push(polygon);
220
  var polygonArea = google.maps.geometry.spherical.computeArea(polygon.getPath());
221
+ polygonsByAreas[polygonArea] = [polygon];
222
+ polygonsAreas.push(polygonArea);
223
  //polygon.setMap(map);
224
+
225
  (function(overlay, row, map) {
226
+
227
  google.maps.event.addListener(overlay,"mouseover",function(){
228
  if(row.title){
229
  this.getMap().getDiv().setAttribute('title',row.title);
230
+ }
231
  });
232
  google.maps.event.addListener(overlay,"mouseout",function(){
233
+ this.getMap().getDiv().removeAttribute('title');
234
+ });
235
+
236
+ }(polygon, mapPolygon, map));
237
+
238
  }
239
  polygonsAreas.sort(function(a,b){return b - a});
240
 
241
  for(var i=0; i< polygonsAreas.length ; i++){
242
  polygonsByAreas[polygonsAreas[i]][0].setMap(map);
243
+ polygonsByAreas[polygonsAreas[i]][0].setOptions({zIndex: i+1});
244
+ }
245
+
246
  }
247
 
248
 
249
  var allPolylines = [];
250
  var allPolylineMarkers = [];
251
  function gmwdSetMapPolylines(){
252
+ var mapPolyline, polyline;
253
 
254
  for(var key in mapPolylines){
255
  var polylineCoord = [];
260
  polylineData = mapPolyline.data.substr(1, mapPolyline.data.length-4).split("),(");
261
  for(var j=0; j<polylineData.length; j++){
262
  var polylineMarker = polylineData[j].split(",");
263
+ if(mapPolyline.show_markers == 1){
264
  var marker = new google.maps.Marker({
265
  map: map,
266
  position: {lat: Number(polylineMarker[0]), lng: Number(polylineMarker[1]) }
267
+ });
268
  allPolylineMarkers.push(marker);
269
 
270
  }
271
  polylineCoord.push(new google.maps.LatLng( Number(polylineMarker[0]), Number(polylineMarker[1])));
272
  }
273
+
274
  polyline = new google.maps.Polyline({
275
  strokeWeight:Number(mapPolyline.line_width),
276
  strokeColor: "#" + mapPolyline.line_color,
281
 
282
  allPolylines.push(polyline);
283
  polyline.setMap(map);
284
+
285
+ (function(overlay, row, map) {
286
+
287
  google.maps.event.addListener(overlay,"mouseover",function(){
288
  if(row.title){
289
  this.getMap().getDiv().setAttribute('title',row.title);
290
+ }
291
  });
292
  google.maps.event.addListener(overlay,"mouseout",function(){
293
+ this.getMap().getDiv().removeAttribute('title');
294
+ });
295
+
296
+ }(polyline, mapPolyline, map));
297
+
298
+
299
  }
300
 
301
  }
311
  case "0" :
312
  map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
313
  break;
314
+ case "1" :
315
  map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
316
  break;
317
+ case "2":
318
  map.setMapTypeId(google.maps.MapTypeId.HYBRID);
319
  break;
320
+ case "3":
321
  map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
322
+ break;
323
  }
324
  }
325
 
337
  }
338
  }
339
  break;
340
+ case "traffic" :
341
  if(enableTrafficLayer == 1){
342
  trafficLayer = new google.maps.TrafficLayer();
343
  trafficLayer.setMap(map);
346
  if(trafficLayer){
347
  trafficLayer.setMap(null);
348
  }
349
+ }
350
+ break;
351
+ case "transit" :
352
  if(enableTransitLayer == 1){
353
  transitLayer = new google.maps.TransitLayer();
354
  transitLayer.setMap(map);
357
  if(transitLayer){
358
  transitLayer.setMap(null);
359
  }
360
+ }
361
+ break;
362
  }
363
  }
364
 
374
  ////////////////////////////////////////////////////////////////////////////////////////
375
  ////////////////////////////////////////////////////////////////////////////////////////
376
  // Listeners //
377
+ ////////////////////////////////////////////////////////////////////////////////////////
js/markers_gmwd.js CHANGED
@@ -23,61 +23,61 @@ jQuery( document ).ready(function() {
23
  }
24
  jQuery("input[type=text], input[type=number]").keypress(function(event){
25
  event = event || window.event;
26
- if(event.keyCode == 13){
27
  return false;
28
- }
29
  });
30
  jQuery("#marker_address").keypress(function(event){
31
  rightClick = false;
32
  event = event || window.event;
33
- if(event.keyCode == 13){
34
  if(marker){
35
  marker.setMap(null);
36
  }
37
  getLatLngFromAddress(jQuery(this).val(), "lat", "lng", gmwdSetMarker);
38
-
39
  return false;
40
- }
41
  });
42
-
43
-
44
  // lat, lng
45
  jQuery("#lat, #lng").change(function(){
46
  rightClick = false;
47
- getAddressFromLatLng(Number(jQuery("#lat").val()), Number(jQuery("#lng").val()), "marker_address", gmwdSetMarker);
48
  });
49
 
50
-
51
  jQuery("#title").blur(function(){
52
  if(marker){
53
  marker.setTitle(jQuery(this).val());
54
  gmwdCreateInfoWindow();
55
  }
56
- });
 
57
 
58
-
59
  // info window
60
- jQuery("[name=info_window_open]").change(function(){
61
  gmwdSetInfoWindow();
62
  });
63
- jQuery("[name=enable_info_window]").change(function(){
64
  gmwdSetInfoWindow();
65
  });
66
-
67
-
68
  // animations
69
  jQuery("#animation").change(function(){
70
  gmwdSetMarkerAnimation(jQuery(this).val());
71
  });
72
-
73
-
74
 
75
  });
76
 
77
  ////////////////////////////////////////////////////////////////////////////////////////
78
  // Public Methods //
79
  ////////////////////////////////////////////////////////////////////////////////////////
80
- function gmwdSetMarker(){
81
  if(marker){
82
  marker.setMap(null);
83
  }
@@ -88,7 +88,7 @@ function gmwdSetMarker(){
88
  });
89
 
90
  marker.setTitle(jQuery("#title").val());
91
-
92
  if(rightClick === false){
93
  map.setOptions({center: {lat: Number(jQuery("#lat").val()), lng: Number(jQuery("#lng").val())}});
94
  }
@@ -108,7 +108,7 @@ function gmwdCreateInfoWindow(){
108
  if(jQuery("#pic_url").val()){
109
  contentString += '<img src="' + jQuery("#pic_url").val() + '" style="float:right; margin-left: 10px; max-width:100px">';
110
  }
111
- contentString += (jQuery("#title").val() || jQuery("#marker_address").val()) ;
112
  if(infoWindow){
113
  infoWindow.setOptions({content: contentString});
114
  }
@@ -117,24 +117,24 @@ function gmwdCreateInfoWindow(){
117
  content: contentString
118
  });
119
  }
120
-
121
  }
122
 
123
  function gmwdSetInfoWindow(){
124
- gmwdCreateInfoWindow();
125
- if(jQuery("[name=enable_info_window]:checked").val() == 1){
126
  if(marker){
127
- if(jQuery("[name=info_window_open]:checked").val() == 1 ){
128
  infoWindow.open(map, marker);
129
- gmwdMarkerEvents();
130
  }
131
  else{
132
- infoWindow.close();
133
  }
134
  }
135
  }
136
  else{
137
- infoWindow.open(null, null);
138
  }
139
  }
140
 
@@ -146,7 +146,7 @@ function gmwdSetMarkerAnimation(value){
146
  }
147
  else if(value == "DROP"){
148
  marker.setAnimation(google.maps.Animation.DROP)
149
- }
150
  else{
151
  marker.setAnimation(null);
152
  }
@@ -160,10 +160,10 @@ function gmwdMarkerEvents(){
160
  if(linkUrl){
161
  window.open(linkUrl);
162
  }
163
-
164
  if(infoWindow && jQuery("[name=enable_info_window]:checked").val() == 1){
165
- infoWindow.open(map, marker);
166
- }
167
  });
168
  google.maps.event.addListener(marker, 'dragend', function (event) {
169
  document.getElementById("lat").value = this.getPosition().lat();
@@ -179,30 +179,30 @@ function gmwdMarkerEvents(){
179
  });
180
  });
181
  }
182
-
183
 
184
  }
185
 
186
  function gmwdMarkerMapEvents(){
187
  google.maps.event.addListener(map, 'rightclick', function(event) {
188
- if(marker){
189
- marker.setVisible(false);
190
- marker.setMap(null);
191
  }
192
  var geocoder = new google.maps.Geocoder();
193
- geocoder.geocode({
194
- latLng: new google.maps.LatLng(event.latLng.lat(), event.latLng.lng())
195
- },
196
- function(responses) {
197
- if (responses && responses.length > 0) {
198
- jQuery("#marker_address").val(responses[0].formatted_address);
199
  jQuery("#lat").val( event.latLng.lat());
200
  jQuery("#lng").val( event.latLng.lng());
201
  rightClick = true;
202
- gmwdSetMarker();
203
- }
204
  });
205
-
206
  });
207
  }
208
 
@@ -213,8 +213,8 @@ function gmwdMarkeroptions(){
213
  gmwdSetInfoWindow();
214
  }
215
 
216
-
217
-
218
 
219
  ////////////////////////////////////////////////////////////////////////////////////////
220
  // Getters & Setters //
@@ -226,4 +226,4 @@ function gmwdMarkeroptions(){
226
 
227
  ////////////////////////////////////////////////////////////////////////////////////////
228
  // Listeners //
229
- ////////////////////////////////////////////////////////////////////////////////////////
23
  }
24
  jQuery("input[type=text], input[type=number]").keypress(function(event){
25
  event = event || window.event;
26
+ if(event.keyCode == 13){
27
  return false;
28
+ }
29
  });
30
  jQuery("#marker_address").keypress(function(event){
31
  rightClick = false;
32
  event = event || window.event;
33
+ if(event.keyCode == 13){
34
  if(marker){
35
  marker.setMap(null);
36
  }
37
  getLatLngFromAddress(jQuery(this).val(), "lat", "lng", gmwdSetMarker);
38
+
39
  return false;
40
+ }
41
  });
42
+
43
+
44
  // lat, lng
45
  jQuery("#lat, #lng").change(function(){
46
  rightClick = false;
47
+ getAddressFromLatLng(Number(jQuery("#lat").val()), Number(jQuery("#lng").val()), "marker_address", gmwdSetMarker);
48
  });
49
 
50
+
51
  jQuery("#title").blur(function(){
52
  if(marker){
53
  marker.setTitle(jQuery(this).val());
54
  gmwdCreateInfoWindow();
55
  }
56
+ });
57
+
58
 
 
59
  // info window
60
+ jQuery("[name=info_window_open]").change(function(){
61
  gmwdSetInfoWindow();
62
  });
63
+ jQuery("[name=enable_info_window]").change(function(){
64
  gmwdSetInfoWindow();
65
  });
66
+
67
+
68
  // animations
69
  jQuery("#animation").change(function(){
70
  gmwdSetMarkerAnimation(jQuery(this).val());
71
  });
72
+
73
+
74
 
75
  });
76
 
77
  ////////////////////////////////////////////////////////////////////////////////////////
78
  // Public Methods //
79
  ////////////////////////////////////////////////////////////////////////////////////////
80
+ function gmwdSetMarker(){
81
  if(marker){
82
  marker.setMap(null);
83
  }
88
  });
89
 
90
  marker.setTitle(jQuery("#title").val());
91
+
92
  if(rightClick === false){
93
  map.setOptions({center: {lat: Number(jQuery("#lat").val()), lng: Number(jQuery("#lng").val())}});
94
  }
108
  if(jQuery("#pic_url").val()){
109
  contentString += '<img src="' + jQuery("#pic_url").val() + '" style="float:right; margin-left: 10px; max-width:100px">';
110
  }
111
+ contentString += (jQuery("#title").val() + "<br>" + jQuery("#marker_address").val()) ;
112
  if(infoWindow){
113
  infoWindow.setOptions({content: contentString});
114
  }
117
  content: contentString
118
  });
119
  }
120
+
121
  }
122
 
123
  function gmwdSetInfoWindow(){
124
+ gmwdCreateInfoWindow();
125
+ if(jQuery("[name=enable_info_window]:checked").val() == 1){
126
  if(marker){
127
+ if(jQuery("[name=info_window_open]:checked").val() == 1 ){
128
  infoWindow.open(map, marker);
129
+ gmwdMarkerEvents();
130
  }
131
  else{
132
+ infoWindow.close();
133
  }
134
  }
135
  }
136
  else{
137
+ infoWindow.open(null, null);
138
  }
139
  }
140
 
146
  }
147
  else if(value == "DROP"){
148
  marker.setAnimation(google.maps.Animation.DROP)
149
+ }
150
  else{
151
  marker.setAnimation(null);
152
  }
160
  if(linkUrl){
161
  window.open(linkUrl);
162
  }
163
+
164
  if(infoWindow && jQuery("[name=enable_info_window]:checked").val() == 1){
165
+ infoWindow.open(map, marker);
166
+ }
167
  });
168
  google.maps.event.addListener(marker, 'dragend', function (event) {
169
  document.getElementById("lat").value = this.getPosition().lat();
179
  });
180
  });
181
  }
182
+
183
 
184
  }
185
 
186
  function gmwdMarkerMapEvents(){
187
  google.maps.event.addListener(map, 'rightclick', function(event) {
188
+ if(marker){
189
+ marker.setVisible(false);
190
+ marker.setMap(null);
191
  }
192
  var geocoder = new google.maps.Geocoder();
193
+ geocoder.geocode({
194
+ latLng: new google.maps.LatLng(event.latLng.lat(), event.latLng.lng())
195
+ },
196
+ function(responses) {
197
+ if (responses && responses.length > 0) {
198
+ jQuery("#marker_address").val(responses[0].formatted_address);
199
  jQuery("#lat").val( event.latLng.lat());
200
  jQuery("#lng").val( event.latLng.lng());
201
  rightClick = true;
202
+ gmwdSetMarker();
203
+ }
204
  });
205
+
206
  });
207
  }
208
 
213
  gmwdSetInfoWindow();
214
  }
215
 
216
+
217
+
218
 
219
  ////////////////////////////////////////////////////////////////////////////////////////
220
  // Getters & Setters //
226
 
227
  ////////////////////////////////////////////////////////////////////////////////////////
228
  // Listeners //
229
+ ////////////////////////////////////////////////////////////////////////////////////////
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-google-maps-plugin.html
4
  Tags: directions, google map, google map plugin, google maps, google maps plugin, map, map markers, map plugin, map widget, maps, wp google map, wp google maps
5
  Requires at least: 3.4
6
  Tested up to: 4.6
7
- Stable tag: 1.0.18
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -113,8 +113,11 @@ After downloading the ZIP file of the Google Maps WD plugin,
113
 
114
  == Changelog ==
115
 
 
 
 
116
  = 1.0.18 =
117
- * Added: Option to enable Search box for google maps
118
 
119
  = 1.0.17 =
120
  * Fixed: Conflicts with some plugins
4
  Tags: directions, google map, google map plugin, google maps, google maps plugin, map, map markers, map plugin, map widget, maps, wp google map, wp google maps
5
  Requires at least: 3.4
6
  Tested up to: 4.6
7
+ Stable tag: 1.0.19
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
113
 
114
  == Changelog ==
115
 
116
+ = 1.0.19 =
117
+ * Added: Address in infowindow
118
+
119
  = 1.0.18 =
120
+ * Added: Option to enable Search box for google maps
121
 
122
  = 1.0.17 =
123
  * Fixed: Conflicts with some plugins
wd-google-maps.php CHANGED
@@ -4,23 +4,23 @@
4
  * Plugin Name: Google Maps WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
- * Version: 1.0.18
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
11
  */
12
-
13
  define('GMWD_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
14
  define('GMWD_NAME', plugin_basename(dirname(__FILE__)));
15
  define('GMWD_URL', plugins_url(plugin_basename(dirname(__FILE__))));
16
- define('GMWD_MAIN_FILE', plugin_basename(__FILE__));
17
 
18
  require_once( GMWD_DIR. '/framework/functions.php' );
19
  if ( is_admin() ) {
20
  require_once( 'gmwd_admin_class.php' );
21
- register_activation_hook(__FILE__, array('GMWDAdmin', 'gmwd_activate'));
22
  add_action( 'plugins_loaded', array('GMWDAdmin', 'gmwd_get_instance'));
23
-
24
  add_action('wp_ajax_add_marker', array('GMWDAdmin', 'gmwd_ajax'));
25
  add_action('wp_ajax_download_markers', array('GMWDAdmin', 'gmwd_ajax'));
26
  add_action('wp_ajax_select_marker_icon', array('GMWDAdmin', 'gmwd_ajax'));
@@ -29,7 +29,7 @@ if ( is_admin() ) {
29
  add_action('wp_ajax_add_polyline', array('GMWDAdmin', 'gmwd_ajax'));
30
  add_action('wp_ajax_add_circle', array('GMWDAdmin', 'gmwd_ajax'));
31
  add_action('wp_ajax_add_rectangle', array('GMWDAdmin', 'gmwd_ajax'));
32
-
33
  }
34
 
35
  require_once( 'gmwd_class.php' );
@@ -40,16 +40,16 @@ add_action( 'plugins_loaded', array('GMWD', 'gmwd_get_instance'));
40
  add_action('wp_ajax_get_ajax_markers', array('GMWD','gmwd_frontend'));
41
  add_action('wp_ajax_nopriv_get_ajax_markers', array('GMWD','gmwd_frontend'));
42
  add_action('wp_ajax_get_ajax_store_loactor', array('GMWD','gmwd_frontend'));
43
- add_action('wp_ajax_nopriv_get_ajax_store_loactor', array('GMWD','gmwd_frontend'));
44
 
45
  function gmwd_map($shortcode_id, $map_id ){
46
  GMWD::gmwd_get_instance();
47
  $params = array();
48
  $params ['map'] = $map_id;
49
  $params ['id'] = $shortcode_id;
50
-
51
  $map_controller = new GMWDControllerFrontendMap($params);
52
- $map_controller->display();
53
  }
54
  require_once( GMWD_DIR. '/widgets.php' );
55
 
4
  * Plugin Name: Google Maps WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
+ * Version: 1.0.19
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
11
  */
12
+
13
  define('GMWD_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
14
  define('GMWD_NAME', plugin_basename(dirname(__FILE__)));
15
  define('GMWD_URL', plugins_url(plugin_basename(dirname(__FILE__))));
16
+ define('GMWD_MAIN_FILE', plugin_basename(__FILE__));
17
 
18
  require_once( GMWD_DIR. '/framework/functions.php' );
19
  if ( is_admin() ) {
20
  require_once( 'gmwd_admin_class.php' );
21
+ register_activation_hook(__FILE__, array('GMWDAdmin', 'gmwd_activate'));
22
  add_action( 'plugins_loaded', array('GMWDAdmin', 'gmwd_get_instance'));
23
+
24
  add_action('wp_ajax_add_marker', array('GMWDAdmin', 'gmwd_ajax'));
25
  add_action('wp_ajax_download_markers', array('GMWDAdmin', 'gmwd_ajax'));
26
  add_action('wp_ajax_select_marker_icon', array('GMWDAdmin', 'gmwd_ajax'));
29
  add_action('wp_ajax_add_polyline', array('GMWDAdmin', 'gmwd_ajax'));
30
  add_action('wp_ajax_add_circle', array('GMWDAdmin', 'gmwd_ajax'));
31
  add_action('wp_ajax_add_rectangle', array('GMWDAdmin', 'gmwd_ajax'));
32
+
33
  }
34
 
35
  require_once( 'gmwd_class.php' );
40
  add_action('wp_ajax_get_ajax_markers', array('GMWD','gmwd_frontend'));
41
  add_action('wp_ajax_nopriv_get_ajax_markers', array('GMWD','gmwd_frontend'));
42
  add_action('wp_ajax_get_ajax_store_loactor', array('GMWD','gmwd_frontend'));
43
+ add_action('wp_ajax_nopriv_get_ajax_store_loactor', array('GMWD','gmwd_frontend'));
44
 
45
  function gmwd_map($shortcode_id, $map_id ){
46
  GMWD::gmwd_get_instance();
47
  $params = array();
48
  $params ['map'] = $map_id;
49
  $params ['id'] = $shortcode_id;
50
+
51
  $map_controller = new GMWDControllerFrontendMap($params);
52
+ $map_controller->display();
53
  }
54
  require_once( GMWD_DIR. '/widgets.php' );
55