WP Google Map - Version 1.2.0

Version Description

Upgrade Google Map Plugin from here to get updated features.

Download this release

Release Info

Developer milonfci
Plugin Icon 128x128 WP Google Map
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.7 to 1.2.0

assets/js/custom.js CHANGED
@@ -111,6 +111,11 @@
111
  } else {
112
  var wpgmap_disable_zoom_scroll = 0;
113
  }
 
 
 
 
 
114
 
115
  var wpgmap_title = parent.find("#wpgmap_title").val();
116
  var wpgmap_heading_class = parent.find("#wpgmap_heading_class").val();
@@ -132,7 +137,8 @@
132
  wpgmap_map_height: wpgmap_map_height,
133
  wpgmap_map_type: wpgmap_map_type,
134
  wpgmap_map_address: wpgmap_map_address,
135
- wpgmap_show_infowindow: wpgmap_show_infowindow
 
136
  };
137
 
138
  if (btn_id == 'wp-gmap-embed-save') {
111
  } else {
112
  var wpgmap_disable_zoom_scroll = 0;
113
  }
114
+ if (parent.find("#wpgmap_enable_direction").is(':checked') === true) {
115
+ var wpgmap_enable_direction = 1;
116
+ } else {
117
+ var wpgmap_enable_direction = 0;
118
+ }
119
 
120
  var wpgmap_title = parent.find("#wpgmap_title").val();
121
  var wpgmap_heading_class = parent.find("#wpgmap_heading_class").val();
137
  wpgmap_map_height: wpgmap_map_height,
138
  wpgmap_map_type: wpgmap_map_type,
139
  wpgmap_map_address: wpgmap_map_address,
140
+ wpgmap_show_infowindow: wpgmap_show_infowindow,
141
+ wpgmap_enable_direction: wpgmap_enable_direction
142
  };
143
 
144
  if (btn_id == 'wp-gmap-embed-save') {
includes/gmap.php CHANGED
@@ -24,7 +24,9 @@ if (isset($_GET['page'])) {
24
  src="<?php echo esc_url(plugins_url("../assets/js/srm_gmap_loader.js", __FILE__)); ?>"></script>
25
  <div id="gmap_container_inner">
26
  <!--modal contents-->
27
-
 
 
28
  <ul id="wp-gmap-nav">
29
  <li class="<?php echo ($wpgmap_page == 'wpgmapembed' && $wpgmap_tag == '') ? 'active' : ''; ?>">
30
  <a href="<?php echo admin_url(); ?>admin.php?page=wpgmapembed" data-id="wp-gmap-all"
24
  src="<?php echo esc_url(plugins_url("../assets/js/srm_gmap_loader.js", __FILE__)); ?>"></script>
25
  <div id="gmap_container_inner">
26
  <!--modal contents-->
27
+ <div class="error">
28
+ <p style="font-size:17px;"><strong><?php _e('Notice: If it seems Direction option is not working properly, Please take api key again from settings tab.','gmap-embed');?></strong></p>
29
+ </div>
30
  <ul id="wp-gmap-nav">
31
  <li class="<?php echo ($wpgmap_page == 'wpgmapembed' && $wpgmap_tag == '') ? 'active' : ''; ?>">
32
  <a href="<?php echo admin_url(); ?>admin.php?page=wpgmapembed" data-id="wp-gmap-all"
includes/shortcodes.php CHANGED
@@ -1,79 +1,184 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- // ************* Google Map SRM Shortcode***************
4
- if (!function_exists('srm_gmap_embed_shortcode')) {
5
-
6
- function srm_gmap_embed_shortcode($atts, $content)
7
- {
8
- static $count;
9
- if (!$count) {
10
- $count = 0;
11
- }
12
- $count++;
13
-
14
- $wpgmap_title = esc_html(get_post_meta($atts['id'], 'wpgmap_title', true));
15
- $wpgmap_show_heading = esc_html(get_post_meta($atts['id'], 'wpgmap_show_heading', true));
16
- $wpgmap_heading_class = esc_html(get_post_meta($atts['id'], 'wpgmap_heading_class', true));
17
- $wpgmap_latlng = esc_html(get_post_meta($atts['id'], 'wpgmap_latlng', true));
18
- $wpgmap_disable_zoom_scroll = esc_html(get_post_meta($atts['id'], 'wpgmap_disable_zoom_scroll', true));
19
- $wpgmap_map_zoom = esc_html(get_post_meta($atts['id'], 'wpgmap_map_zoom', true));
20
- $wpgmap_map_width = esc_html(get_post_meta($atts['id'], 'wpgmap_map_width', true));
21
- $wpgmap_map_height = esc_html(get_post_meta($atts['id'], 'wpgmap_map_height', true));
22
- $wpgmap_map_type = esc_html(get_post_meta($atts['id'], 'wpgmap_map_type', true));
23
- $wpgmap_map_address = esc_html(get_post_meta($atts['id'], 'wpgmap_map_address', true));
24
- $wpgmap_show_infowindow = get_post_meta($atts['id'], 'wpgmap_show_infowindow', true);
25
-
26
- ob_start();
27
-
28
- if (isset($wpgmap_show_heading) && $wpgmap_show_heading == 1) {
29
- echo "<h1 class='$wpgmap_heading_class'>" . $wpgmap_title . "</h1>";
30
- }
31
- ?>
32
- <script type="text/javascript">
33
- google.maps.event.addDomListener(window, 'load', function () {
34
- var map = new google.maps.Map(document.getElementById("srm_gmp_embed_<?php echo $count; ?>"), {
35
- center: new google.maps.LatLng(<?php echo $wpgmap_latlng;?>),
36
- zoom:<?php echo $wpgmap_map_zoom;?>,
37
- mapTypeId: google.maps.MapTypeId.<?php echo $wpgmap_map_type;?>,
38
- scrollwheel:'<?php echo $wpgmap_disable_zoom_scroll==1?false:true;?>'
39
- });
40
-
41
- var marker = new google.maps.Marker({
42
- position: new google.maps.LatLng(<?php echo $wpgmap_latlng;?>),
43
- map: map,
44
- animation: google.maps.Animation.DROP
45
- });
46
- marker.setMap(map);
47
-
48
- <?php
49
- if($wpgmap_show_infowindow){
50
- ?>
51
- var infowindow = new google.maps.InfoWindow({
52
- content: "<?php echo $wpgmap_map_address;?>"
53
- });
54
-
55
- infowindow.open(map, marker);
56
-
57
- google.maps.event.addListener(marker, 'click', function () {
58
- infowindow.open(map, marker);
59
- });
60
-
61
- <?php
62
- }
63
- ?>
64
-
65
- });
66
- </script>
67
-
68
- <div id="srm_gmp_embed_<?php echo $count; ?>"
69
- style="width:<?php echo $wpgmap_map_width . ' !important'; ?>;height:<?php echo $wpgmap_map_height; ?> !important;margin:5px 0; ">
70
-
71
- </div>
72
- <?php
73
- return ob_get_clean();
74
- }
75
-
76
- }
77
-
78
- //******* Defining Shortcode for Google Map SRM
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  add_shortcode('gmap-embed', 'srm_gmap_embed_shortcode');
1
+ <?php
2
+ if (!defined('ABSPATH')) exit;
3
+ // ************* Google Map SRM Shortcode***************
4
+ if (!function_exists('srm_gmap_embed_shortcode')) {
5
+
6
+ function srm_gmap_embed_shortcode($atts, $content)
7
+ {
8
+ static $count;
9
+ if (!$count) {
10
+ $count = 0;
11
+ }
12
+ $count++;
13
+
14
+ $wpgmap_title = esc_html(get_post_meta($atts['id'], 'wpgmap_title', true));
15
+ $wpgmap_show_heading = esc_html(get_post_meta($atts['id'], 'wpgmap_show_heading', true));
16
+ $wpgmap_heading_class = esc_html(get_post_meta($atts['id'], 'wpgmap_heading_class', true));
17
+ $wpgmap_latlng = esc_html(get_post_meta($atts['id'], 'wpgmap_latlng', true));
18
+ $wpgmap_disable_zoom_scroll = esc_html(get_post_meta($atts['id'], 'wpgmap_disable_zoom_scroll', true));
19
+ $wpgmap_map_zoom = esc_html(get_post_meta($atts['id'], 'wpgmap_map_zoom', true));
20
+ $wpgmap_map_width = esc_html(get_post_meta($atts['id'], 'wpgmap_map_width', true));
21
+ $wpgmap_map_height = esc_html(get_post_meta($atts['id'], 'wpgmap_map_height', true));
22
+ $wpgmap_map_type = esc_html(get_post_meta($atts['id'], 'wpgmap_map_type', true));
23
+ $wpgmap_map_address = esc_html(get_post_meta($atts['id'], 'wpgmap_map_address', true));
24
+ $wpgmap_show_infowindow = get_post_meta($atts['id'], 'wpgmap_show_infowindow', true);
25
+ $wpgmap_enable_direction = get_post_meta($atts['id'], 'wpgmap_enable_direction', true);
26
+
27
+ ob_start();
28
+
29
+ if (isset($wpgmap_show_heading) && $wpgmap_show_heading == 1) {
30
+ echo "<h1 class='$wpgmap_heading_class'>" . $wpgmap_title . "</h1>";
31
+ }
32
+ ?>
33
+ <script type="text/javascript">
34
+ google.maps.event.addDomListener(window, 'load', function () {
35
+ var map = new google.maps.Map(document.getElementById("srm_gmp_embed_<?php echo $count; ?>"), {
36
+ center: new google.maps.LatLng(<?php echo $wpgmap_latlng;?>),
37
+ zoom:<?php echo $wpgmap_map_zoom;?>,
38
+ mapTypeId: google.maps.MapTypeId.<?php echo $wpgmap_map_type;?>,
39
+ scrollwheel: '<?php echo $wpgmap_disable_zoom_scroll == 1 ? false : true;?>'
40
+ });
41
+
42
+ // To view directions form and data
43
+ <?php if($wpgmap_enable_direction){ ?>
44
+ var directionsDisplay = new google.maps.DirectionsRenderer();
45
+
46
+ directionsDisplay.setMap(map);
47
+ directionsDisplay.setPanel(document.getElementById("wp_gmap_directions_<?php echo $count; ?>"));
48
+
49
+ var btn = document.getElementById('wp_gmap_submit_<?php echo $count; ?>');
50
+ btn.addEventListener('click', function () {
51
+ var selectedMode = document.getElementById("mode").value,
52
+ start = document.getElementById("from_<?php echo $count; ?>").value,
53
+ end = document.getElementById("to_<?php echo $count; ?>").value;
54
+ if (start == '' || end == '') {
55
+ // cannot calculate route
56
+ document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'none';
57
+ return false;
58
+ }
59
+ else {
60
+
61
+
62
+ document.getElementById('wp_gmap_loading_<?php echo $count; ?>').style.display = 'block';
63
+
64
+ var request = {
65
+ origin: start,
66
+ destination: end,
67
+ travelMode: google.maps.DirectionsTravelMode[selectedMode]
68
+ };
69
+ var directionsService = new google.maps.DirectionsService();
70
+ directionsService.route(request, function (response, status) {
71
+ document.getElementById('wp_gmap_loading_<?php echo $count; ?>').style.display = 'none';
72
+ if (status == google.maps.DirectionsStatus.OK) {
73
+ directionsDisplay.setDirections(response);
74
+ document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'block';
75
+ }
76
+ else {
77
+ document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'none';
78
+ }
79
+ });
80
+
81
+ }
82
+ });
83
+ <?php }?>
84
+ //=========Direction view end
85
+
86
+ var marker = new google.maps.Marker({
87
+ position: new google.maps.LatLng(<?php echo $wpgmap_latlng;?>),
88
+ map: map,
89
+ animation: google.maps.Animation.DROP
90
+ });
91
+ marker.setMap(map);
92
+ <?php
93
+ if($wpgmap_show_infowindow){
94
+ ?>
95
+ var infowindow = new google.maps.InfoWindow({
96
+ content: "<?php echo $wpgmap_map_address;?>"
97
+ });
98
+ infowindow.open(map, marker);
99
+ google.maps.event.addListener(marker, 'click', function () {
100
+ infowindow.open(map, marker);
101
+ });
102
+ <?php
103
+ }
104
+ ?>
105
+
106
+ });
107
+
108
+
109
+ </script>
110
+
111
+
112
+ <div id="srm_gmp_embed_<?php echo $count; ?>"
113
+ style="width:<?php echo $wpgmap_map_width . ' !important'; ?>;height:<?php echo $wpgmap_map_height; ?> !important;margin:5px 0; ">
114
+
115
+ </div>
116
+ <?php
117
+ if ($wpgmap_enable_direction == 1) { ?>
118
+ <style type="text/css">
119
+ .wp_gmap_direction_box {
120
+ width: 100%;
121
+ height: auto;
122
+ float: left;
123
+ }
124
+
125
+ .wp_gmap_direction_box .fieldcontain {
126
+ margin: 8px 0;
127
+ }
128
+
129
+ #wp_gmap_submit {
130
+ background-color: #333;
131
+ border: 0;
132
+ color: #fff;
133
+ cursor: pointer;
134
+ font-family: "Noto Sans", sans-serif;
135
+ font-size: 12px;
136
+ font-weight: 700;
137
+ padding: 13px 24px;
138
+ text-transform: uppercase;
139
+ }
140
+
141
+ #wp_gmap_directions {
142
+ border: 1px #ddd solid;
143
+ }
144
+ </style>
145
+ <div class="wp_gmap_direction_box">
146
+ <div class="ui-bar-c ui-corner-all ui-shadow" style="padding:1em;">
147
+ <div data-role="fieldcontain" class="fieldcontain">
148
+ <label for="from">From</label>
149
+ <input type="text" id="from_<?php echo $count; ?>" value="<?php echo $wpgmap_map_address; ?>"/>
150
+ </div>
151
+ <div data-role="fieldcontain" class="fieldcontain">
152
+ <label for="to">To</label>
153
+ <input type="text" id="to_<?php echo $count; ?>" value="<?php echo $wpgmap_map_address; ?>"/>
154
+ </div>
155
+ <div data-role="fieldcontain" class="fieldcontain">
156
+ <label for="mode" class="select">Transportation method:</label>
157
+ <select name="select-choice-0" id="mode" style="padding: 5px;">
158
+ <option value="DRIVING">Driving</option>
159
+ <option value="WALKING">Walking</option>
160
+ <option value="BICYCLING">Bicycling</option>
161
+ </select>
162
+ </div>
163
+ <button type="button" data-icon="search" data-role="button" href="#"
164
+ id="wp_gmap_submit_<?php echo $count; ?>">Get Directions
165
+ </button>
166
+ <span id="wp_gmap_loading_<?php echo $count; ?>" style="display: none;">Loading...</span>
167
+ </div>
168
+
169
+ <!-- Directions will be listed here-->
170
+ <div id="wp_gmap_results_<?php echo $count; ?>"
171
+ style="display:none;max-height: 300px;overflow-y: scroll;">
172
+ <div id="wp_gmap_directions_<?php echo $count; ?>"></div>
173
+ </div>
174
+
175
+ </div>
176
+ <?php } ?>
177
+ <?php
178
+ return ob_get_clean();
179
+ }
180
+
181
+ }
182
+
183
+ //******* Defining Shortcode for Google Map SRM
184
  add_shortcode('gmap-embed', 'srm_gmap_embed_shortcode');
includes/wpgmap_create.php CHANGED
@@ -92,6 +92,15 @@
92
  <?php _e('Show in marker infowindow','gmap-embed');?>
93
  </label>
94
 
 
 
 
 
 
 
 
 
 
95
  </td>
96
  </tr>
97
 
92
  <?php _e('Show in marker infowindow','gmap-embed');?>
93
  </label>
94
 
95
+ <br/>
96
+
97
+ <label for="wpgmap_enable_direction"><input type="checkbox" value="1"
98
+ name="wpgmap_enable_direction"
99
+ id="wpgmap_enable_direction">
100
+ <?php _e('Enable Direction in Map','gmap-embed');?>
101
+ </label>
102
+
103
+
104
  </td>
105
  </tr>
106
 
includes/wpgmap_edit.php CHANGED
@@ -107,6 +107,14 @@ list($wpgmap_lat, $wpgmap_lng) = explode(',', esc_html($wpgmap_single->wpgmap_la
107
  id="wpgmap_show_infowindow" <?php echo ($wpgmap_single->wpgmap_show_infowindow == 1) ? 'checked' : ''; ?>>
108
  <?php _e('Show in marker infowindow','gmap-embed');?>
109
  </label>
 
 
 
 
 
 
 
 
110
  </td>
111
  </tr>
112
 
107
  id="wpgmap_show_infowindow" <?php echo ($wpgmap_single->wpgmap_show_infowindow == 1) ? 'checked' : ''; ?>>
108
  <?php _e('Show in marker infowindow','gmap-embed');?>
109
  </label>
110
+
111
+ <br/>
112
+
113
+ <label for="wpgmap_enable_direction"><input type="checkbox" value="1"
114
+ name="wpgmap_enable_direction"
115
+ id="wpgmap_enable_direction" <?php echo ($wpgmap_single->wpgmap_enable_direction == 1) ? 'checked' : ''; ?>>
116
+ <?php _e('Enable Direction in Map','gmap-embed');?>
117
+ </label>
118
  </td>
119
  </tr>
120
 
includes/wpgmap_settings.php CHANGED
@@ -12,7 +12,7 @@ if (!defined('ABSPATH')) exit;
12
  <button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e('Save','gmap-embed');?></button>
13
 
14
  <a target="_blank"
15
- href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend,places_backend,geolocation,geocoding_backend&amp;keyType=CLIENT_SIDE&amp;reusekey=true"
16
  class="button media-button button-default button-large"><?php _e('GET FREE API KEY','gmap-embed');?></a>
17
  <br/>The API key may take up to 5 minutes to take effect
18
  </p>
12
  <button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e('Save','gmap-embed');?></button>
13
 
14
  <a target="_blank"
15
+ href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend,places_backend,geolocation,geocoding_backend,directions_backend&amp;keyType=CLIENT_SIDE&amp;reusekey=true"
16
  class="button media-button button-default button-large"><?php _e('GET FREE API KEY','gmap-embed');?></a>
17
  <br/>The API key may take up to 5 minutes to take effect
18
  </p>
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://www.srmilon.com/google-map-demo
4
  Tags: Google Map, Google Map Embed, gmap, google map embed, wp map, wp map embed, map embed, best google maps, best maps, bing maps, cross browser, custom google map, custom google maps, map direction, easy map, geo, geocoder, gmaps, google earth, google map plugin, google map shortcode, google map widget, google maps v3, googlemaps, gprs, gps, gpx, kml, latitude, Longitude, location, loaction by address, map, map directions, map markers, map plugin, map shortcode, map styles, maps google, post map, map point, polygons, roads, routes, store locator, street view, wp google map, contact page map, google map wordpress, google maps wordpress, google maps for wordpress, simple google map, simple google map plugin, wp google maps,maps
5
  Requires at least: 2.9
6
  Tested up to: 4.7
7
- Version: 1.1.7
8
- Stable tag: 1.1.7
9
  Text Domain: gmap-embed
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -24,9 +24,13 @@ To have continue the update, please donate for the plugin.
24
 
25
  https://www.youtube.com/watch?v=Lak-tJjGjl8
26
 
 
 
 
27
  ### Features of Google Map Plugin:
28
 
29
  * **User friendly and easy to use.**
 
30
  * **Importing the shortcode by Embed Google Map Button upon Editor**
31
  * **Fully Customizable.**
32
  * **Automatic google map location identification**
@@ -76,6 +80,9 @@ After install the plugin, Click on Google Map in the left side bar. Then click o
76
  = How can i see created Maps list? =
77
  Click on Google Map in the left side bar, here Created Maps list will apper.
78
 
 
 
 
79
  = How to add Google Map in Post =
80
  Go to =Posts=->=Add New= then you will see a button named "Embed Google Map" beside media button. Click on it and insert your desired map by click ing on Insert Button, then save post and the map will appear in your desired post. Enjoy!
81
 
@@ -166,4 +173,7 @@ See the [Video](https://www.youtube.com/watch?v=Lak-tJjGjl8) ,hope you will get
166
  * Added option for creating unlimited maps(Previous limit was 10)
167
 
168
  = 1.1.7 =
169
- * Look and Feel changes
 
 
 
4
  Tags: Google Map, Google Map Embed, gmap, google map embed, wp map, wp map embed, map embed, best google maps, best maps, bing maps, cross browser, custom google map, custom google maps, map direction, easy map, geo, geocoder, gmaps, google earth, google map plugin, google map shortcode, google map widget, google maps v3, googlemaps, gprs, gps, gpx, kml, latitude, Longitude, location, loaction by address, map, map directions, map markers, map plugin, map shortcode, map styles, maps google, post map, map point, polygons, roads, routes, store locator, street view, wp google map, contact page map, google map wordpress, google maps wordpress, google maps for wordpress, simple google map, simple google map plugin, wp google maps,maps
5
  Requires at least: 2.9
6
  Tested up to: 4.7
7
+ Version: 1.2.0
8
+ Stable tag: 1.2.0
9
  Text Domain: gmap-embed
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
24
 
25
  https://www.youtube.com/watch?v=Lak-tJjGjl8
26
 
27
+ ### Important Notice
28
+ `If it seems Direction option is not working, Please take api key again from settings tab, it's necessary for Direction Option in Google Map.`
29
+
30
  ### Features of Google Map Plugin:
31
 
32
  * **User friendly and easy to use.**
33
+ * **Direction Support with Map.**
34
  * **Importing the shortcode by Embed Google Map Button upon Editor**
35
  * **Fully Customizable.**
36
  * **Automatic google map location identification**
80
  = How can i see created Maps list? =
81
  Click on Google Map in the left side bar, here Created Maps list will apper.
82
 
83
+ = How to enable Direction on Map? =
84
+ You will see an option named "Enable Direction in Map" under each map setting.
85
+
86
  = How to add Google Map in Post =
87
  Go to =Posts=->=Add New= then you will see a button named "Embed Google Map" beside media button. Click on it and insert your desired map by click ing on Insert Button, then save post and the map will appear in your desired post. Enjoy!
88
 
173
  * Added option for creating unlimited maps(Previous limit was 10)
174
 
175
  = 1.1.7 =
176
+ * Look and Feel changes
177
+
178
+ = 1.2.0 =
179
+ * Direction support with Google Map
srm_gmap_embed.php CHANGED
@@ -6,7 +6,7 @@
6
  Author: SRMILON
7
  Text Domain: gmap-embed
8
  Author URI: http://www.srmilon.com
9
- Version: 1.1.7
10
  */
11
 
12
  if (!defined('ABSPATH')) exit;
@@ -130,7 +130,8 @@ if (!class_exists('srm_gmap_embed_main')) {
130
  'wpgmap_map_height' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_height'])),
131
  'wpgmap_map_type' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_type'])),
132
  'wpgmap_map_address' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_address'])),
133
- 'wpgmap_show_infowindow' => sanitize_text_field($_POST['map_data']['wpgmap_show_infowindow'])
 
134
  );
135
  $action_type = sanitize_text_field(esc_html($_POST['map_data']['action_type']));
136
  if ($meta_data['wpgmap_latlng'] == '') {
@@ -271,7 +272,8 @@ if (!class_exists('srm_gmap_embed_main')) {
271
  'wpgmap_map_height' => get_post_meta($gmap_id, 'wpgmap_map_height', true),
272
  'wpgmap_map_type' => get_post_meta($gmap_id, 'wpgmap_map_type', true),
273
  'wpgmap_map_address' => get_post_meta($gmap_id, 'wpgmap_map_address', true),
274
- 'wpgmap_show_infowindow' => get_post_meta($gmap_id, 'wpgmap_show_infowindow', true)
 
275
  );
276
 
277
  return json_encode($gmap_data);
@@ -291,7 +293,8 @@ if (!class_exists('srm_gmap_embed_main')) {
291
  'wpgmap_map_height',
292
  'wpgmap_map_type',
293
  'wpgmap_map_address',
294
- 'wpgmap_show_infowindow'
 
295
  );
296
 
297
  $post_id = intval($_POST['post_id']);
6
  Author: SRMILON
7
  Text Domain: gmap-embed
8
  Author URI: http://www.srmilon.com
9
+ Version: 1.2.0
10
  */
11
 
12
  if (!defined('ABSPATH')) exit;
130
  'wpgmap_map_height' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_height'])),
131
  'wpgmap_map_type' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_type'])),
132
  'wpgmap_map_address' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_address'])),
133
+ 'wpgmap_show_infowindow' => sanitize_text_field($_POST['map_data']['wpgmap_show_infowindow']),
134
+ 'wpgmap_enable_direction' => sanitize_text_field($_POST['map_data']['wpgmap_enable_direction'])
135
  );
136
  $action_type = sanitize_text_field(esc_html($_POST['map_data']['action_type']));
137
  if ($meta_data['wpgmap_latlng'] == '') {
272
  'wpgmap_map_height' => get_post_meta($gmap_id, 'wpgmap_map_height', true),
273
  'wpgmap_map_type' => get_post_meta($gmap_id, 'wpgmap_map_type', true),
274
  'wpgmap_map_address' => get_post_meta($gmap_id, 'wpgmap_map_address', true),
275
+ 'wpgmap_show_infowindow' => get_post_meta($gmap_id, 'wpgmap_show_infowindow', true),
276
+ 'wpgmap_enable_direction' => get_post_meta($gmap_id, 'wpgmap_enable_direction', true)
277
  );
278
 
279
  return json_encode($gmap_data);
293
  'wpgmap_map_height',
294
  'wpgmap_map_type',
295
  'wpgmap_map_address',
296
+ 'wpgmap_show_infowindow',
297
+ 'wpgmap_enable_direction'
298
  );
299
 
300
  $post_id = intval($_POST['post_id']);