Version Description
Please update to 8.1.12 for PHP8 compatibility.
Download this release
Release Info
Developer | WPGMaps |
Plugin | WP Google Maps |
Version | 8.1.12 |
Comparing to | |
See all releases |
Code changes from version 8.1.11 to 8.1.12
- README.md +0 -0
- base/classes/WPGM_templates.php +0 -0
- base/classes/widget_module.class.php +0 -0
- base/includes/credits.php +0 -0
- base/includes/deprecated.php +0 -0
- base/includes/full-screen-module.php +0 -0
- base/includes/welcome.php +0 -0
- base/includes/wp-google-maps-polygons.php +0 -0
- base/includes/wp-google-maps-polylines.php +0 -0
- constants.php +0 -0
- css/common.css +0 -0
- css/data_table_front_old.css +0 -0
- css/font-awesome.css +0 -0
- css/font-awesome.min.css +0 -0
- css/gutenberg.css +0 -0
- css/jquery.dataTables.min.css +0 -0
- css/open-layers.css +4 -0
- css/styles/compact.css +0 -0
- css/styles/default.css +0 -0
- css/styles/legacy.css +0 -0
- css/styles/minimal.css +0 -0
- css/wp-google-maps-admin.css +15 -7
- css/wp-google-maps-full-screen-map.css +0 -0
- css/wpgmza_style.css +0 -0
- fonts/fontawesome-webfont.svg +0 -0
- fonts/glyphicons-halflings-regular.svg +0 -0
- html/gdpr-compliance-settings.html.php +0 -0
- html/gdpr-default-notice.html.php +0 -0
- html/google-maps-api-error-dialog.html.php +0 -0
- html/google-maps-api-settings.html.php +0 -0
- html/map-edit-page/map-edit-page.html.php +17 -9
- html/ol-feature-coming-soon.html.php +0 -0
- html/ol-feature-unavailable.html.php +0 -0
- html/settings-page.html.php +28 -23
- html/store-locator.html.php +0 -0
- html/theme-panel.html.php +0 -0
- html/tile-server-fieldset.html.php +0 -0
- images/marker_iw_type_inherit.png +0 -0
- images/wpgoogle-maps-chat-help162x42v4.png +0 -0
- includes/3rd-party-integration/class.gutenberg.php +0 -0
- includes/3rd-party-integration/class.wp-migrate-db-integration.php +0 -0
- includes/build.log +0 -0
- includes/class.auto-loader.php +31 -2
- includes/class.crud.php +0 -0
- includes/class.database.php +0 -0
- includes/class.distance.php +0 -0
- includes/class.dom-document.php +14 -1
- includes/class.dom-element.php +0 -0
- includes/class.dom-query-results.php +0 -0
- includes/class.dynamic-translations.php +0 -0
- includes/class.elias-fano.php +0 -0
- includes/class.factory.php +0 -0
- includes/class.feature.php +5 -1
- includes/class.gdpr-compliance.php +1 -1
- includes/class.global-settings.php +0 -0
- includes/class.google-maps-api-loader.php +16 -1
- includes/class.integrity-checker.php +0 -0
- includes/class.latlng.php +0 -0
- includes/class.map.php +0 -0
- includes/class.maps-engine-dialog.php +0 -0
- includes/class.marker-filter.php +0 -0
- includes/class.marker.php +0 -0
- includes/class.modal-dialog.php +0 -0
- includes/class.plugin.php +2 -1
- includes/class.query-fragment.php +0 -0
- includes/class.query.php +0 -0
- includes/class.rest-api.php +0 -0
- includes/class.script-loader.php +12 -7
- includes/class.selector-to-xpath.php +0 -0
- includes/class.settings-page.php +0 -0
- includes/class.settings.php +0 -0
- includes/class.store-locator.php +0 -0
- includes/class.strings.php +0 -0
- includes/class.theme-panel.php +0 -0
- includes/class.upgrader.php +14 -0
- includes/compat/backwards_compat_v6.php +0 -0
- includes/compat/class.pro-7-compatibility.php +0 -0
- includes/compat/js/backwards_compat_user_v6.js +0 -0
- includes/compat/js/backwards_compat_v6.js +0 -0
- includes/google-maps/class.google-geocoder.php +0 -0
- includes/google-maps/class.google-map.php +0 -0
- includes/google-maps/class.google-maps-loader.php +0 -0
- includes/legacy/functions.circle.php +0 -0
- includes/legacy/functions.rectangle.php +0 -0
- includes/legacy/settings-page.php +0 -0
- includes/map-edit-page/class.map-edit-page.php +6 -1
- includes/open-layers/class.nominatim-geocode-cache.php +0 -0
- includes/open-layers/class.ol-loader.php +0 -0
- includes/php8/class.dom-element.php +718 -0
- includes/tables/class.admin-map-datatable.php +12 -1
- includes/tables/class.admin-marker-datatable.php +0 -0
- includes/tables/class.ajax-table.php +0 -0
- includes/tables/class.datatable.php +0 -0
- includes/tables/class.marker-datatable.php +0 -0
- includes/tables/class.table.php +0 -0
- js/dataTables.responsive.js +0 -0
- js/jquery.dataTables.js +0 -0
- js/jquery.dataTables.min.js +0 -0
- js/legacy/legacy-circle-panel.js +0 -0
- js/legacy/legacy-edit-marker-location-page.js +0 -0
- js/legacy/legacy-polygon-panel.js +0 -0
- js/legacy/legacy-polyline-panel.js +0 -0
- js/legacy/legacy-rectangle-panel.js +0 -0
- js/markerclusterer.js +0 -0
- js/v8/3rd-party-integration/gutenberg/dist/gutenberg.js +0 -0
- js/v8/3rd-party-integration/gutenberg/src/gutenberg.jsx +0 -0
- js/v8/3rd-party-integration/integration.js +0 -0
- js/v8/address-input.js +0 -0
- js/v8/circle.js +0 -0
- js/v8/compatibility.js +0 -0
- js/v8/compatibility/astra-theme-compatibility.js +0 -0
- js/v8/compatibility/google-ui-compatibility.js +0 -0
- js/v8/core.js +0 -0
- js/v8/countries.json +0 -0
- js/v8/css-escape.js +0 -0
- js/v8/distance.js +0 -0
- js/v8/elias-fano.js +0 -0
- js/v8/event-dispatcher.js +0 -0
- js/v8/event.js +0 -0
- js/v8/fancy-controls.js +0 -0
- js/v8/friendly-error.js +0 -0
- js/v8/geocoder.js +0 -0
- js/v8/google-api-error-handler.js +0 -0
- js/v8/google-maps/google-circle.js +0 -0
- js/v8/google-maps/google-geocoder.js +0 -0
- js/v8/google-maps/google-html-overlay.js +0 -0
- js/v8/google-maps/google-info-window.js +0 -0
- js/v8/google-maps/google-map.js +0 -0
- js/v8/google-maps/google-marker.js +0 -0
- js/v8/google-maps/google-modern-store-locator-circle.js +0 -0
- js/v8/google-maps/google-modern-store-locator.js +0 -0
- js/v8/google-maps/google-polygon.js +0 -0
- js/v8/google-maps/google-polyline.js +0 -0
- js/v8/google-maps/google-text-overlay.js +0 -0
- js/v8/google-maps/google-text.js +0 -0
- js/v8/google-maps/google-vertex-context-menu.js +0 -0
- js/v8/info-window.js +3 -1
- js/v8/latlng.js +0 -0
- js/v8/latlngbounds.js +0 -0
- js/v8/map-settings.js +5 -0
- js/v8/map.js +0 -0
- js/v8/maps-engine-dialog.js +0 -0
- js/v8/marker-filter.js +0 -0
- js/v8/marker-panel.js +0 -0
- js/v8/marker.js +0 -0
- js/v8/modern-store-locator-circle.js +0 -0
- js/v8/modern-store-locator.js +0 -0
- js/v8/native-maps-icon.js +0 -0
- js/v8/open-layers/ol-circle.js +0 -0
- js/v8/open-layers/ol-geocoder.js +0 -0
- js/v8/open-layers/ol-info-window.js +0 -0
- js/v8/open-layers/ol-map.js +11 -2
- js/v8/open-layers/ol-marker.js +0 -0
- js/v8/open-layers/ol-modern-store-locator-circle.js +0 -0
- js/v8/open-layers/ol-modern-store-locator.js +0 -0
- js/v8/open-layers/ol-polygon.js +0 -0
- js/v8/open-layers/ol-polyline.js +0 -0
- js/v8/open-layers/ol-text.js +0 -0
- js/v8/polyfills.js +0 -0
- js/v8/polygon.js +0 -0
- js/v8/polyline.js +0 -0
- js/v8/popout-panel.js +0 -0
- js/v8/rest-api.js +0 -0
- js/v8/scripts.json +124 -124
- js/v8/settings-page.js +0 -0
- js/v8/store-locator.js +1 -1
- js/v8/tables/admin-marker-datatable.js +0 -0
- js/v8/tables/datatable.js +0 -0
- js/v8/text.js +0 -0
- js/v8/theme-editor.js +0 -0
- js/v8/theme-panel.js +0 -0
- js/v8/version.js +0 -0
- js/v8/wp-google-maps.combined.js +7553 -7537
- js/v8/wp-google-maps.min.js +1 -1
- languages/datatables/Afrikaans.json +0 -0
- languages/datatables/Albanian.json +0 -0
- languages/datatables/Arabic.json +0 -0
- languages/datatables/Armenian.json +0 -0
- languages/datatables/Azerbaijan.json +0 -0
- languages/datatables/Bangla.json +0 -0
- languages/datatables/Basque.json +0 -0
- languages/datatables/Belarusian.json +0 -0
- languages/datatables/Bulgarian.json +0 -0
- languages/datatables/Catalan.json +0 -0
- languages/datatables/Chinese-traditional.json +0 -0
- languages/datatables/Croatian.json +0 -0
- languages/datatables/Czech.json +0 -0
- languages/datatables/Danish.json +0 -0
- languages/datatables/Dutch.json +0 -0
- languages/datatables/English.json +0 -0
- languages/datatables/Estonian.json +0 -0
- languages/datatables/Filipino.json +0 -0
- languages/datatables/Finnish.json +0 -0
- languages/datatables/French.json +0 -0
- languages/datatables/Galician.json +0 -0
- languages/datatables/Georgian.json +0 -0
- languages/datatables/German.json +0 -0
- languages/datatables/Greek.json +0 -0
- languages/datatables/Gujarati.json +0 -0
- languages/datatables/Hebrew.json +0 -0
- languages/datatables/Hindi.json +0 -0
- languages/datatables/Hungarian.json +0 -0
- languages/datatables/Icelandic.json +0 -0
- languages/datatables/Indonesian-Alternative.json +0 -0
- languages/datatables/Indonesian.json +0 -0
- languages/datatables/Irish.json +0 -0
- languages/datatables/Italian.json +0 -0
- languages/datatables/Japanese.json +0 -0
- languages/datatables/Kazakh.json +0 -0
- languages/datatables/Korean.json +0 -0
- languages/datatables/Kyrgyz.json +0 -0
- languages/datatables/Latvian.json +0 -0
- languages/datatables/Lithuanian.json +0 -0
- languages/datatables/Macedonian.json +0 -0
- languages/datatables/Malay.json +0 -0
- languages/datatables/Mongolian.json +0 -0
- languages/datatables/Nepali.json +0 -0
- languages/datatables/Norwegian-Bokmal.json +0 -0
- languages/datatables/Norwegian-Nynorsk.json +0 -0
- languages/datatables/Pashto.json +0 -0
- languages/datatables/Persian.json +0 -0
- languages/datatables/Polish.json +0 -0
- languages/datatables/Portuguese-Brasil.json +0 -0
- languages/datatables/Romanian.json +0 -0
- languages/datatables/Russian.json +0 -0
- languages/datatables/Serbian.json +0 -0
- languages/datatables/Sinhala.json +0 -0
- languages/datatables/Slovak.json +0 -0
- languages/datatables/Slovenian.json +0 -0
- languages/datatables/Spanish.json +0 -0
- languages/datatables/Swahili.json +0 -0
- languages/datatables/Swedish.json +0 -0
- languages/datatables/Tamil.json +0 -0
- languages/datatables/Thai.json +0 -0
- languages/datatables/Turkish.json +0 -0
- languages/datatables/Ukrainian.json +0 -0
- languages/datatables/Urdu.json +0 -0
- languages/datatables/Uzbek.json +0 -0
- languages/datatables/Vietnamese.json +0 -0
- languages/datatables/Welsh.json +0 -0
- languages/js/dataTables.cs_CZ.txt +0 -0
- languages/js/dataTables.de_DE.txt +0 -0
- languages/js/dataTables.en_GB.txt +0 -0
- languages/js/dataTables.es_ES.txt +0 -0
- languages/js/dataTables.fr_FR.txt +0 -0
- languages/js/dataTables.nl_NL.txt +0 -0
- languages/js/dataTables.ru_RU.txt +0 -0
- languages/js/dataTables.se_SE.txt +0 -0
- languages/js/dataTables.sk_SK.txt +0 -0
- languages/outdated/js/dataTables.cs_CZ.txt +0 -0
- languages/outdated/js/dataTables.de_DE.txt +0 -0
- languages/outdated/js/dataTables.en_GB.txt +0 -0
- languages/outdated/js/dataTables.es_ES.txt +0 -0
- languages/outdated/js/dataTables.fr_FR.txt +0 -0
- languages/outdated/js/dataTables.nl_NL.txt +0 -0
- languages/outdated/js/dataTables.ru_RU.txt +0 -0
- languages/outdated/js/dataTables.se_SE.txt +0 -0
- languages/outdated/js/dataTables.sk_SK.txt +0 -0
- languages/outdated/wp-google-maps-cs_CZ.po +0 -0
- languages/outdated/wp-google-maps-de_DE.po +0 -0
- languages/outdated/wp-google-maps-default.po +0 -0
- languages/outdated/wp-google-maps-es_ES.po +0 -0
- languages/outdated/wp-google-maps-fr_FR.po +0 -0
- languages/outdated/wp-google-maps-it_IT.po +0 -0
- languages/outdated/wp-google-maps-nl_NL.po +0 -0
- languages/outdated/wp-google-maps-ru_RU.po +0 -0
- languages/outdated/wp-google-maps-sv_SE.po +0 -0
- languages/wp-google-maps-bg_BG.po +0 -0
- languages/wp-google-maps-ca.po +0 -0
- languages/wp-google-maps-da_DK.po +0 -0
- languages/wp-google-maps-de_DE.po +0 -0
- languages/wp-google-maps-de_DE_formal.po +0 -0
- languages/wp-google-maps-default.po +0 -0
- languages/wp-google-maps-el_GR.po +0 -0
- languages/wp-google-maps-en_EN.mo +0 -0
- languages/wp-google-maps-en_EN.po +0 -0
- languages/wp-google-maps-es_ES.mo +0 -0
- languages/wp-google-maps-es_ES.po +166 -181
README.md
CHANGED
File without changes
|
base/classes/WPGM_templates.php
CHANGED
File without changes
|
base/classes/widget_module.class.php
CHANGED
File without changes
|
base/includes/credits.php
CHANGED
File without changes
|
base/includes/deprecated.php
CHANGED
File without changes
|
base/includes/full-screen-module.php
CHANGED
File without changes
|
base/includes/welcome.php
CHANGED
File without changes
|
base/includes/wp-google-maps-polygons.php
CHANGED
File without changes
|
base/includes/wp-google-maps-polylines.php
CHANGED
File without changes
|
constants.php
CHANGED
File without changes
|
css/common.css
CHANGED
File without changes
|
css/data_table_front_old.css
CHANGED
File without changes
|
css/font-awesome.css
CHANGED
File without changes
|
css/font-awesome.min.css
CHANGED
File without changes
|
css/gutenberg.css
CHANGED
File without changes
|
css/jquery.dataTables.min.css
CHANGED
File without changes
|
css/open-layers.css
CHANGED
@@ -177,4 +177,8 @@
|
|
177 |
.wpgmza-modern-store-locator>.wpgmza-inner
|
178 |
{
|
179 |
pointer-events: all;
|
|
|
|
|
|
|
|
|
180 |
}
|
177 |
.wpgmza-modern-store-locator>.wpgmza-inner
|
178 |
{
|
179 |
pointer-events: all;
|
180 |
+
}
|
181 |
+
|
182 |
+
.ol-info-window-polygon {
|
183 |
+
bottom: 0 !important;
|
184 |
}
|
css/styles/compact.css
CHANGED
File without changes
|
css/styles/default.css
CHANGED
File without changes
|
css/styles/legacy.css
CHANGED
File without changes
|
css/styles/minimal.css
CHANGED
File without changes
|
css/wp-google-maps-admin.css
CHANGED
@@ -2540,11 +2540,11 @@ input[type="checkbox"] {
|
|
2540 |
input[type="checkbox"]:before {
|
2541 |
color: #2B323C !important;
|
2542 |
}
|
2543 |
-
input[type="checkbox"]:before {
|
2544 |
color: #2B323C !important;
|
2545 |
|
2546 |
color: #fff !important;
|
2547 |
-
}
|
2548 |
input[type="checkbox"]:active,
|
2549 |
input[type="checkbox"]:focus {
|
2550 |
outline: none;
|
@@ -3015,19 +3015,28 @@ div#wpgmza_autoc_disabled {
|
|
3015 |
div#wpgmza_autocomplete_search_results {
|
3016 |
width: auto;
|
3017 |
overflow: auto;
|
3018 |
-
position:
|
3019 |
-
max-height:
|
|
|
3020 |
background-color: #fff;
|
3021 |
border: 1px solid #ccc;
|
3022 |
padding: 5px;
|
3023 |
-
max-width:
|
|
|
3024 |
}
|
|
|
3025 |
.wpgmza_ac_result {
|
3026 |
-
height:
|
3027 |
border-bottom: 1px dashed #ccc;
|
3028 |
margin-top: 8px;
|
3029 |
font-weight: bold;
|
3030 |
cursor:pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
3031 |
}
|
3032 |
|
3033 |
.wpgmza_ac_icon img {
|
@@ -3038,7 +3047,6 @@ div#wpgmza_autocomplete_search_results {
|
|
3038 |
float: left;
|
3039 |
width:10%;
|
3040 |
text-align: center;
|
3041 |
-
margin-top: 5px;
|
3042 |
}
|
3043 |
.wpgmza_ac_item {
|
3044 |
display: block;
|
2540 |
input[type="checkbox"]:before {
|
2541 |
color: #2B323C !important;
|
2542 |
}
|
2543 |
+
/*input[type="checkbox"]:before {
|
2544 |
color: #2B323C !important;
|
2545 |
|
2546 |
color: #fff !important;
|
2547 |
+
}*/
|
2548 |
input[type="checkbox"]:active,
|
2549 |
input[type="checkbox"]:focus {
|
2550 |
outline: none;
|
3015 |
div#wpgmza_autocomplete_search_results {
|
3016 |
width: auto;
|
3017 |
overflow: auto;
|
3018 |
+
position: absolute;
|
3019 |
+
max-height: 200px;
|
3020 |
+
top: 33px;
|
3021 |
background-color: #fff;
|
3022 |
border: 1px solid #ccc;
|
3023 |
padding: 5px;
|
3024 |
+
max-width: 96%;
|
3025 |
+
min-width: 96%;
|
3026 |
}
|
3027 |
+
|
3028 |
.wpgmza_ac_result {
|
3029 |
+
height: fit-content;
|
3030 |
border-bottom: 1px dashed #ccc;
|
3031 |
margin-top: 8px;
|
3032 |
font-weight: bold;
|
3033 |
cursor:pointer;
|
3034 |
+
width: 100%;
|
3035 |
+
display: flex;
|
3036 |
+
}
|
3037 |
+
|
3038 |
+
.wpgmza_ac_container {
|
3039 |
+
width: 100%;
|
3040 |
}
|
3041 |
|
3042 |
.wpgmza_ac_icon img {
|
3047 |
float: left;
|
3048 |
width:10%;
|
3049 |
text-align: center;
|
|
|
3050 |
}
|
3051 |
.wpgmza_ac_item {
|
3052 |
display: block;
|
css/wp-google-maps-full-screen-map.css
CHANGED
File without changes
|
css/wpgmza_style.css
CHANGED
File without changes
|
fonts/fontawesome-webfont.svg
CHANGED
File without changes
|
fonts/glyphicons-halflings-regular.svg
CHANGED
File without changes
|
html/gdpr-compliance-settings.html.php
CHANGED
File without changes
|
html/gdpr-default-notice.html.php
CHANGED
File without changes
|
html/google-maps-api-error-dialog.html.php
CHANGED
File without changes
|
html/google-maps-api-settings.html.php
CHANGED
File without changes
|
html/map-edit-page/map-edit-page.html.php
CHANGED
@@ -414,6 +414,14 @@
|
|
414 |
?>
|
415 |
</small>
|
416 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
</li>
|
418 |
<ul>
|
419 |
</fieldset>
|
@@ -1189,7 +1197,7 @@
|
|
1189 |
</fieldset>
|
1190 |
|
1191 |
|
1192 |
-
<fieldset
|
1193 |
<legend>
|
1194 |
<?php
|
1195 |
_e('Enable Layers', 'wp-google-maps');
|
@@ -1201,7 +1209,7 @@
|
|
1201 |
<input type='checkbox'
|
1202 |
id='wpgmza_bicycle'
|
1203 |
name='bicycle'
|
1204 |
-
class='postform cmn-toggle cmn-toggle-round-flat
|
1205 |
<label for='wpgmza_bicycle'></label>
|
1206 |
<label for='wpgmza_bicycle'>
|
1207 |
<?php
|
@@ -1216,7 +1224,7 @@
|
|
1216 |
<input type='checkbox'
|
1217 |
id='wpgmza_traffic'
|
1218 |
name='traffic'
|
1219 |
-
class='postform cmn-toggle cmn-toggle-round-flat
|
1220 |
<label for='wpgmza_traffic'></label>
|
1221 |
<label for='wpgmza_traffic'>
|
1222 |
<?php
|
@@ -1231,7 +1239,7 @@
|
|
1231 |
<input type='checkbox'
|
1232 |
id='wpgmza_transport'
|
1233 |
name='transport_layer'
|
1234 |
-
class='postform cmn-toggle cmn-toggle-round-flat
|
1235 |
<label for='wpgmza_transport'></label>
|
1236 |
<label for='wpgmza_transport'>
|
1237 |
<?php
|
@@ -2599,12 +2607,12 @@
|
|
2599 |
_e("WP Google Maps encourages you to make use of the amazing icons at ", "wp-google-maps");
|
2600 |
?>
|
2601 |
<a href='https://mappity.org'>https://mappity.org</a>
|
|
|
|
|
|
|
|
|
2602 |
</small>
|
2603 |
</p>
|
2604 |
|
2605 |
|
2606 |
-
</div>
|
2607 |
-
|
2608 |
-
<?php if (get_user_meta( get_current_user_id(), 'wpgmza_hide_chat', true ) == 1 ) {} else { ?>
|
2609 |
-
<a href='https://wpgooglemaps.bleeper.io/' title='Chat with WP Google Maps now' target='_BLANK' class='wpgmza-chat-help'><span id='wpgmzaCloseChat'></span></a>
|
2610 |
-
<?php } ?>
|
414 |
?>
|
415 |
</small>
|
416 |
</p>
|
417 |
+
|
418 |
+
<p class="wpgmza-pro-feature-hide" data-search-area="auto">
|
419 |
+
<small>
|
420 |
+
<?php
|
421 |
+
_e("Marker listings will not be filtered based on visible markers. Enable the 'Only load markers within viewport (beta)' option for beta filtering support", "wp-google-maps");
|
422 |
+
?>
|
423 |
+
</small>
|
424 |
+
</p>
|
425 |
</li>
|
426 |
<ul>
|
427 |
</fieldset>
|
1197 |
</fieldset>
|
1198 |
|
1199 |
|
1200 |
+
<fieldset>
|
1201 |
<legend>
|
1202 |
<?php
|
1203 |
_e('Enable Layers', 'wp-google-maps');
|
1209 |
<input type='checkbox'
|
1210 |
id='wpgmza_bicycle'
|
1211 |
name='bicycle'
|
1212 |
+
class='postform cmn-toggle cmn-toggle-round-flat'>
|
1213 |
<label for='wpgmza_bicycle'></label>
|
1214 |
<label for='wpgmza_bicycle'>
|
1215 |
<?php
|
1224 |
<input type='checkbox'
|
1225 |
id='wpgmza_traffic'
|
1226 |
name='traffic'
|
1227 |
+
class='postform cmn-toggle cmn-toggle-round-flat'>
|
1228 |
<label for='wpgmza_traffic'></label>
|
1229 |
<label for='wpgmza_traffic'>
|
1230 |
<?php
|
1239 |
<input type='checkbox'
|
1240 |
id='wpgmza_transport'
|
1241 |
name='transport_layer'
|
1242 |
+
class='postform cmn-toggle cmn-toggle-round-flat'>
|
1243 |
<label for='wpgmza_transport'></label>
|
1244 |
<label for='wpgmza_transport'>
|
1245 |
<?php
|
2607 |
_e("WP Google Maps encourages you to make use of the amazing icons at ", "wp-google-maps");
|
2608 |
?>
|
2609 |
<a href='https://mappity.org'>https://mappity.org</a>
|
2610 |
+
|
|
2611 |
+
<?php
|
2612 |
+
_e('Translating the plugin with', 'wp-google-maps'); ?>
|
2613 |
+
<a href='https://www.wpgmaps.com/documentation/translating-the-plugin-with-wpml/' target='_BLANK'><?php esc_html_e('WPML', 'wp-google-maps'); ?></a>
|
2614 |
</small>
|
2615 |
</p>
|
2616 |
|
2617 |
|
2618 |
+
</div>
|
|
|
|
|
|
|
|
html/ol-feature-coming-soon.html.php
CHANGED
File without changes
|
html/ol-feature-unavailable.html.php
CHANGED
File without changes
|
html/settings-page.html.php
CHANGED
@@ -99,6 +99,13 @@
|
|
99 |
</div>
|
100 |
</label>
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
<label>
|
103 |
<div>
|
104 |
<input name="wpgmza_settings_map_scroll" class="wpgmza-fancy-toggle-switch" type="checkbox"/>
|
@@ -119,6 +126,7 @@
|
|
119 |
<?php esc_html_e('Disable Mouse Double Click Zooming', 'wp-google-maps'); ?>
|
120 |
</div>
|
121 |
</label>
|
|
|
122 |
</div>
|
123 |
</fieldset>
|
124 |
|
@@ -292,14 +300,14 @@
|
|
292 |
?>
|
293 |
</option>
|
294 |
|
295 |
-
<option value="
|
296 |
-
data-preview-image="
|
297 |
<?php
|
298 |
_e('OpenCycleMap', 'wp-google-maps');
|
299 |
?>
|
300 |
</option>
|
301 |
|
302 |
-
<option value="
|
303 |
data-preview-image="https://wiki.openstreetmap.org/w/images/6/63/Humanitarian_style.png">
|
304 |
<?php
|
305 |
_e('Humanitarian', 'wp-google-maps');
|
@@ -307,63 +315,63 @@
|
|
307 |
</option>
|
308 |
|
309 |
<option value="https://{a-c}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png"
|
310 |
-
data-preview-image="
|
311 |
<?php
|
312 |
_e('Mapnik OSM B&W', 'wp-google-maps');
|
313 |
?>
|
314 |
</option>
|
315 |
|
316 |
<option value="https://tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png"
|
317 |
-
data-preview-image="
|
318 |
<?php
|
319 |
_e('Mapnik OSM No Labels', 'wp-google-maps');
|
320 |
?>
|
321 |
</option>
|
322 |
|
323 |
-
<option value="
|
324 |
-
data-preview-image="
|
325 |
<?php
|
326 |
_e('Stamen Toner', 'wp-google-maps');
|
327 |
?>
|
328 |
</option>
|
329 |
|
330 |
-
<option value="
|
331 |
data-preview-image="https://wiki.openstreetmap.org/w/images/d/d2/Tile_watercolor_stamen.jpg">
|
332 |
<?php
|
333 |
_e('Stamen Watercolor', 'wp-google-maps');
|
334 |
?>
|
335 |
</option>
|
336 |
|
337 |
-
<option value="
|
338 |
-
data-preview-image="
|
339 |
<?php
|
340 |
_e('Transport Map', 'wp-google-maps');
|
341 |
?>
|
342 |
</option>
|
343 |
|
344 |
-
<option value="
|
345 |
-
data-preview-image="
|
346 |
<?php
|
347 |
_e('Thunderforest Landscape', 'wp-google-maps');
|
348 |
?>
|
349 |
</option>
|
350 |
|
351 |
-
<option value="
|
352 |
-
data-preview-image="
|
353 |
<?php
|
354 |
_e('Thunderforest Outdoors', 'wp-google-maps');
|
355 |
?>
|
356 |
</option>
|
357 |
|
358 |
-
<option value="
|
359 |
-
data-preview-image="
|
360 |
<?php
|
361 |
_e('Öpnvkarte', 'wp-google-maps');
|
362 |
?>
|
363 |
</option>
|
364 |
|
365 |
-
<option value="
|
366 |
-
data-preview-image="
|
367 |
<?php
|
368 |
_e('OpenPtMap', 'wp-google-maps');
|
369 |
?>
|
@@ -1323,7 +1331,7 @@
|
|
1323 |
</label>
|
1324 |
</p>
|
1325 |
<p> </p>
|
1326 |
-
<p>
|
1327 |
<label>
|
1328 |
<button danger="wpgmza_destroy_maps" name="wpgmza_destroy_data" class="wpgmza_destroy_data wpgmza_general_btn button button-secondary">Delete all maps</button>
|
1329 |
|
@@ -1582,7 +1590,4 @@
|
|
1582 |
</button>
|
1583 |
</p>
|
1584 |
|
1585 |
-
</form>
|
1586 |
-
<?php if (get_user_meta( get_current_user_id(), 'wpgmza_hide_chat', true ) == 1 ) {} else { ?>
|
1587 |
-
<a href='https://wpgooglemaps.bleeper.io/' title='Chat with WP Google Maps now' target='_BLANK' class='wpgmza-chat-help'><span id='wpgmzaCloseChat'></span></a>
|
1588 |
-
<?php } ?>
|
99 |
</div>
|
100 |
</label>
|
101 |
|
102 |
+
<label data-required-maps-engine="google-maps">
|
103 |
+
<div>
|
104 |
+
<input name="wpgmza_settings_map_tilt_controls" class="wpgmza-fancy-toggle-switch" type="checkbox"/>
|
105 |
+
<?php esc_html_e('Disable Tilt Controls', 'wp-google-maps'); ?>
|
106 |
+
</div>
|
107 |
+
</label>
|
108 |
+
|
109 |
<label>
|
110 |
<div>
|
111 |
<input name="wpgmza_settings_map_scroll" class="wpgmza-fancy-toggle-switch" type="checkbox"/>
|
126 |
<?php esc_html_e('Disable Mouse Double Click Zooming', 'wp-google-maps'); ?>
|
127 |
</div>
|
128 |
</label>
|
129 |
+
|
130 |
</div>
|
131 |
</fieldset>
|
132 |
|
300 |
?>
|
301 |
</option>
|
302 |
|
303 |
+
<option value="https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png"
|
304 |
+
data-preview-image="https://b.tile.opencyclemap.org/cycle/16/33199/22539.png">
|
305 |
<?php
|
306 |
_e('OpenCycleMap', 'wp-google-maps');
|
307 |
?>
|
308 |
</option>
|
309 |
|
310 |
+
<option value="https://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png"
|
311 |
data-preview-image="https://wiki.openstreetmap.org/w/images/6/63/Humanitarian_style.png">
|
312 |
<?php
|
313 |
_e('Humanitarian', 'wp-google-maps');
|
315 |
</option>
|
316 |
|
317 |
<option value="https://{a-c}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png"
|
318 |
+
data-preview-image="https://a.www.toolserver.org/tiles/bw-mapnik/9/264/179.png">
|
319 |
<?php
|
320 |
_e('Mapnik OSM B&W', 'wp-google-maps');
|
321 |
?>
|
322 |
</option>
|
323 |
|
324 |
<option value="https://tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png"
|
325 |
+
data-preview-image="https://c.tiles.wmflabs.org/osm-no-labels/14/7452/6839.png">
|
326 |
<?php
|
327 |
_e('Mapnik OSM No Labels', 'wp-google-maps');
|
328 |
?>
|
329 |
</option>
|
330 |
|
331 |
+
<option value="https://a.tile.stamen.com/toner/{z}/{x}/{y}.png"
|
332 |
+
data-preview-image="https://a.tile.stamen.com/toner/10/529/366.png">
|
333 |
<?php
|
334 |
_e('Stamen Toner', 'wp-google-maps');
|
335 |
?>
|
336 |
</option>
|
337 |
|
338 |
+
<option value="https://c.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg"
|
339 |
data-preview-image="https://wiki.openstreetmap.org/w/images/d/d2/Tile_watercolor_stamen.jpg">
|
340 |
<?php
|
341 |
_e('Stamen Watercolor', 'wp-google-maps');
|
342 |
?>
|
343 |
</option>
|
344 |
|
345 |
+
<option value="https://tile.thunderforest.com/transport/{z}/{x}/{y}.png"
|
346 |
+
data-preview-image="https://a.tile2.opencyclemap.org/transport/13/4150/2819.png">
|
347 |
<?php
|
348 |
_e('Transport Map', 'wp-google-maps');
|
349 |
?>
|
350 |
</option>
|
351 |
|
352 |
+
<option value="https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png"
|
353 |
+
data-preview-image="https://a.tile.thunderforest.com/landscape/14/4773/6144.png">
|
354 |
<?php
|
355 |
_e('Thunderforest Landscape', 'wp-google-maps');
|
356 |
?>
|
357 |
</option>
|
358 |
|
359 |
+
<option value="https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png"
|
360 |
+
data-preview-image="https://a.tile.thunderforest.com/outdoors/14/4772/6144.png">
|
361 |
<?php
|
362 |
_e('Thunderforest Outdoors', 'wp-google-maps');
|
363 |
?>
|
364 |
</option>
|
365 |
|
366 |
+
<option value="https://tile.memomaps.de/tilegen/{z}/{x}/{y}.png"
|
367 |
+
data-preview-image="https://tile.memomaps.de/tilegen/12/2200/1343.png">
|
368 |
<?php
|
369 |
_e('Öpnvkarte', 'wp-google-maps');
|
370 |
?>
|
371 |
</option>
|
372 |
|
373 |
+
<option value="https://www.openptmap.org/tiles/{z}/{x}/{y}.png"
|
374 |
+
data-preview-image="https://www.openptmap.org/tiles//10/529/366.png">
|
375 |
<?php
|
376 |
_e('OpenPtMap', 'wp-google-maps');
|
377 |
?>
|
1331 |
</label>
|
1332 |
</p>
|
1333 |
<p> </p>
|
1334 |
+
<p class="wpgmza-pro-feature-hide">
|
1335 |
<label>
|
1336 |
<button danger="wpgmza_destroy_maps" name="wpgmza_destroy_data" class="wpgmza_destroy_data wpgmza_general_btn button button-secondary">Delete all maps</button>
|
1337 |
|
1590 |
</button>
|
1591 |
</p>
|
1592 |
|
1593 |
+
</form>
|
|
|
|
|
|
html/store-locator.html.php
CHANGED
File without changes
|
html/theme-panel.html.php
CHANGED
File without changes
|
html/tile-server-fieldset.html.php
CHANGED
File without changes
|
images/marker_iw_type_inherit.png
CHANGED
File without changes
|
images/wpgoogle-maps-chat-help162x42v4.png
CHANGED
File without changes
|
includes/3rd-party-integration/class.gutenberg.php
CHANGED
File without changes
|
includes/3rd-party-integration/class.wp-migrate-db-integration.php
CHANGED
File without changes
|
includes/build.log
CHANGED
File without changes
|
includes/class.auto-loader.php
CHANGED
@@ -79,7 +79,8 @@ class AutoLoader
|
|
79 |
for (;$i<count($tokens);$i++) {
|
80 |
if ($tokens[$i][0] === T_NAMESPACE) {
|
81 |
for ($j=$i+1;$j<count($tokens); $j++) {
|
82 |
-
|
|
|
83 |
$namespace .= '\\'.$tokens[$j][1];
|
84 |
} else if ($tokens[$j] === '{' || $tokens[$j] === ';') {
|
85 |
break;
|
@@ -121,12 +122,40 @@ class AutoLoader
|
|
121 |
$iter = new \RecursiveIteratorIterator($dir);
|
122 |
$regex = new \RegexIterator($iter, '/^.+(\.php)$/i', \RecursiveRegexIterator::GET_MATCH);
|
123 |
|
|
|
124 |
foreach($regex as $m) {
|
125 |
$file = $m[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
$classes = $this->getClassesInFile($file);
|
127 |
$results[$file] = $classes;
|
128 |
}
|
129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
return $results;
|
131 |
}
|
132 |
|
79 |
for (;$i<count($tokens);$i++) {
|
80 |
if ($tokens[$i][0] === T_NAMESPACE) {
|
81 |
for ($j=$i+1;$j<count($tokens); $j++) {
|
82 |
+
/* We need to be sure 'T_NAME_QUALIFIED' is defined before testing it */
|
83 |
+
if ($tokens[$j][0] === T_STRING || (defined('T_NAME_QUALIFIED') && $tokens[$j][0] === T_NAME_QUALIFIED)) {
|
84 |
$namespace .= '\\'.$tokens[$j][1];
|
85 |
} else if ($tokens[$j] === '{' || $tokens[$j] === ';') {
|
86 |
break;
|
122 |
$iter = new \RecursiveIteratorIterator($dir);
|
123 |
$regex = new \RegexIterator($iter, '/^.+(\.php)$/i', \RecursiveRegexIterator::GET_MATCH);
|
124 |
|
125 |
+
$phpVersionFiles = array();
|
126 |
foreach($regex as $m) {
|
127 |
$file = $m[0];
|
128 |
+
|
129 |
+
$dir = basename(dirname($file));
|
130 |
+
$filename = basename($file);
|
131 |
+
|
132 |
+
if(strpos($dir, 'php') !== FALSE){
|
133 |
+
if(version_compare(phpversion(), str_replace('php', '', $dir), '>=')){
|
134 |
+
$phpVersionFiles[] = $filename;
|
135 |
+
} else {
|
136 |
+
/* Environment doesn't support this PHP version */
|
137 |
+
continue;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
|
141 |
$classes = $this->getClassesInFile($file);
|
142 |
$results[$file] = $classes;
|
143 |
}
|
144 |
+
|
145 |
+
/* Unload any version dependent classes, example: below V8 PHP */
|
146 |
+
/* Note: There are definitely better ways to go about this, but for now, this will help users on V8 PHP */
|
147 |
+
if(!empty($phpVersionFiles)){
|
148 |
+
foreach($phpVersionFiles as $file){
|
149 |
+
foreach($results as $comparison => $class){
|
150 |
+
$dir = basename(dirname($comparison));
|
151 |
+
$filename = basename($comparison);
|
152 |
+
if($filename === $file && strpos($dir, 'php') === FALSE){
|
153 |
+
unset($results[$comparison]);
|
154 |
+
}
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
return $results;
|
160 |
}
|
161 |
|
includes/class.crud.php
CHANGED
File without changes
|
includes/class.database.php
CHANGED
File without changes
|
includes/class.distance.php
CHANGED
File without changes
|
includes/class.dom-document.php
CHANGED
@@ -5,7 +5,20 @@ namespace WPGMZA;
|
|
5 |
if(!defined('ABSPATH'))
|
6 |
return;
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
class DOMDocument extends \DOMDocument
|
11 |
{
|
5 |
if(!defined('ABSPATH'))
|
6 |
return;
|
7 |
|
8 |
+
/**
|
9 |
+
* We don't actually need to be callin require once here at all
|
10 |
+
*
|
11 |
+
* The autoloader works fine, but because it was rebuilt in some ways for PHP8
|
12 |
+
*
|
13 |
+
* We will leave it as it, with a conditional PHP8 brach for now
|
14 |
+
*
|
15 |
+
* Expect this to be removed more fully soon
|
16 |
+
*/
|
17 |
+
if(version_compare(phpversion(), '8.0', '>=')){
|
18 |
+
require_once(plugin_dir_path(__FILE__) . 'php8/class.dom-element.php');
|
19 |
+
} else {
|
20 |
+
require_once(plugin_dir_path(__FILE__) . 'class.dom-element.php');
|
21 |
+
}
|
22 |
|
23 |
class DOMDocument extends \DOMDocument
|
24 |
{
|
includes/class.dom-element.php
CHANGED
File without changes
|
includes/class.dom-query-results.php
CHANGED
File without changes
|
includes/class.dynamic-translations.php
CHANGED
File without changes
|
includes/class.elias-fano.php
CHANGED
File without changes
|
includes/class.factory.php
CHANGED
File without changes
|
includes/class.feature.php
CHANGED
@@ -35,8 +35,12 @@ class Feature extends Crud
|
|
35 |
if(Feature::$cachedSubclasses)
|
36 |
return Feature::$cachedSubclasses;
|
37 |
|
38 |
-
foreach(glob(__DIR__ . '/*.php') as $file)
|
|
|
|
|
|
|
39 |
require_once($file);
|
|
|
40 |
|
41 |
do_action('wpgmza_require_feature_classes');
|
42 |
|
35 |
if(Feature::$cachedSubclasses)
|
36 |
return Feature::$cachedSubclasses;
|
37 |
|
38 |
+
foreach(glob(__DIR__ . '/*.php') as $file){
|
39 |
+
if(basename($file) === 'class.dom-element.php'){
|
40 |
+
continue;
|
41 |
+
}
|
42 |
require_once($file);
|
43 |
+
}
|
44 |
|
45 |
do_action('wpgmza_require_feature_classes');
|
46 |
|
includes/class.gdpr-compliance.php
CHANGED
@@ -89,7 +89,7 @@ class GDPRCompliance
|
|
89 |
$document = apply_filters('wpgmza_gdpr_settings_tab_content', $document);
|
90 |
|
91 |
$document->populate($settings);
|
92 |
-
|
93 |
return $document;
|
94 |
}
|
95 |
|
89 |
$document = apply_filters('wpgmza_gdpr_settings_tab_content', $document);
|
90 |
|
91 |
$document->populate($settings);
|
92 |
+
|
93 |
return $document;
|
94 |
}
|
95 |
|
includes/class.global-settings.php
CHANGED
File without changes
|
includes/class.google-maps-api-loader.php
CHANGED
@@ -328,7 +328,20 @@ class GoogleMapsAPILoader
|
|
328 |
|
329 |
return false;
|
330 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
}
|
|
|
332 |
|
333 |
if(!empty($settings['wpgmza_load_engine_api_condition']))
|
334 |
switch($settings['wpgmza_load_engine_api_condition'])
|
@@ -406,7 +419,9 @@ class GoogleMapsAPILoader
|
|
406 |
global $wpgmza;
|
407 |
|
408 |
// Load our subclass of PHPs DOMDocument, for the populate function
|
409 |
-
|
|
|
|
|
410 |
|
411 |
// Load HTML
|
412 |
$document = new DOMDocument();
|
328 |
|
329 |
return false;
|
330 |
}
|
331 |
+
|
332 |
+
if(is_admin() && !empty($post->post_type)){
|
333 |
+
/**
|
334 |
+
* V9 Will move away from this switch, and instead use an array with a filter for devs to extend further as needed
|
335 |
+
*/
|
336 |
+
switch($post->post_type){
|
337 |
+
case 'wpsl_stores';
|
338 |
+
$status->message = 'Page is explicitly excluded in settings';
|
339 |
+
$status->code = GoogleMapsAPILoader::PAGE_EXPLICITLY_EXCLUDED;
|
340 |
+
return false;
|
341 |
+
}
|
342 |
+
}
|
343 |
}
|
344 |
+
|
345 |
|
346 |
if(!empty($settings['wpgmza_load_engine_api_condition']))
|
347 |
switch($settings['wpgmza_load_engine_api_condition'])
|
419 |
global $wpgmza;
|
420 |
|
421 |
// Load our subclass of PHPs DOMDocument, for the populate function
|
422 |
+
if(!version_compare(phpversion(), '8.0', '>=')){
|
423 |
+
require_once(plugin_dir_path(__FILE__) . 'class.dom-document.php');
|
424 |
+
}
|
425 |
|
426 |
// Load HTML
|
427 |
$document = new DOMDocument();
|
includes/class.integrity-checker.php
CHANGED
File without changes
|
includes/class.latlng.php
CHANGED
File without changes
|
includes/class.map.php
CHANGED
File without changes
|
includes/class.maps-engine-dialog.php
CHANGED
File without changes
|
includes/class.marker-filter.php
CHANGED
File without changes
|
includes/class.marker.php
CHANGED
File without changes
|
includes/class.modal-dialog.php
CHANGED
File without changes
|
includes/class.plugin.php
CHANGED
@@ -8,6 +8,7 @@ if(!defined('ABSPATH'))
|
|
8 |
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/class.auto-loader.php');
|
9 |
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/class.gdpr-compliance.php');
|
10 |
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/3rd-party-integration/class.wp-migrate-db-integration.php');
|
|
|
11 |
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/open-layers/class.nominatim-geocode-cache.php');
|
12 |
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/class.maps-engine-dialog.php');
|
13 |
|
@@ -129,7 +130,7 @@ class Plugin extends Factory
|
|
129 |
if(is_admin())
|
130 |
{
|
131 |
// Admin UI
|
132 |
-
$this->_adminUI =
|
133 |
|
134 |
// XML admin notices for when XML cache generation nears execution time limit or memory limit
|
135 |
if($this->settings->wpgmza_settings_marker_pull == '1' && !file_exists($this->getXMLCacheDirPath()))
|
8 |
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/class.auto-loader.php');
|
9 |
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/class.gdpr-compliance.php');
|
10 |
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/3rd-party-integration/class.wp-migrate-db-integration.php');
|
11 |
+
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/3rd-party-integration/class.gutenberg.php');
|
12 |
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/open-layers/class.nominatim-geocode-cache.php');
|
13 |
wpgmza_require_once(WPGMZA_PLUGIN_DIR_PATH . 'includes/class.maps-engine-dialog.php');
|
14 |
|
130 |
if(is_admin())
|
131 |
{
|
132 |
// Admin UI
|
133 |
+
$this->_adminUI = UI\Admin::createInstance();
|
134 |
|
135 |
// XML admin notices for when XML cache generation nears execution time limit or memory limit
|
136 |
if($this->settings->wpgmza_settings_marker_pull == '1' && !file_exists($this->getXMLCacheDirPath()))
|
includes/class.query-fragment.php
CHANGED
File without changes
|
includes/class.query.php
CHANGED
File without changes
|
includes/class.rest-api.php
CHANGED
File without changes
|
includes/class.script-loader.php
CHANGED
@@ -469,7 +469,7 @@ class ScriptLoader
|
|
469 |
|
470 |
if(!$forceLoad && !$wpgmza->getCurrentPage())
|
471 |
return; // NB: Not forcing a load, and not on a map page.
|
472 |
-
|
473 |
// wp_enqueue_style('wpgmza-color-picker', plugin_dir_url(__DIR__) . 'lib/spectrum.css');
|
474 |
// wp_enqueue_style('datatables', '//cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css');
|
475 |
|
@@ -512,9 +512,10 @@ class ScriptLoader
|
|
512 |
}
|
513 |
|
514 |
// Legacy stylesheets
|
515 |
-
if(is_admin())
|
516 |
wp_enqueue_style('wpgmza_admin', $base . "css/wp-google-maps-admin.css", array(), $version_string);
|
517 |
wp_enqueue_style('editor-buttons');
|
|
|
518 |
|
519 |
|
520 |
}
|
@@ -767,13 +768,16 @@ class ScriptLoader
|
|
767 |
public function enqueueLocalizedData() {
|
768 |
global $wpgmza;
|
769 |
|
770 |
-
$
|
|
|
|
|
|
|
|
|
771 |
|
772 |
-
wp_localize_script('wpgmza', 'WPGMZA_localized_data', $data);
|
773 |
}
|
774 |
|
775 |
public function enqueueCustomJS() {
|
776 |
-
if (!is_admin()) {
|
777 |
global $wpgmza;
|
778 |
$globalSettings = get_option('wpgmza_global_settings');
|
779 |
if(empty($globalSettings))
|
@@ -784,13 +788,14 @@ class ScriptLoader
|
|
784 |
|
785 |
if (!empty($globalSettings->wpgmza_custom_js)) {
|
786 |
wp_add_inline_script( 'wpgmza', stripslashes( $globalSettings->wpgmza_custom_js ) );
|
|
|
787 |
}
|
788 |
}
|
789 |
}
|
790 |
|
791 |
|
792 |
public function enqueueCustomCSS() {
|
793 |
-
if (!is_admin()) {
|
794 |
global $wpgmza;
|
795 |
$globalSettings = get_option('wpgmza_global_settings');
|
796 |
if(empty($globalSettings))
|
@@ -800,8 +805,8 @@ class ScriptLoader
|
|
800 |
return false;
|
801 |
|
802 |
if (!empty($globalSettings->wpgmza_custom_css)) {
|
803 |
-
|
804 |
wp_add_inline_style( 'wpgmza-common', stripslashes( $globalSettings->wpgmza_custom_css ) );
|
|
|
805 |
}
|
806 |
}
|
807 |
}
|
469 |
|
470 |
if(!$forceLoad && !$wpgmza->getCurrentPage())
|
471 |
return; // NB: Not forcing a load, and not on a map page.
|
472 |
+
|
473 |
// wp_enqueue_style('wpgmza-color-picker', plugin_dir_url(__DIR__) . 'lib/spectrum.css');
|
474 |
// wp_enqueue_style('datatables', '//cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css');
|
475 |
|
512 |
}
|
513 |
|
514 |
// Legacy stylesheets
|
515 |
+
if(is_admin() && !empty($wpgmza->getCurrentPage())){
|
516 |
wp_enqueue_style('wpgmza_admin', $base . "css/wp-google-maps-admin.css", array(), $version_string);
|
517 |
wp_enqueue_style('editor-buttons');
|
518 |
+
}
|
519 |
|
520 |
|
521 |
}
|
768 |
public function enqueueLocalizedData() {
|
769 |
global $wpgmza;
|
770 |
|
771 |
+
if(empty($this->localizedDataLoaded)){
|
772 |
+
$data = $wpgmza->getLocalizedData();
|
773 |
+
wp_localize_script('wpgmza', 'WPGMZA_localized_data', $data);
|
774 |
+
$this->localizedDataLoaded = true;
|
775 |
+
}
|
776 |
|
|
|
777 |
}
|
778 |
|
779 |
public function enqueueCustomJS() {
|
780 |
+
if (!is_admin() && empty($this->customJSLoaded)) {
|
781 |
global $wpgmza;
|
782 |
$globalSettings = get_option('wpgmza_global_settings');
|
783 |
if(empty($globalSettings))
|
788 |
|
789 |
if (!empty($globalSettings->wpgmza_custom_js)) {
|
790 |
wp_add_inline_script( 'wpgmza', stripslashes( $globalSettings->wpgmza_custom_js ) );
|
791 |
+
$this->customJSLoaded = true;
|
792 |
}
|
793 |
}
|
794 |
}
|
795 |
|
796 |
|
797 |
public function enqueueCustomCSS() {
|
798 |
+
if (!is_admin() && empty($this->customCSSLoaded)) {
|
799 |
global $wpgmza;
|
800 |
$globalSettings = get_option('wpgmza_global_settings');
|
801 |
if(empty($globalSettings))
|
805 |
return false;
|
806 |
|
807 |
if (!empty($globalSettings->wpgmza_custom_css)) {
|
|
|
808 |
wp_add_inline_style( 'wpgmza-common', stripslashes( $globalSettings->wpgmza_custom_css ) );
|
809 |
+
$this->customCSSLoaded = true;
|
810 |
}
|
811 |
}
|
812 |
}
|
includes/class.selector-to-xpath.php
CHANGED
File without changes
|
includes/class.settings-page.php
CHANGED
File without changes
|
includes/class.settings.php
CHANGED
File without changes
|
includes/class.store-locator.php
CHANGED
File without changes
|
includes/class.strings.php
CHANGED
File without changes
|
includes/class.theme-panel.php
CHANGED
File without changes
|
includes/class.upgrader.php
CHANGED
@@ -30,6 +30,20 @@ class Upgrader
|
|
30 |
add_action('init', array($this, 'migrateCircleData'), 1, 11);
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
public function migrateV7SpatialData()
|
30 |
add_action('init', array($this, 'migrateCircleData'), 1, 11);
|
31 |
}
|
32 |
|
33 |
+
if(version_compare($fromVersion, '8.1.12', '<')){
|
34 |
+
add_action('init', array($this, 'removeMarkerLngLatColumn'), 1, 11);
|
35 |
+
}
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
public function removeMarkerLngLatColumn(){
|
40 |
+
global $wpgmza;
|
41 |
+
global $wpdb;
|
42 |
+
global $wpgmza_tblname;
|
43 |
+
|
44 |
+
if($wpdb->get_var("SHOW COLUMNS FROM ".$wpgmza_tblname." LIKE 'lnglat'")){
|
45 |
+
$wpdb->query('ALTER TABLE '.$wpgmza_tblname.' DROP COLUMN lnglat');
|
46 |
+
}
|
47 |
}
|
48 |
|
49 |
public function migrateV7SpatialData()
|
includes/compat/backwards_compat_v6.php
CHANGED
File without changes
|
includes/compat/class.pro-7-compatibility.php
CHANGED
File without changes
|
includes/compat/js/backwards_compat_user_v6.js
CHANGED
File without changes
|
includes/compat/js/backwards_compat_v6.js
CHANGED
File without changes
|
includes/google-maps/class.google-geocoder.php
CHANGED
File without changes
|
includes/google-maps/class.google-map.php
CHANGED
File without changes
|
includes/google-maps/class.google-maps-loader.php
CHANGED
File without changes
|
includes/legacy/functions.circle.php
CHANGED
File without changes
|
includes/legacy/functions.rectangle.php
CHANGED
File without changes
|
includes/legacy/settings-page.php
CHANGED
File without changes
|
includes/map-edit-page/class.map-edit-page.php
CHANGED
@@ -178,7 +178,7 @@ class MapEditPage extends Page
|
|
178 |
|
179 |
|
180 |
|
181 |
-
public function createMapPage() {
|
182 |
if (isset($_GET) && $_GET['action'] == 'create-map-page' && isset($_GET['map_id'])) {
|
183 |
|
184 |
// NB: Suggest using $this->map->id, global functions should be dropped
|
@@ -312,6 +312,11 @@ class MapEditPage extends Page
|
|
312 |
// Don't write "redirect_to" to the map settings
|
313 |
foreach($ignore as $key)
|
314 |
unset($data[$key]);
|
|
|
|
|
|
|
|
|
|
|
315 |
|
316 |
// Fill out the form
|
317 |
$this->form->populate($data);
|
178 |
|
179 |
|
180 |
|
181 |
+
public static function createMapPage() {
|
182 |
if (isset($_GET) && $_GET['action'] == 'create-map-page' && isset($_GET['map_id'])) {
|
183 |
|
184 |
// NB: Suggest using $this->map->id, global functions should be dropped
|
312 |
// Don't write "redirect_to" to the map settings
|
313 |
foreach($ignore as $key)
|
314 |
unset($data[$key]);
|
315 |
+
|
316 |
+
// Patch for XSS report (Will be rebuilt later)
|
317 |
+
if(!empty($data['map_title'])){
|
318 |
+
$data['map_title'] = sanitize_text_field($data['map_title']);
|
319 |
+
}
|
320 |
|
321 |
// Fill out the form
|
322 |
$this->form->populate($data);
|
includes/open-layers/class.nominatim-geocode-cache.php
CHANGED
File without changes
|
includes/open-layers/class.ol-loader.php
CHANGED
File without changes
|
includes/php8/class.dom-element.php
ADDED
@@ -0,0 +1,718 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPGMZA;
|
4 |
+
|
5 |
+
if(!defined('ABSPATH'))
|
6 |
+
return;
|
7 |
+
|
8 |
+
require_once(plugin_dir_path(__FILE__) . '../class.selector-to-xpath.php');
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Direct replacement for the defauly class.dom-element.php
|
12 |
+
*
|
13 |
+
* Due to the fact it is located in the php8 sub directory, we will only load it for PHP 8 users
|
14 |
+
*/
|
15 |
+
class DOMElement extends \DOMElement
|
16 |
+
{
|
17 |
+
protected static $xpathConverter;
|
18 |
+
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
\DOMElement::__construct();
|
22 |
+
}
|
23 |
+
|
24 |
+
public function __get($name)
|
25 |
+
{
|
26 |
+
switch($name)
|
27 |
+
{
|
28 |
+
case "html":
|
29 |
+
|
30 |
+
return $this->ownerDocument->saveHTML( $this );
|
31 |
+
|
32 |
+
break;
|
33 |
+
}
|
34 |
+
|
35 |
+
return \DOMElement::__get($name);
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Runs a CSS selector on the element. This is equivilant to Javascripts querySelector
|
40 |
+
* @param string $query a CSS selector
|
41 |
+
* @return mixed The first descendant element that matches the selector, or NULL if there is no match
|
42 |
+
*/
|
43 |
+
public function querySelector($query)
|
44 |
+
{
|
45 |
+
$results = $this->querySelectorAll($query);
|
46 |
+
|
47 |
+
if(empty($results))
|
48 |
+
return null;
|
49 |
+
|
50 |
+
return $results[0];
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Runs a CSS selector on the element. This is equivilant to Javascripts querySelectorAll
|
55 |
+
* @return mixed Any descendant element's that match the selector, or NULL if there is no match
|
56 |
+
*/
|
57 |
+
public function querySelectorAll($query, $sort=true)
|
58 |
+
{
|
59 |
+
$xpath = new \DOMXPath($this->ownerDocument);
|
60 |
+
|
61 |
+
try{
|
62 |
+
$expr = DOMElement::selectorToXPath($query);
|
63 |
+
}catch(Exception $e) {
|
64 |
+
echo "<p class='notice notice-warning'>Failed to convert CSS selector to XPath (" . $e->getMessage() . ")</p>";
|
65 |
+
}
|
66 |
+
|
67 |
+
$list = $xpath->query($expr, $this);
|
68 |
+
$results = array();
|
69 |
+
|
70 |
+
for($i = 0; $i < $list->length; $i++)
|
71 |
+
array_push($results, $list->item($i));
|
72 |
+
|
73 |
+
if($sort)
|
74 |
+
usort($results, array('WPGMZA\DOMElement', 'sortByDOMPosition'));
|
75 |
+
|
76 |
+
return new DOMQueryResults($results);
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Traverses from this node up it's ancestors and returns the first node that matches the given selector
|
81 |
+
* @param mixed $selector Either this node the first ancestor that matches this selector, or NULL if no match is found
|
82 |
+
*/
|
83 |
+
public function closest($selector)
|
84 |
+
{
|
85 |
+
if($this === $this->ownerDocument->getDocumentElementSafe())
|
86 |
+
throw new \Exception('Method not valid on document element');
|
87 |
+
|
88 |
+
for($el = $this; $el->parentNode != null; $el = $el->parentNode)
|
89 |
+
{
|
90 |
+
$m = $el->parentNode->querySelectorAll($selector);
|
91 |
+
if(array_search($el, $m, true) !== false)
|
92 |
+
return $el;
|
93 |
+
}
|
94 |
+
|
95 |
+
return null;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Wraps this element in the element passed in, then replaces this nodes original position
|
100 |
+
* @param DOMElement The element to wrap this element in
|
101 |
+
*/
|
102 |
+
public function wrap($wrapper)
|
103 |
+
{
|
104 |
+
$this->parentNode->replaceChild($wrapper, $this);
|
105 |
+
$wrapper->appendChild($this);
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Test if this element comes before the other element in the DOM tree
|
110 |
+
* @return boolean TRUE if this element comes before the other, FALSE if not
|
111 |
+
*/
|
112 |
+
public function isBefore($other)
|
113 |
+
{
|
114 |
+
if($this->parentNode === $other->parentNode)
|
115 |
+
return ($this->getBreadth() < $other->getBreadth());
|
116 |
+
|
117 |
+
$this_depth = $this->getDepth();
|
118 |
+
$other_depth = $other->getDepth();
|
119 |
+
|
120 |
+
if($this_depth == $other_depth)
|
121 |
+
return $this->parentNode->isBefore($other->parentNode);
|
122 |
+
|
123 |
+
if($this_depth > $other_depth)
|
124 |
+
{
|
125 |
+
$ancestor = $this;
|
126 |
+
$ancestor_depth = $this_depth;
|
127 |
+
|
128 |
+
while($ancestor_depth > $other_depth)
|
129 |
+
{
|
130 |
+
$ancestor = $ancestor->parentNode;
|
131 |
+
$ancestor_depth--;
|
132 |
+
}
|
133 |
+
|
134 |
+
return $ancestor->isBefore($other);
|
135 |
+
}
|
136 |
+
|
137 |
+
if($this_depth < $other_depth)
|
138 |
+
{
|
139 |
+
$ancestor = $other;
|
140 |
+
$ancestor_depth = $other_depth;
|
141 |
+
|
142 |
+
while($ancestor_depth > $this_depth)
|
143 |
+
{
|
144 |
+
$ancestor = $ancestor->parentNode;
|
145 |
+
$ancestor_depth--;
|
146 |
+
}
|
147 |
+
|
148 |
+
return $this->isBefore($ancestor);
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Returns the breadth (sometimes called child index) of this node in regards to it's siblings
|
154 |
+
* @return int The index of this node
|
155 |
+
*/
|
156 |
+
public function getBreadth()
|
157 |
+
{
|
158 |
+
$breadth = 0;
|
159 |
+
for($node = $this->previousSibling; $node != null; $node = $node->previousSibling)
|
160 |
+
$breadth++;
|
161 |
+
return $breadth;
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Returns the depth of this node in regards to it's ancestors
|
166 |
+
* @return int The depth of this node
|
167 |
+
*/
|
168 |
+
public function getDepth()
|
169 |
+
{
|
170 |
+
$depth = 0;
|
171 |
+
for($node = $this->parentNode; $node != null; $node = $node->parentNode)
|
172 |
+
$depth++;
|
173 |
+
return $depth;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* @internal sort function for DOM position sort
|
178 |
+
*/
|
179 |
+
private static function sortByDOMPosition($a, $b)
|
180 |
+
{
|
181 |
+
return ($a->isBefore($b) ? -1 : 1);
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* @internal Calls the CSS to XPath converter on the specified selector
|
186 |
+
* @param string $selector The CSS selector
|
187 |
+
* @return string The resulting XPath expression
|
188 |
+
*/
|
189 |
+
public static function selectorToXPath($selector)
|
190 |
+
{
|
191 |
+
if(!DOMElement::$xpathConverter)
|
192 |
+
DOMElement::$xpathConverter = new Selector\XPathConverter();
|
193 |
+
|
194 |
+
$xpath = DOMElement::$xpathConverter->convert($selector);
|
195 |
+
|
196 |
+
return $xpath;
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Imports the supplied subject into this node.
|
201 |
+
* @param mixed $subject. Either a \DOMDocument, \DOMNode, .html filename, or string containing HTML/text. The function will attempt to detect which. If you import HTML that contains a <body> element, it will only import the inner body
|
202 |
+
* @throws \Exception the subject was not recognised as any of the types above
|
203 |
+
* @return $this element
|
204 |
+
*/
|
205 |
+
public function import($subject, $forcePHP=false)
|
206 |
+
{
|
207 |
+
global $wpgmza;
|
208 |
+
|
209 |
+
$node = null;
|
210 |
+
|
211 |
+
if($subject instanceof \DOMDocument)
|
212 |
+
{
|
213 |
+
if(!$subject->getDocumentElementSafe())
|
214 |
+
throw new \Exception('Document is empty');
|
215 |
+
|
216 |
+
$node = $this->ownerDocument->importNode($subject->getDocumentElementSafe(), true);
|
217 |
+
|
218 |
+
}
|
219 |
+
else if($subject instanceof \DOMNode)
|
220 |
+
{
|
221 |
+
$node = $this->ownerDocument->importNode($subject, true);
|
222 |
+
}
|
223 |
+
else if(preg_match('/(\.html|\.php)$/i', $subject, $m))
|
224 |
+
{
|
225 |
+
// Subject is a filename
|
226 |
+
if(!file_exists($subject))
|
227 |
+
throw new \Exception('HTML file not found');
|
228 |
+
|
229 |
+
$temp = new DOMDocument('1.0', 'UTF-8');
|
230 |
+
if($forcePHP || preg_match('/\.php$/i', $m[1]))
|
231 |
+
$temp->loadPHPFile($subject);
|
232 |
+
else
|
233 |
+
$temp->load($subject);
|
234 |
+
|
235 |
+
$node = $this->ownerDocument->importNode($temp->getDocumentElementSafe(), true);
|
236 |
+
}
|
237 |
+
else if(is_string($subject))
|
238 |
+
{
|
239 |
+
if(empty($subject))
|
240 |
+
return;
|
241 |
+
|
242 |
+
if($subject != strip_tags($subject) || preg_match('/&.+;/', $subject))
|
243 |
+
{
|
244 |
+
// Subject is a HTML string
|
245 |
+
$html = DOMDocument::convertUTF8ToHTMLEntities($subject);
|
246 |
+
|
247 |
+
$temp = new DOMDocument('1.0', 'UTF-8');
|
248 |
+
$str = "<div id='domdocument-import-payload___'>" . $html . "</div>";
|
249 |
+
|
250 |
+
if($wpgmza->isInDeveloperMode()){
|
251 |
+
$temp->loadHTML($str);
|
252 |
+
} else {
|
253 |
+
@$temp->loadHTML($str);
|
254 |
+
}
|
255 |
+
|
256 |
+
$body = $temp->querySelector('#domdocument-import-payload___');
|
257 |
+
for($child = $body->firstChild; $child != null; $child = $child->nextSibling)
|
258 |
+
{
|
259 |
+
$node = $this->ownerDocument->importNode($child, true);
|
260 |
+
$this->appendChild($node);
|
261 |
+
}
|
262 |
+
}
|
263 |
+
else
|
264 |
+
// Subject is a plain string
|
265 |
+
$this->appendText($subject);
|
266 |
+
|
267 |
+
return;
|
268 |
+
}
|
269 |
+
else if(empty($subject))
|
270 |
+
{
|
271 |
+
return;
|
272 |
+
}
|
273 |
+
else
|
274 |
+
throw new \Exception('Don\'t know how to import "' . print_r($subject, true) . '" in ' . $this->ownerDocument->documentURI . ' on line ' . $this->getLineNo());
|
275 |
+
|
276 |
+
if($body = $node->querySelector("body"))
|
277 |
+
{
|
278 |
+
// TODO: I don't think a query selector is necessary here. Iterating over the bodies children should be more optimal
|
279 |
+
$results = $node->querySelectorAll("body>*");
|
280 |
+
|
281 |
+
foreach($results as $child)
|
282 |
+
$this->appendChild($child);
|
283 |
+
|
284 |
+
return $results;
|
285 |
+
}
|
286 |
+
else
|
287 |
+
{
|
288 |
+
$this->appendChild($node);
|
289 |
+
return $node;
|
290 |
+
}
|
291 |
+
|
292 |
+
return null;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Sets an inline CSS style on this element. If it's already set, the old value will be removed first
|
297 |
+
* @param string $name the CSS property name eg 'background-color'
|
298 |
+
* @param string $value the value of the property eg '#ff4400'
|
299 |
+
* @return $this
|
300 |
+
*/
|
301 |
+
public function setInlineStyle($name, $value)
|
302 |
+
{
|
303 |
+
$this->removeInlineStyle($name);
|
304 |
+
$style = $this->getAttribute('style');
|
305 |
+
$this->setAttribute('style', $style . $name . ':' . $value . ';');
|
306 |
+
return $this;
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Removes the inline CSS style specified by name
|
311 |
+
* @param string $name the name of the CSS property eg 'background-color'
|
312 |
+
* @return $this
|
313 |
+
*/
|
314 |
+
public function removeInlineStyle($name)
|
315 |
+
{
|
316 |
+
if(!$this->hasAttribute('style'))
|
317 |
+
return;
|
318 |
+
$style = $this->getAttribute('style');
|
319 |
+
|
320 |
+
$rules = preg_split('/\s*;\s*/', $style);
|
321 |
+
|
322 |
+
for($i = count($rules) - 1; $i >= 0; $i--)
|
323 |
+
{
|
324 |
+
$param = preg_quote($name);
|
325 |
+
|
326 |
+
if(preg_match("/^$param\s*:/", trim($rules[$i])))
|
327 |
+
unset($rules[$i]);
|
328 |
+
}
|
329 |
+
|
330 |
+
$this->setAttribute('style', implode(';', $rules));
|
331 |
+
return $this;
|
332 |
+
}
|
333 |
+
|
334 |
+
/**
|
335 |
+
* Check if this element has an inline style by name
|
336 |
+
* @param string $name the name of the CSS property to test for
|
337 |
+
*/
|
338 |
+
public function hasInlineStyle($name)
|
339 |
+
{
|
340 |
+
if(!$this->hasAttribute('style'))
|
341 |
+
return false;
|
342 |
+
return preg_match("/\s*$name:.*?((;\s*)|$)/", $this->getAttribute('style'));
|
343 |
+
}
|
344 |
+
|
345 |
+
/**
|
346 |
+
* Gets the value of the inline style by name
|
347 |
+
* @param string $name the name of the CSS property you want the value for
|
348 |
+
* @return mixed FALSE if there is no style property or no style with that name exists, or a string containing the property value if it does
|
349 |
+
*/
|
350 |
+
public function getInlineStyle($name)
|
351 |
+
{
|
352 |
+
if(!$this->hasAttribute('style'))
|
353 |
+
return false;
|
354 |
+
|
355 |
+
$m = null;
|
356 |
+
if(!preg_match("/\s*$name:(.*?)((;\s*)|$)/", $this->getAttribute('style')))
|
357 |
+
return false;
|
358 |
+
|
359 |
+
return $m[1];
|
360 |
+
}
|
361 |
+
|
362 |
+
/**
|
363 |
+
* Adds a class to this elements class attribute. It will be ignored if the class already exists
|
364 |
+
* @param string $name The classname
|
365 |
+
* @return $this
|
366 |
+
*/
|
367 |
+
public function addClass($name)
|
368 |
+
{
|
369 |
+
if($this->hasClass($name))
|
370 |
+
return;
|
371 |
+
|
372 |
+
$class = ($this->hasAttribute('class') ? $this->getAttribute('class') : '');
|
373 |
+
$this->setAttribute('class', $class . (strlen($class) > 0 ? ' ' : '') . $name);
|
374 |
+
|
375 |
+
return $this;
|
376 |
+
}
|
377 |
+
|
378 |
+
/**
|
379 |
+
* Removes the specified class from this nodes class attribute
|
380 |
+
* @param string $name The classname
|
381 |
+
* @return $this
|
382 |
+
*/
|
383 |
+
public function removeClass($name)
|
384 |
+
{
|
385 |
+
if(!$this->hasAttribute('class'))
|
386 |
+
return;
|
387 |
+
|
388 |
+
$class = trim(
|
389 |
+
preg_replace('/\s{2,}/', ' ',
|
390 |
+
preg_replace('/\\b' . $name . '\\b/', ' ', $this->getAttribute('class'))
|
391 |
+
)
|
392 |
+
);
|
393 |
+
|
394 |
+
$this->setAttribute('class', $class);
|
395 |
+
|
396 |
+
return $this;
|
397 |
+
}
|
398 |
+
|
399 |
+
/**
|
400 |
+
* Tests if the specified class exists on this elements class attribute
|
401 |
+
* @param string $name The classname
|
402 |
+
* @return boolean FALSE if no such class existst, TRUE if it does
|
403 |
+
*/
|
404 |
+
public function hasClass($name)
|
405 |
+
{
|
406 |
+
if(!$this->hasAttribute('class'))
|
407 |
+
return false;
|
408 |
+
|
409 |
+
return preg_match('/\\b' . $name . '\\b/', $this->getAttribute('class'));
|
410 |
+
}
|
411 |
+
|
412 |
+
/**
|
413 |
+
* Populates the target element. If it is a form element, the value will be set according to the elements type/nodeName. If not, the value will be imported instead.
|
414 |
+
* @param The target element. Usually a descendant of this element
|
415 |
+
* @param string $key the key of the value we're populating with, used for formatting
|
416 |
+
* @param string $value the value to populate with
|
417 |
+
* @param array $formatters an array associative of functions to format certain values with, functions should be specified by key
|
418 |
+
* @return void
|
419 |
+
*/
|
420 |
+
protected function populateElement($target, $key, $value, $formatters)
|
421 |
+
{
|
422 |
+
if(!($target instanceof \DOMElement))
|
423 |
+
throw new \Exception('Argument must be a DOMElement');
|
424 |
+
|
425 |
+
switch(strtolower($target->nodeName))
|
426 |
+
{
|
427 |
+
case 'textarea':
|
428 |
+
case 'select':
|
429 |
+
case 'input':
|
430 |
+
$target->setValue($value);
|
431 |
+
break;
|
432 |
+
|
433 |
+
case 'img':
|
434 |
+
$target->setAttribute('src', $value);
|
435 |
+
break;
|
436 |
+
|
437 |
+
default:
|
438 |
+
if(!is_null($formatters) && isset($formatters[$key]))
|
439 |
+
$value = $formatters[$key]($value);
|
440 |
+
|
441 |
+
if($value instanceof \DateTime)
|
442 |
+
$value = $value->format('D jS M \'y g:ia');
|
443 |
+
|
444 |
+
if($key == 'price')
|
445 |
+
$value = number_format($value, 2, '.', '');
|
446 |
+
|
447 |
+
if(is_object($value))
|
448 |
+
throw new \Exception('Expected simple type in "'.$key.'" => "'.print_r($value,true).'"');
|
449 |
+
|
450 |
+
$target->import( $value );
|
451 |
+
|
452 |
+
break;
|
453 |
+
}
|
454 |
+
}
|
455 |
+
|
456 |
+
/**
|
457 |
+
* Takes a source object or associative array and optional array of formatting functions, and populates descendant named elements with the values from that source.
|
458 |
+
* @param mixed $src Associative array or object with the keys and values
|
459 |
+
* @param array $formatters Optional associative array of functions to format values with. The keys on this array correspond with the keys on $src
|
460 |
+
* @return DOMElement This element
|
461 |
+
*/
|
462 |
+
public function populate($src=null, $formatters=null)
|
463 |
+
{
|
464 |
+
$x = new \DOMXPath($this->ownerDocument);
|
465 |
+
|
466 |
+
if(!$src)
|
467 |
+
return $this;
|
468 |
+
|
469 |
+
if(is_scalar($src))
|
470 |
+
{
|
471 |
+
$this->appendText($src);
|
472 |
+
return $this;
|
473 |
+
}
|
474 |
+
|
475 |
+
foreach($src as $key => $value)
|
476 |
+
{
|
477 |
+
if(is_array($value))
|
478 |
+
{
|
479 |
+
$m = $x->query('descendant-or-self::*[@name="' . $key . '[]"]', $this);
|
480 |
+
|
481 |
+
if($m->length > 0 && count($value) != $m->length)
|
482 |
+
{
|
483 |
+
if($src = $m->item(0)->closest('li,tr'))
|
484 |
+
{
|
485 |
+
for($i = $m->length; $i < count($value); $i++)
|
486 |
+
{
|
487 |
+
$item = $src->cloneNode(true);
|
488 |
+
$src->parentNode->appendChild($item);
|
489 |
+
}
|
490 |
+
$m = $x->query('descendant-or-self::*[@name="' . $key . '[]"]', $this);
|
491 |
+
}
|
492 |
+
else
|
493 |
+
throw new \Exception('Number of elements must match (' . count($value) . ' != ' . $m->length . ')');
|
494 |
+
}
|
495 |
+
|
496 |
+
for($i = 0; $i < $m->length; $i++)
|
497 |
+
$this->populateElement($m->item($i), $key, $value[$i], $formatters);
|
498 |
+
}
|
499 |
+
else
|
500 |
+
{
|
501 |
+
$m = $x->query('descendant-or-self::*[@name="' . $key . '" or @data-name="' . $key . '"]', $this);
|
502 |
+
|
503 |
+
for($i = 0; $i < $m->length; $i++)
|
504 |
+
$this->populateElement($m->item($i), $key, $value, $formatters);
|
505 |
+
}
|
506 |
+
}
|
507 |
+
|
508 |
+
return $this;
|
509 |
+
}
|
510 |
+
|
511 |
+
public function serializeFormData()
|
512 |
+
{
|
513 |
+
$data = array();
|
514 |
+
|
515 |
+
foreach($this->querySelectorAll('input, select, textarea') as $input)
|
516 |
+
{
|
517 |
+
$name = $input->getAttribute('name');
|
518 |
+
|
519 |
+
if(!$name)
|
520 |
+
continue;
|
521 |
+
|
522 |
+
if(preg_match('/nonce/i', $name))
|
523 |
+
continue; // NB: Do not serialize nonce values
|
524 |
+
|
525 |
+
switch($input->getAttribute('type'))
|
526 |
+
{
|
527 |
+
case 'checkbox':
|
528 |
+
|
529 |
+
if($input->getValue())
|
530 |
+
$data[$name] = true;
|
531 |
+
else
|
532 |
+
$data[$name] = false;
|
533 |
+
|
534 |
+
break;
|
535 |
+
|
536 |
+
case 'radio':
|
537 |
+
|
538 |
+
if($input->getAttribute('checked'))
|
539 |
+
$data[$name] = $input->getAttribute('value');
|
540 |
+
|
541 |
+
break;
|
542 |
+
|
543 |
+
default:
|
544 |
+
$data[$name] = $input->getValue();
|
545 |
+
break;
|
546 |
+
}
|
547 |
+
}
|
548 |
+
|
549 |
+
return $data;
|
550 |
+
}
|
551 |
+
|
552 |
+
/**
|
553 |
+
* Gets the value of this element
|
554 |
+
* @return mixed A string if the element a text input, textarea or plain node, a boolean if the element is a checkbox or radio, or the value of the selected option if this element is a select
|
555 |
+
*/
|
556 |
+
public function getValue()
|
557 |
+
{
|
558 |
+
switch(strtolower($this->nodeName))
|
559 |
+
{
|
560 |
+
case 'input':
|
561 |
+
$type = ($this->hasAttribute('type') ? $this->getAttribute('type') : 'text');
|
562 |
+
switch($type)
|
563 |
+
{
|
564 |
+
case 'radio':
|
565 |
+
case 'checkbox':
|
566 |
+
return $this->hasAttribute('checked');
|
567 |
+
break;
|
568 |
+
|
569 |
+
default:
|
570 |
+
return $this->getAttribute('value');
|
571 |
+
break;
|
572 |
+
}
|
573 |
+
break;
|
574 |
+
|
575 |
+
case 'select':
|
576 |
+
$option = $this->querySelector('option[selected]');
|
577 |
+
if(!$option)
|
578 |
+
return null;
|
579 |
+
|
580 |
+
if($option->hasAttribute('value'))
|
581 |
+
return $option->getAttribute('value');
|
582 |
+
|
583 |
+
default:
|
584 |
+
return $this->nodeValue;
|
585 |
+
break;
|
586 |
+
}
|
587 |
+
}
|
588 |
+
|
589 |
+
/**
|
590 |
+
* Sets the value of this element. Intended for form elements only. If this element is a textarea, it will be appended as plain text. If this element is a select, it will attempt to select the option with the specified value. If the input is a radio or checkbox, it will set it accordingly. Otherwise, the value will be put into the value attribute
|
591 |
+
* @throws \Exception If this element is a select, SMART_STRICT_MODE is declared and no option with that value exists
|
592 |
+
* @throws \Exception If you call this method on a non-form element
|
593 |
+
* @return This element
|
594 |
+
*/
|
595 |
+
public function setValue($value)
|
596 |
+
{
|
597 |
+
/*if($this->getAttribute("name") == "wpgmza_gdpr_require_consent_before_load")
|
598 |
+
{
|
599 |
+
|
600 |
+
echo "<pre>";
|
601 |
+
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
602 |
+
exit;
|
603 |
+
}*/
|
604 |
+
|
605 |
+
switch(strtolower($this->nodeName))
|
606 |
+
{
|
607 |
+
case 'textarea':
|
608 |
+
$this->clear();
|
609 |
+
$this->appendText( $value );
|
610 |
+
break;
|
611 |
+
|
612 |
+
case 'select':
|
613 |
+
$deselect = $this->querySelectorAll('option[selected]');
|
614 |
+
foreach($deselect as $d)
|
615 |
+
$d->removeAttribute('selected');
|
616 |
+
|
617 |
+
if($value === null)
|
618 |
+
return $this;
|
619 |
+
|
620 |
+
$option = $this->querySelector('option[value="' . $value . '"]');
|
621 |
+
|
622 |
+
if(!$option)
|
623 |
+
trigger_error('Option with value "' . $value . '" not found in "' . ($this->getAttribute('name')) . '"', E_USER_WARNING);
|
624 |
+
else
|
625 |
+
$option->setAttribute('selected', 'selected');
|
626 |
+
|
627 |
+
break;
|
628 |
+
|
629 |
+
case 'input':
|
630 |
+
if(!$this->hasAttribute('type') || $this->getAttribute('type') == 'text')
|
631 |
+
{
|
632 |
+
if(is_string($value))
|
633 |
+
$this->setAttribute('value', $value);
|
634 |
+
}
|
635 |
+
else switch(strtolower($this->getAttribute('type')))
|
636 |
+
{
|
637 |
+
case 'radio':
|
638 |
+
if($this->hasAttribute('value') && $this->getAttribute('value') == $value)
|
639 |
+
$this->setAttribute('checked', 'checked');
|
640 |
+
else
|
641 |
+
$this->removeAttribute('checked');
|
642 |
+
break;
|
643 |
+
|
644 |
+
case 'checkbox':
|
645 |
+
if(!empty($value) && $value != false)
|
646 |
+
$this->setAttribute('checked', 'checked');
|
647 |
+
else
|
648 |
+
$this->removeAttribute('checked');
|
649 |
+
break;
|
650 |
+
|
651 |
+
default:
|
652 |
+
$this->setAttribute('value', $value);
|
653 |
+
break;
|
654 |
+
}
|
655 |
+
break;
|
656 |
+
|
657 |
+
default:
|
658 |
+
throw new \Exception('Not yet implemented');
|
659 |
+
|
660 |
+
$this->nodeValue = $value;
|
661 |
+
break;
|
662 |
+
}
|
663 |
+
|
664 |
+
return $this;
|
665 |
+
}
|
666 |
+
|
667 |
+
/**
|
668 |
+
* Appends the specified text to this element, shorthand utility function
|
669 |
+
* @return \Smart\Element This element
|
670 |
+
*/
|
671 |
+
public function appendText($text)
|
672 |
+
{
|
673 |
+
$this->appendChild( $this->ownerDocument->createTextNode( $text ) );
|
674 |
+
return $this;
|
675 |
+
}
|
676 |
+
|
677 |
+
/**
|
678 |
+
* Utility function to append the specified element after one of this elements children. Will append at the end if after is null
|
679 |
+
* @param \Smart\Element the element to insert
|
680 |
+
* @param \Smart\Element one of this elements children, or null
|
681 |
+
* *@return \Smart\Element this element
|
682 |
+
*/
|
683 |
+
public function insertAfter($elem, $after=null)
|
684 |
+
{
|
685 |
+
if($after->parentNode && $after->parentNode !== $this)
|
686 |
+
throw new \Exception('Hierarchy error');
|
687 |
+
|
688 |
+
if($after->nextSibling)
|
689 |
+
$this->insertBefore($elem, $after->nextSibling);
|
690 |
+
else
|
691 |
+
$this->appendChild($elem);
|
692 |
+
|
693 |
+
return $this;
|
694 |
+
}
|
695 |
+
|
696 |
+
/**
|
697 |
+
* Clears this element, completely removing all it's contents
|
698 |
+
* @return \Smart\Element This element
|
699 |
+
*/
|
700 |
+
public function clear()
|
701 |
+
{
|
702 |
+
|
703 |
+
while($this->childNodes->length)
|
704 |
+
$this->removeChild($this->firstChild);
|
705 |
+
return $this;
|
706 |
+
}
|
707 |
+
|
708 |
+
/**
|
709 |
+
* Removes this element from it's parent
|
710 |
+
* @return \Smart\Element This element
|
711 |
+
*/
|
712 |
+
public function remove() : void
|
713 |
+
{
|
714 |
+
if($this->parentNode)
|
715 |
+
$this->parentNode->removeChild($this);
|
716 |
+
}
|
717 |
+
}
|
718 |
+
|
includes/tables/class.admin-map-datatable.php
CHANGED
@@ -136,7 +136,7 @@ class AdminMapDataTable extends DataTable
|
|
136 |
break;
|
137 |
}
|
138 |
}
|
139 |
-
|
140 |
return $columns;
|
141 |
}
|
142 |
|
@@ -159,6 +159,17 @@ class AdminMapDataTable extends DataTable
|
|
159 |
|
160 |
return $clauses;
|
161 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
}
|
163 |
|
164 |
|
136 |
break;
|
137 |
}
|
138 |
}
|
139 |
+
|
140 |
return $columns;
|
141 |
}
|
142 |
|
159 |
|
160 |
return $clauses;
|
161 |
}
|
162 |
+
|
163 |
+
protected function filterResults(&$rows){
|
164 |
+
if(!empty($rows)){
|
165 |
+
foreach($rows as $key => $row){
|
166 |
+
if(!empty($row->map_title)){
|
167 |
+
$rows[$key]->map_title = strip_tags($row->map_title);
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
return $rows;
|
172 |
+
}
|
173 |
}
|
174 |
|
175 |
|
includes/tables/class.admin-marker-datatable.php
CHANGED
File without changes
|
includes/tables/class.ajax-table.php
CHANGED
File without changes
|
includes/tables/class.datatable.php
CHANGED
File without changes
|
includes/tables/class.marker-datatable.php
CHANGED
File without changes
|
includes/tables/class.table.php
CHANGED
File without changes
|
js/dataTables.responsive.js
CHANGED
File without changes
|
js/jquery.dataTables.js
CHANGED
File without changes
|
js/jquery.dataTables.min.js
CHANGED
File without changes
|
js/legacy/legacy-circle-panel.js
CHANGED
File without changes
|
js/legacy/legacy-edit-marker-location-page.js
CHANGED
File without changes
|
js/legacy/legacy-polygon-panel.js
CHANGED
File without changes
|
js/legacy/legacy-polyline-panel.js
CHANGED
File without changes
|
js/legacy/legacy-rectangle-panel.js
CHANGED
File without changes
|
js/markerclusterer.js
CHANGED
File without changes
|
js/v8/3rd-party-integration/gutenberg/dist/gutenberg.js
CHANGED
File without changes
|
js/v8/3rd-party-integration/gutenberg/src/gutenberg.jsx
CHANGED
File without changes
|
js/v8/3rd-party-integration/integration.js
CHANGED
File without changes
|
js/v8/address-input.js
CHANGED
File without changes
|
js/v8/circle.js
CHANGED
File without changes
|
js/v8/compatibility.js
CHANGED
File without changes
|
js/v8/compatibility/astra-theme-compatibility.js
CHANGED
File without changes
|
js/v8/compatibility/google-ui-compatibility.js
CHANGED
File without changes
|
js/v8/core.js
CHANGED
File without changes
|
js/v8/countries.json
CHANGED
File without changes
|
js/v8/css-escape.js
CHANGED
File without changes
|
js/v8/distance.js
CHANGED
File without changes
|
js/v8/elias-fano.js
CHANGED
File without changes
|
js/v8/event-dispatcher.js
CHANGED
File without changes
|
js/v8/event.js
CHANGED
File without changes
|
js/v8/fancy-controls.js
CHANGED
File without changes
|
js/v8/friendly-error.js
CHANGED
File without changes
|
js/v8/geocoder.js
CHANGED
File without changes
|
js/v8/google-api-error-handler.js
CHANGED
File without changes
|
js/v8/google-maps/google-circle.js
CHANGED
File without changes
|
js/v8/google-maps/google-geocoder.js
CHANGED
File without changes
|
js/v8/google-maps/google-html-overlay.js
CHANGED
File without changes
|
js/v8/google-maps/google-info-window.js
CHANGED
File without changes
|
js/v8/google-maps/google-map.js
CHANGED
File without changes
|
js/v8/google-maps/google-marker.js
CHANGED
File without changes
|
js/v8/google-maps/google-modern-store-locator-circle.js
CHANGED
File without changes
|
js/v8/google-maps/google-modern-store-locator.js
CHANGED
File without changes
|
js/v8/google-maps/google-polygon.js
CHANGED
File without changes
|
js/v8/google-maps/google-polyline.js
CHANGED
File without changes
|
js/v8/google-maps/google-text-overlay.js
CHANGED
File without changes
|
js/v8/google-maps/google-text.js
CHANGED
File without changes
|
js/v8/google-maps/google-vertex-context-menu.js
CHANGED
File without changes
|
js/v8/info-window.js
CHANGED
@@ -107,7 +107,9 @@ jQuery(function($) {
|
|
107 |
|
108 |
WPGMZA.InfoWindow.prototype.addEditButton = function() {
|
109 |
if (WPGMZA.currentPage == "map-edit") {
|
110 |
-
|
|
|
|
|
111 |
}
|
112 |
return '';
|
113 |
|
107 |
|
108 |
WPGMZA.InfoWindow.prototype.addEditButton = function() {
|
109 |
if (WPGMZA.currentPage == "map-edit") {
|
110 |
+
if(this.feature instanceof WPGMZA.Marker){
|
111 |
+
return ' <a title="Edit this marker" style="width:15px;" class="wpgmza_edit_btn" data-edit-marker-id="'+this.feature.id+'"><i class="fa fa-edit"></i></a>';
|
112 |
+
}
|
113 |
}
|
114 |
return '';
|
115 |
|
js/v8/latlng.js
CHANGED
File without changes
|
js/v8/latlngbounds.js
CHANGED
File without changes
|
js/v8/map-settings.js
CHANGED
@@ -223,6 +223,11 @@ jQuery(function($) {
|
|
223 |
|
224 |
options.draggable = !isSettingDisabled(this.wpgmza_settings_map_draggable);
|
225 |
options.disableDoubleClickZoom = isSettingDisabled(this.wpgmza_settings_map_clickzoom);
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
// NB: This setting is handled differently as setting scrollwheel to true breaks gestureHandling
|
228 |
if(this.wpgmza_settings_map_scroll)
|
223 |
|
224 |
options.draggable = !isSettingDisabled(this.wpgmza_settings_map_draggable);
|
225 |
options.disableDoubleClickZoom = isSettingDisabled(this.wpgmza_settings_map_clickzoom);
|
226 |
+
|
227 |
+
if(isSettingDisabled(this.wpgmza_settings_map_tilt_controls)){
|
228 |
+
options.rotateControl = false;
|
229 |
+
options.tilt = 0;
|
230 |
+
}
|
231 |
|
232 |
// NB: This setting is handled differently as setting scrollwheel to true breaks gestureHandling
|
233 |
if(this.wpgmza_settings_map_scroll)
|
js/v8/map.js
CHANGED
File without changes
|
js/v8/maps-engine-dialog.js
CHANGED
File without changes
|
js/v8/marker-filter.js
CHANGED
File without changes
|
js/v8/marker-panel.js
CHANGED
File without changes
|
js/v8/marker.js
CHANGED
File without changes
|
js/v8/modern-store-locator-circle.js
CHANGED
File without changes
|
js/v8/modern-store-locator.js
CHANGED
File without changes
|
js/v8/native-maps-icon.js
CHANGED
File without changes
|
js/v8/open-layers/ol-circle.js
CHANGED
File without changes
|
js/v8/open-layers/ol-geocoder.js
CHANGED
File without changes
|
js/v8/open-layers/ol-info-window.js
CHANGED
File without changes
|
js/v8/open-layers/ol-map.js
CHANGED
@@ -132,7 +132,7 @@ jQuery(function($) {
|
|
132 |
|
133 |
this.olMap.on("click", function(event) {
|
134 |
var features = self.olMap.getFeaturesAtPixel(event.pixel);
|
135 |
-
|
136 |
if(!features || !features.length)
|
137 |
return;
|
138 |
|
@@ -276,7 +276,16 @@ jQuery(function($) {
|
|
276 |
|
277 |
nativeFeature.trigger("click");
|
278 |
}
|
279 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
self.trigger({
|
281 |
type: "click",
|
282 |
latLng: latLng
|
132 |
|
133 |
this.olMap.on("click", function(event) {
|
134 |
var features = self.olMap.getFeaturesAtPixel(event.pixel);
|
135 |
+
|
136 |
if(!features || !features.length)
|
137 |
return;
|
138 |
|
276 |
|
277 |
nativeFeature.trigger("click");
|
278 |
}
|
279 |
+
|
280 |
+
if(featuresUnderPixel.length > 0){
|
281 |
+
/*
|
282 |
+
* This is for a pixel interpolated feature, like polygons
|
283 |
+
*
|
284 |
+
* Let's return early, to avoid double event firing
|
285 |
+
*/
|
286 |
+
return;
|
287 |
+
}
|
288 |
+
|
289 |
self.trigger({
|
290 |
type: "click",
|
291 |
latLng: latLng
|
js/v8/open-layers/ol-marker.js
CHANGED
File without changes
|
js/v8/open-layers/ol-modern-store-locator-circle.js
CHANGED
File without changes
|
js/v8/open-layers/ol-modern-store-locator.js
CHANGED
File without changes
|
js/v8/open-layers/ol-polygon.js
CHANGED
File without changes
|
js/v8/open-layers/ol-polyline.js
CHANGED
File without changes
|
js/v8/open-layers/ol-text.js
CHANGED
File without changes
|
js/v8/polyfills.js
CHANGED
File without changes
|
js/v8/polygon.js
CHANGED
File without changes
|
js/v8/polyline.js
CHANGED
File without changes
|
js/v8/popout-panel.js
CHANGED
File without changes
|
js/v8/rest-api.js
CHANGED
File without changes
|
js/v8/scripts.json
CHANGED
@@ -298,48 +298,6 @@
|
|
298 |
"wpgmza"
|
299 |
]
|
300 |
},
|
301 |
-
"wpgmza-astra-theme-compatiblity": {
|
302 |
-
"src": "js\/v8\/compatibility\/astra-theme-compatibility.js",
|
303 |
-
"pro": false,
|
304 |
-
"dependencies": [
|
305 |
-
"wpgmza"
|
306 |
-
]
|
307 |
-
},
|
308 |
-
"wpgmza-google-ui-compatibility": {
|
309 |
-
"src": "js\/v8\/compatibility\/google-ui-compatibility.js",
|
310 |
-
"pro": false,
|
311 |
-
"dependencies": [
|
312 |
-
"wpgmza"
|
313 |
-
]
|
314 |
-
},
|
315 |
-
"wpgmza-admin-feature-data-table": {
|
316 |
-
"src": "js\/v8\/tables\/admin-feature-datatable.js",
|
317 |
-
"pro": false,
|
318 |
-
"dependencies": [
|
319 |
-
"wpgmza-data-table"
|
320 |
-
]
|
321 |
-
},
|
322 |
-
"wpgmza-admin-data-table": {
|
323 |
-
"src": "js\/v8\/tables\/admin-map-datatable.js",
|
324 |
-
"pro": false,
|
325 |
-
"dependencies": [
|
326 |
-
"wpgmza-data-table"
|
327 |
-
]
|
328 |
-
},
|
329 |
-
"wpgmza-admin-marker-data-table": {
|
330 |
-
"src": "js\/v8\/tables\/admin-marker-datatable.js",
|
331 |
-
"pro": false,
|
332 |
-
"dependencies": [
|
333 |
-
"wpgmza-data-table"
|
334 |
-
]
|
335 |
-
},
|
336 |
-
"wpgmza-data-table": {
|
337 |
-
"src": "js\/v8\/tables\/datatable.js",
|
338 |
-
"pro": false,
|
339 |
-
"dependencies": [
|
340 |
-
"wpgmza"
|
341 |
-
]
|
342 |
-
},
|
343 |
"wpgmza-integration": {
|
344 |
"src": "js\/v8\/3rd-party-integration\/integration.js",
|
345 |
"pro": false,
|
@@ -358,95 +316,18 @@
|
|
358 |
"wp-components"
|
359 |
]
|
360 |
},
|
361 |
-
"wpgmza-
|
362 |
-
"src": "js\/v8\/
|
363 |
-
"pro": false,
|
364 |
-
"dependencies": [
|
365 |
-
"wpgmza-circle"
|
366 |
-
]
|
367 |
-
},
|
368 |
-
"wpgmza-ol-drawing-manager": {
|
369 |
-
"src": "js\/v8\/open-layers\/ol-drawing-manager.js",
|
370 |
-
"pro": false,
|
371 |
-
"dependencies": [
|
372 |
-
"wpgmza-drawing-manager"
|
373 |
-
]
|
374 |
-
},
|
375 |
-
"wpgmza-ol-feature": {
|
376 |
-
"src": "js\/v8\/open-layers\/ol-feature.js",
|
377 |
"pro": false,
|
378 |
"dependencies": [
|
379 |
"wpgmza"
|
380 |
]
|
381 |
},
|
382 |
-
"wpgmza-
|
383 |
-
"src": "js\/v8\/
|
384 |
-
"pro": false,
|
385 |
-
"dependencies": [
|
386 |
-
"wpgmza-geocoder"
|
387 |
-
]
|
388 |
-
},
|
389 |
-
"wpgmza-ol-info-window": {
|
390 |
-
"src": "js\/v8\/open-layers\/ol-info-window.js",
|
391 |
-
"pro": false,
|
392 |
-
"dependencies": [
|
393 |
-
"wpgmza-info-window"
|
394 |
-
]
|
395 |
-
},
|
396 |
-
"wpgmza-ol-map": {
|
397 |
-
"src": "js\/v8\/open-layers\/ol-map.js",
|
398 |
-
"pro": false,
|
399 |
-
"dependencies": [
|
400 |
-
"wpgmza-map"
|
401 |
-
]
|
402 |
-
},
|
403 |
-
"wpgmza-ol-marker": {
|
404 |
-
"src": "js\/v8\/open-layers\/ol-marker.js",
|
405 |
-
"pro": false,
|
406 |
-
"dependencies": [
|
407 |
-
"wpgmza-marker"
|
408 |
-
]
|
409 |
-
},
|
410 |
-
"wpgmza-ol-modern-store-locator-circle": {
|
411 |
-
"src": "js\/v8\/open-layers\/ol-modern-store-locator-circle.js",
|
412 |
-
"pro": false,
|
413 |
-
"dependencies": [
|
414 |
-
"wpgmza-modern-store-locator-circle"
|
415 |
-
]
|
416 |
-
},
|
417 |
-
"wpgmza-ol-modern-store-locator": {
|
418 |
-
"src": "js\/v8\/open-layers\/ol-modern-store-locator.js",
|
419 |
-
"pro": false,
|
420 |
-
"dependencies": [
|
421 |
-
"wpgmza-modern-store-locator"
|
422 |
-
]
|
423 |
-
},
|
424 |
-
"wpgmza-ol-polygon": {
|
425 |
-
"src": "js\/v8\/open-layers\/ol-polygon.js",
|
426 |
-
"pro": false,
|
427 |
-
"dependencies": [
|
428 |
-
"wpgmza-polygon"
|
429 |
-
]
|
430 |
-
},
|
431 |
-
"wpgmza-ol-polyline": {
|
432 |
-
"src": "js\/v8\/open-layers\/ol-polyline.js",
|
433 |
-
"pro": false,
|
434 |
-
"dependencies": [
|
435 |
-
"wpgmza-polyline"
|
436 |
-
]
|
437 |
-
},
|
438 |
-
"wpgmza-ol-rectangle": {
|
439 |
-
"src": "js\/v8\/open-layers\/ol-rectangle.js",
|
440 |
-
"pro": false,
|
441 |
-
"dependencies": [
|
442 |
-
"wpgmza-rectangle"
|
443 |
-
]
|
444 |
-
},
|
445 |
-
"wpgmza-ol-text": {
|
446 |
-
"src": "js\/v8\/open-layers\/ol-text.js",
|
447 |
"pro": false,
|
448 |
"dependencies": [
|
449 |
-
"wpgmza
|
450 |
]
|
451 |
},
|
452 |
"wpgmza-google-circle": {
|
@@ -595,5 +476,124 @@
|
|
595 |
"dependencies": [
|
596 |
"wpgmza-feature-panel"
|
597 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
598 |
}
|
599 |
}
|
298 |
"wpgmza"
|
299 |
]
|
300 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
"wpgmza-integration": {
|
302 |
"src": "js\/v8\/3rd-party-integration\/integration.js",
|
303 |
"pro": false,
|
316 |
"wp-components"
|
317 |
]
|
318 |
},
|
319 |
+
"wpgmza-astra-theme-compatiblity": {
|
320 |
+
"src": "js\/v8\/compatibility\/astra-theme-compatibility.js",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
"pro": false,
|
322 |
"dependencies": [
|
323 |
"wpgmza"
|
324 |
]
|
325 |
},
|
326 |
+
"wpgmza-google-ui-compatibility": {
|
327 |
+
"src": "js\/v8\/compatibility\/google-ui-compatibility.js",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
"pro": false,
|
329 |
"dependencies": [
|
330 |
+
"wpgmza"
|
331 |
]
|
332 |
},
|
333 |
"wpgmza-google-circle": {
|
476 |
"dependencies": [
|
477 |
"wpgmza-feature-panel"
|
478 |
]
|
479 |
+
},
|
480 |
+
"wpgmza-ol-circle": {
|
481 |
+
"src": "js\/v8\/open-layers\/ol-circle.js",
|
482 |
+
"pro": false,
|
483 |
+
"dependencies": [
|
484 |
+
"wpgmza-circle"
|
485 |
+
]
|
486 |
+
},
|
487 |
+
"wpgmza-ol-drawing-manager": {
|
488 |
+
"src": "js\/v8\/open-layers\/ol-drawing-manager.js",
|
489 |
+
"pro": false,
|
490 |
+
"dependencies": [
|
491 |
+
"wpgmza-drawing-manager"
|
492 |
+
]
|
493 |
+
},
|
494 |
+
"wpgmza-ol-feature": {
|
495 |
+
"src": "js\/v8\/open-layers\/ol-feature.js",
|
496 |
+
"pro": false,
|
497 |
+
"dependencies": [
|
498 |
+
"wpgmza"
|
499 |
+
]
|
500 |
+
},
|
501 |
+
"wpgmza-ol-geocoder": {
|
502 |
+
"src": "js\/v8\/open-layers\/ol-geocoder.js",
|
503 |
+
"pro": false,
|
504 |
+
"dependencies": [
|
505 |
+
"wpgmza-geocoder"
|
506 |
+
]
|
507 |
+
},
|
508 |
+
"wpgmza-ol-info-window": {
|
509 |
+
"src": "js\/v8\/open-layers\/ol-info-window.js",
|
510 |
+
"pro": false,
|
511 |
+
"dependencies": [
|
512 |
+
"wpgmza-info-window"
|
513 |
+
]
|
514 |
+
},
|
515 |
+
"wpgmza-ol-map": {
|
516 |
+
"src": "js\/v8\/open-layers\/ol-map.js",
|
517 |
+
"pro": false,
|
518 |
+
"dependencies": [
|
519 |
+
"wpgmza-map"
|
520 |
+
]
|
521 |
+
},
|
522 |
+
"wpgmza-ol-marker": {
|
523 |
+
"src": "js\/v8\/open-layers\/ol-marker.js",
|
524 |
+
"pro": false,
|
525 |
+
"dependencies": [
|
526 |
+
"wpgmza-marker"
|
527 |
+
]
|
528 |
+
},
|
529 |
+
"wpgmza-ol-modern-store-locator-circle": {
|
530 |
+
"src": "js\/v8\/open-layers\/ol-modern-store-locator-circle.js",
|
531 |
+
"pro": false,
|
532 |
+
"dependencies": [
|
533 |
+
"wpgmza-modern-store-locator-circle"
|
534 |
+
]
|
535 |
+
},
|
536 |
+
"wpgmza-ol-modern-store-locator": {
|
537 |
+
"src": "js\/v8\/open-layers\/ol-modern-store-locator.js",
|
538 |
+
"pro": false,
|
539 |
+
"dependencies": [
|
540 |
+
"wpgmza-modern-store-locator"
|
541 |
+
]
|
542 |
+
},
|
543 |
+
"wpgmza-ol-polygon": {
|
544 |
+
"src": "js\/v8\/open-layers\/ol-polygon.js",
|
545 |
+
"pro": false,
|
546 |
+
"dependencies": [
|
547 |
+
"wpgmza-polygon"
|
548 |
+
]
|
549 |
+
},
|
550 |
+
"wpgmza-ol-polyline": {
|
551 |
+
"src": "js\/v8\/open-layers\/ol-polyline.js",
|
552 |
+
"pro": false,
|
553 |
+
"dependencies": [
|
554 |
+
"wpgmza-polyline"
|
555 |
+
]
|
556 |
+
},
|
557 |
+
"wpgmza-ol-rectangle": {
|
558 |
+
"src": "js\/v8\/open-layers\/ol-rectangle.js",
|
559 |
+
"pro": false,
|
560 |
+
"dependencies": [
|
561 |
+
"wpgmza-rectangle"
|
562 |
+
]
|
563 |
+
},
|
564 |
+
"wpgmza-ol-text": {
|
565 |
+
"src": "js\/v8\/open-layers\/ol-text.js",
|
566 |
+
"pro": false,
|
567 |
+
"dependencies": [
|
568 |
+
"wpgmza-text"
|
569 |
+
]
|
570 |
+
},
|
571 |
+
"wpgmza-admin-feature-data-table": {
|
572 |
+
"src": "js\/v8\/tables\/admin-feature-datatable.js",
|
573 |
+
"pro": false,
|
574 |
+
"dependencies": [
|
575 |
+
"wpgmza-data-table"
|
576 |
+
]
|
577 |
+
},
|
578 |
+
"wpgmza-admin-data-table": {
|
579 |
+
"src": "js\/v8\/tables\/admin-map-datatable.js",
|
580 |
+
"pro": false,
|
581 |
+
"dependencies": [
|
582 |
+
"wpgmza-data-table"
|
583 |
+
]
|
584 |
+
},
|
585 |
+
"wpgmza-admin-marker-data-table": {
|
586 |
+
"src": "js\/v8\/tables\/admin-marker-datatable.js",
|
587 |
+
"pro": false,
|
588 |
+
"dependencies": [
|
589 |
+
"wpgmza-data-table"
|
590 |
+
]
|
591 |
+
},
|
592 |
+
"wpgmza-data-table": {
|
593 |
+
"src": "js\/v8\/tables\/datatable.js",
|
594 |
+
"pro": false,
|
595 |
+
"dependencies": [
|
596 |
+
"wpgmza"
|
597 |
+
]
|
598 |
}
|
599 |
}
|
js/v8/settings-page.js
CHANGED
File without changes
|
js/v8/store-locator.js
CHANGED
@@ -350,7 +350,7 @@ jQuery(function($) {
|
|
350 |
circle.settings.radiusString = this.radius;
|
351 |
}
|
352 |
|
353 |
-
if(event.filteredMarkers.length == 0){
|
354 |
if($(this.element).find('.wpgmza-no-results').length > 0 && WPGMZA.settings.user_interface_style === 'legacy'){
|
355 |
$(this.element).find('.wpgmza-no-results').show();
|
356 |
} else {
|
350 |
circle.settings.radiusString = this.radius;
|
351 |
}
|
352 |
|
353 |
+
if(event.filteredMarkers.length == 0 && this.state === WPGMZA.StoreLocator.STATE_APPLIED){
|
354 |
if($(this.element).find('.wpgmza-no-results').length > 0 && WPGMZA.settings.user_interface_style === 'legacy'){
|
355 |
$(this.element).find('.wpgmza-no-results').show();
|
356 |
} else {
|
js/v8/tables/admin-marker-datatable.js
CHANGED
File without changes
|
js/v8/tables/datatable.js
CHANGED
File without changes
|
js/v8/text.js
CHANGED
File without changes
|
js/v8/theme-editor.js
CHANGED
File without changes
|
js/v8/theme-panel.js
CHANGED
File without changes
|
js/v8/version.js
CHANGED
File without changes
|
js/v8/wp-google-maps.combined.js
CHANGED
@@ -2686,356 +2686,358 @@ jQuery(function($) {
|
|
2686 |
});
|
2687 |
|
2688 |
// js/v8/info-window.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2689 |
/**
|
2690 |
* @namespace WPGMZA
|
2691 |
-
* @module
|
2692 |
-
* @requires WPGMZA
|
2693 |
*/
|
2694 |
jQuery(function($) {
|
2695 |
-
|
2696 |
/**
|
2697 |
-
*
|
2698 |
-
* @class WPGMZA.
|
2699 |
-
* @constructor WPGMZA.
|
2700 |
* @memberof WPGMZA
|
2701 |
-
* @
|
|
|
2702 |
*/
|
2703 |
-
WPGMZA.
|
2704 |
-
|
2705 |
-
|
2706 |
-
|
2707 |
-
|
2708 |
-
WPGMZA.EventDispatcher.call(this);
|
2709 |
-
|
2710 |
-
WPGMZA.assertInstanceOf(this, "InfoWindow");
|
2711 |
-
|
2712 |
-
this.on("infowindowopen", function(event) {
|
2713 |
-
self.onOpen(event);
|
2714 |
-
});
|
2715 |
|
2716 |
-
if(
|
2717 |
return;
|
2718 |
|
2719 |
-
|
2720 |
-
this.state = WPGMZA.InfoWindow.STATE_CLOSED;
|
2721 |
-
|
2722 |
-
if(feature.map)
|
2723 |
{
|
2724 |
-
//
|
2725 |
-
|
2726 |
-
|
2727 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2728 |
}
|
2729 |
else
|
2730 |
-
|
2731 |
-
|
2732 |
-
|
|
|
2733 |
}
|
2734 |
-
|
2735 |
-
|
2736 |
-
|
2737 |
-
WPGMZA.InfoWindow.prototype = Object.create(WPGMZA.EventDispatcher.prototype);
|
2738 |
-
WPGMZA.InfoWindow.prototype.constructor = WPGMZA.InfoWindow;
|
2739 |
-
|
2740 |
-
WPGMZA.InfoWindow.OPEN_BY_CLICK = 1;
|
2741 |
-
WPGMZA.InfoWindow.OPEN_BY_HOVER = 2;
|
2742 |
-
|
2743 |
-
WPGMZA.InfoWindow.STATE_OPEN = "open";
|
2744 |
-
WPGMZA.InfoWindow.STATE_CLOSED = "closed";
|
2745 |
|
2746 |
/**
|
2747 |
-
*
|
2748 |
-
* @
|
2749 |
-
* @memberof WPGMZA.
|
2750 |
-
* @return {function} The appropriate constructor
|
2751 |
*/
|
2752 |
-
WPGMZA.
|
2753 |
-
{
|
2754 |
-
switch(WPGMZA.settings.engine)
|
2755 |
-
{
|
2756 |
-
case "open-layers":
|
2757 |
-
if(WPGMZA.isProVersion())
|
2758 |
-
return WPGMZA.OLProInfoWindow;
|
2759 |
-
return WPGMZA.OLInfoWindow;
|
2760 |
-
break;
|
2761 |
-
|
2762 |
-
default:
|
2763 |
-
if(WPGMZA.isProVersion())
|
2764 |
-
return WPGMZA.GoogleProInfoWindow;
|
2765 |
-
return WPGMZA.GoogleInfoWindow;
|
2766 |
-
break;
|
2767 |
-
}
|
2768 |
-
}
|
2769 |
|
2770 |
/**
|
2771 |
-
*
|
2772 |
* @method
|
2773 |
-
* @
|
2774 |
-
* @
|
|
|
|
|
2775 |
*/
|
2776 |
-
WPGMZA.
|
2777 |
{
|
2778 |
-
|
2779 |
-
|
|
|
|
|
|
|
|
|
|
|
2780 |
}
|
2781 |
|
2782 |
-
|
|
|
|
|
|
|
2783 |
|
2784 |
-
|
2785 |
-
|
2786 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2787 |
},
|
2788 |
-
|
2789 |
-
|
2790 |
-
|
2791 |
-
this.
|
2792 |
}
|
2793 |
});
|
2794 |
|
2795 |
-
|
2796 |
-
WPGMZA.InfoWindow.prototype.addEditButton = function() {
|
2797 |
-
if (WPGMZA.currentPage == "map-edit") {
|
2798 |
-
return ' <a title="Edit this marker" style="width:15px;" class="wpgmza_edit_btn" data-edit-marker-id="'+this.feature.id+'"><i class="fa fa-edit"></i></a>';
|
2799 |
-
}
|
2800 |
-
return '';
|
2801 |
-
|
2802 |
-
}
|
2803 |
-
|
2804 |
-
WPGMZA.InfoWindow.prototype.workOutDistanceBetweenTwoMarkers = function(location1, location2) {
|
2805 |
-
if(!location1 || !location2)
|
2806 |
-
return; // No location (no search performed, user location unavailable)
|
2807 |
-
|
2808 |
-
var distanceInKM = WPGMZA.Distance.between(location1, location2);
|
2809 |
-
var distanceToDisplay = distanceInKM;
|
2810 |
-
|
2811 |
-
if(this.distanceUnits == WPGMZA.Distance.MILES)
|
2812 |
-
distanceToDisplay /= WPGMZA.Distance.KILOMETERS_PER_MILE;
|
2813 |
-
|
2814 |
-
var text = Math.round(distanceToDisplay, 2);
|
2815 |
-
|
2816 |
-
return text;
|
2817 |
-
}
|
2818 |
-
|
2819 |
-
|
2820 |
/**
|
2821 |
-
*
|
2822 |
-
* @
|
2823 |
-
* @memberof WPGMZA.
|
2824 |
-
* @return void
|
2825 |
-
*/
|
2826 |
-
WPGMZA.InfoWindow.prototype.getContent = function(callback) {
|
2827 |
-
var html = "";
|
2828 |
-
var extra_html = "";
|
2829 |
-
|
2830 |
-
if (this.feature instanceof WPGMZA.Marker) {
|
2831 |
-
// Store locator distance away
|
2832 |
-
// added by Nick 2020-01-12
|
2833 |
-
if (this.feature.map.settings.store_locator_show_distance && this.feature.map.storeLocator && (this.feature.map.storeLocator.state == WPGMZA.StoreLocator.STATE_APPLIED)) {
|
2834 |
-
var currentLatLng = this.feature.getPosition();
|
2835 |
-
var distance = this.workOutDistanceBetweenTwoMarkers(this.feature.map.storeLocator.center, currentLatLng);
|
2836 |
-
|
2837 |
-
extra_html += "<p>"+(this.feature.map.settings.store_locator_distance == WPGMZA.Distance.KILOMETERS ? distance + WPGMZA.localized_strings.kilometers_away : distance + " " + WPGMZA.localized_strings.miles_away)+"</p>";
|
2838 |
-
}
|
2839 |
-
|
2840 |
-
html = this.feature.address+extra_html;
|
2841 |
-
}
|
2842 |
-
|
2843 |
-
if (this.contentHtml){
|
2844 |
-
html = this.contentHtml;
|
2845 |
-
}
|
2846 |
-
|
2847 |
-
|
2848 |
-
if(callback)
|
2849 |
-
callback(html);
|
2850 |
-
|
2851 |
-
return html;
|
2852 |
-
}
|
2853 |
-
|
2854 |
-
/**
|
2855 |
-
* Opens the info window on the specified map, with the specified map object as the subject.
|
2856 |
-
* @method
|
2857 |
-
* @memberof WPGMZA.InfoWindow
|
2858 |
-
* @param {WPGMZA.Map} map The map to open this InfoWindow on.
|
2859 |
-
* @param {WPGMZA.Feature} feature The map object (eg marker, polygon) to open this InfoWindow on.
|
2860 |
-
* @return boolean FALSE if the info window should not and will not open, TRUE if it will. This can be used by subclasses to establish whether or not the subclassed open should bail or open the window.
|
2861 |
-
*/
|
2862 |
-
WPGMZA.InfoWindow.prototype.open = function(map, feature) {
|
2863 |
-
var self = this;
|
2864 |
-
|
2865 |
-
this.feature = feature;
|
2866 |
-
|
2867 |
-
if(WPGMZA.settings.disable_infowindows || WPGMZA.settings.wpgmza_settings_disable_infowindows == "1")
|
2868 |
-
return false;
|
2869 |
-
|
2870 |
-
if(this.feature.disableInfoWindow)
|
2871 |
-
return false;
|
2872 |
-
|
2873 |
-
this.state = WPGMZA.InfoWindow.STATE_OPEN;
|
2874 |
-
|
2875 |
-
return true;
|
2876 |
-
}
|
2877 |
-
|
2878 |
-
/**
|
2879 |
-
* Abstract function, closes this InfoWindow
|
2880 |
-
* @method
|
2881 |
-
* @memberof WPGMZA.InfoWindow
|
2882 |
-
*/
|
2883 |
-
WPGMZA.InfoWindow.prototype.close = function()
|
2884 |
-
{
|
2885 |
-
if(this.state == WPGMZA.InfoWindow.STATE_CLOSED)
|
2886 |
-
return;
|
2887 |
-
|
2888 |
-
this.state = WPGMZA.InfoWindow.STATE_CLOSED;
|
2889 |
-
this.trigger("infowindowclose");
|
2890 |
-
}
|
2891 |
-
|
2892 |
-
/**
|
2893 |
-
* Abstract function, sets the content in this InfoWindow
|
2894 |
-
* @method
|
2895 |
-
* @memberof WPGMZA.InfoWindow
|
2896 |
-
*/
|
2897 |
-
WPGMZA.InfoWindow.prototype.setContent = function(options)
|
2898 |
-
{
|
2899 |
-
|
2900 |
-
}
|
2901 |
-
|
2902 |
-
/**
|
2903 |
-
* Abstract function, sets options on this InfoWindow
|
2904 |
-
* @method
|
2905 |
-
* @memberof WPGMZA.InfoWindow
|
2906 |
-
*/
|
2907 |
-
WPGMZA.InfoWindow.prototype.setOptions = function(options)
|
2908 |
-
{
|
2909 |
-
|
2910 |
-
}
|
2911 |
-
|
2912 |
-
/**
|
2913 |
-
* Event listener for when the map object is added. This will cause the info window to open if the map object has infoopen set
|
2914 |
-
* @method
|
2915 |
-
* @memberof WPGMZA.InfoWindow
|
2916 |
-
* @return void
|
2917 |
-
*/
|
2918 |
-
WPGMZA.InfoWindow.prototype.onFeatureAdded = function()
|
2919 |
-
{
|
2920 |
-
if(this.feature.settings.infoopen == 1)
|
2921 |
-
this.open();
|
2922 |
-
}
|
2923 |
-
|
2924 |
-
WPGMZA.InfoWindow.prototype.onOpen = function()
|
2925 |
-
{
|
2926 |
-
|
2927 |
-
}
|
2928 |
-
|
2929 |
-
});
|
2930 |
-
|
2931 |
-
// js/v8/latlng.js
|
2932 |
-
/**
|
2933 |
-
* @namespace WPGMZA
|
2934 |
-
* @module LatLng
|
2935 |
-
* @requires WPGMZA
|
2936 |
-
*/
|
2937 |
-
jQuery(function($) {
|
2938 |
-
|
2939 |
-
/**
|
2940 |
-
* This class represents a latitude and longitude coordinate pair, and provides utilities to work with coordinates, parsing and conversion.
|
2941 |
-
* @class WPGMZA.LatLng
|
2942 |
-
* @constructor WPGMZA.LatLng
|
2943 |
-
* @memberof WPGMZA
|
2944 |
-
* @param {number|object} arg A latLng literal, or latitude
|
2945 |
-
* @param {number} [lng] The latitude, where arg is a longitude
|
2946 |
-
*/
|
2947 |
-
WPGMZA.LatLng = function(arg, lng)
|
2948 |
-
{
|
2949 |
-
this._lat = 0;
|
2950 |
-
this._lng = 0;
|
2951 |
-
|
2952 |
-
if(arguments.length == 0)
|
2953 |
-
return;
|
2954 |
-
|
2955 |
-
if(arguments.length == 1)
|
2956 |
-
{
|
2957 |
-
// TODO: Support latlng string
|
2958 |
-
|
2959 |
-
if(typeof arg == "string")
|
2960 |
-
{
|
2961 |
-
var m;
|
2962 |
-
|
2963 |
-
if(!(m = arg.match(WPGMZA.LatLng.REGEXP)))
|
2964 |
-
throw new Error("Invalid LatLng string");
|
2965 |
-
|
2966 |
-
arg = {
|
2967 |
-
lat: m[1],
|
2968 |
-
lng: m[3]
|
2969 |
-
};
|
2970 |
-
}
|
2971 |
-
|
2972 |
-
if(typeof arg != "object" || !("lat" in arg && "lng" in arg))
|
2973 |
-
throw new Error("Argument must be a LatLng literal");
|
2974 |
-
|
2975 |
-
this.lat = arg.lat;
|
2976 |
-
this.lng = arg.lng;
|
2977 |
-
}
|
2978 |
-
else
|
2979 |
-
{
|
2980 |
-
this.lat = arg;
|
2981 |
-
this.lng = lng;
|
2982 |
-
}
|
2983 |
-
}
|
2984 |
-
|
2985 |
-
/**
|
2986 |
-
* A regular expression which matches latitude and longitude coordinate pairs from a string. Matches 1 and 3 correspond to latitude and longitude, respectively,
|
2987 |
-
* @constant {RegExp}
|
2988 |
-
* @memberof WPGMZA.LatLng
|
2989 |
-
*/
|
2990 |
-
WPGMZA.LatLng.REGEXP = /^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/;
|
2991 |
-
|
2992 |
-
/**
|
2993 |
-
* Returns true if the supplied object is a LatLng literal, also returns true for instances of WPGMZA.LatLng
|
2994 |
-
* @method
|
2995 |
-
* @static
|
2996 |
-
* @memberof WPGMZA.LatLng
|
2997 |
-
* @param {object} obj A LatLng literal, or an instance of WPGMZA.LatLng
|
2998 |
-
* @return {bool} True if this object is a valid LatLng literal or instance of WPGMZA.LatLng
|
2999 |
-
*/
|
3000 |
-
WPGMZA.LatLng.isValid = function(obj)
|
3001 |
-
{
|
3002 |
-
if(typeof obj != "object")
|
3003 |
-
return false;
|
3004 |
-
|
3005 |
-
if(!("lat" in obj && "lng" in obj))
|
3006 |
-
return false;
|
3007 |
-
|
3008 |
-
return true;
|
3009 |
-
}
|
3010 |
-
|
3011 |
-
WPGMZA.LatLng.isLatLngString = function(str)
|
3012 |
-
{
|
3013 |
-
if(typeof str != "string")
|
3014 |
-
return false;
|
3015 |
-
|
3016 |
-
return str.match(WPGMZA.LatLng.REGEXP) ? true : false;
|
3017 |
-
}
|
3018 |
-
|
3019 |
-
/**
|
3020 |
-
* The latitude, guaranteed to be a number
|
3021 |
-
* @property lat
|
3022 |
-
* @memberof WPGMZA.LatLng
|
3023 |
-
*/
|
3024 |
-
Object.defineProperty(WPGMZA.LatLng.prototype, "lat", {
|
3025 |
-
get: function() {
|
3026 |
-
return this._lat;
|
3027 |
-
},
|
3028 |
-
set: function(val) {
|
3029 |
-
if(!$.isNumeric(val))
|
3030 |
-
throw new Error("Latitude must be numeric");
|
3031 |
-
this._lat = parseFloat( val );
|
3032 |
-
}
|
3033 |
-
});
|
3034 |
-
|
3035 |
-
/**
|
3036 |
-
* The longitude, guaranteed to be a number
|
3037 |
-
* @property lng
|
3038 |
-
* @memberof WPGMZA.LatLng
|
3039 |
*/
|
3040 |
Object.defineProperty(WPGMZA.LatLng.prototype, "lng", {
|
3041 |
get: function() {
|
@@ -3847,273 +3849,278 @@ jQuery(function($) {
|
|
3847 |
});
|
3848 |
|
3849 |
// js/v8/map-settings.js
|
3850 |
-
/**
|
3851 |
-
* @namespace WPGMZA
|
3852 |
-
* @module MapSettings
|
3853 |
-
* @requires WPGMZA
|
3854 |
-
*/
|
3855 |
-
jQuery(function($) {
|
3856 |
-
|
3857 |
-
/**
|
3858 |
-
* Handles map settings, parsing them from the data-settings attribute on the maps HTML element.
|
3859 |
-
* NB: This will be split into GoogleMapSettings and OLMapSettings in the future.
|
3860 |
-
* @class WPGMZA.MapSettings
|
3861 |
-
* @constructor WPGMZA.MapSettings
|
3862 |
-
*/
|
3863 |
-
WPGMZA.MapSettings = function(element)
|
3864 |
-
{
|
3865 |
-
var self = this;
|
3866 |
-
var str = element.getAttribute("data-settings");
|
3867 |
-
var json;
|
3868 |
-
|
3869 |
-
try{
|
3870 |
-
json = JSON.parse(str);
|
3871 |
-
}catch(e) {
|
3872 |
-
|
3873 |
-
str = str.replace(/\\%/g, "%");
|
3874 |
-
str = str.replace(/\\\\"/g, '\\"');
|
3875 |
-
|
3876 |
-
try{
|
3877 |
-
json = JSON.parse(str);
|
3878 |
-
}catch(e) {
|
3879 |
-
json = {};
|
3880 |
-
console.warn("Failed to parse map settings JSON");
|
3881 |
-
}
|
3882 |
-
|
3883 |
-
}
|
3884 |
-
|
3885 |
-
WPGMZA.assertInstanceOf(this, "MapSettings");
|
3886 |
-
|
3887 |
-
|
3888 |
-
|
3889 |
-
function addSettings(input) {
|
3890 |
-
if(!input)
|
3891 |
-
return;
|
3892 |
-
|
3893 |
-
for(var key in input) {
|
3894 |
-
if(key == "other_settings")
|
3895 |
-
continue; // Ignore other_settings
|
3896 |
-
|
3897 |
-
var value = input[key];
|
3898 |
-
|
3899 |
-
if(String(value).match(/^-?\d+$/))
|
3900 |
-
value = parseInt(value);
|
3901 |
-
|
3902 |
-
self[key] = value;
|
3903 |
-
}
|
3904 |
-
}
|
3905 |
-
|
3906 |
-
addSettings(WPGMZA.settings);
|
3907 |
-
|
3908 |
-
addSettings(json);
|
3909 |
-
|
3910 |
-
if(json && json.other_settings)
|
3911 |
-
addSettings(json.other_settings);
|
3912 |
-
|
3913 |
-
}
|
3914 |
-
|
3915 |
-
/**
|
3916 |
-
* Returns settings on this object converted to OpenLayers view options
|
3917 |
-
* @method
|
3918 |
-
* @memberof WPGMZA.MapSettings
|
3919 |
-
* @return {object} The map settings, in a format understood by OpenLayers
|
3920 |
-
*/
|
3921 |
-
WPGMZA.MapSettings.prototype.toOLViewOptions = function()
|
3922 |
-
{
|
3923 |
-
var self = this;
|
3924 |
-
var options = {
|
3925 |
-
center: ol.proj.fromLonLat([-119.4179, 36.7783]),
|
3926 |
-
zoom: 4
|
3927 |
-
};
|
3928 |
-
|
3929 |
-
function empty(name)
|
3930 |
-
{
|
3931 |
-
if(typeof self[name] == "object")
|
3932 |
-
return false;
|
3933 |
-
|
3934 |
-
return !self[name] || !self[name].length;
|
3935 |
-
}
|
3936 |
-
|
3937 |
-
// Start location
|
3938 |
-
if(typeof this.start_location == "string")
|
3939 |
-
{
|
3940 |
-
var coords = this.start_location.replace(/^\(|\)$/g, "").split(",");
|
3941 |
-
if(WPGMZA.isLatLngString(this.start_location))
|
3942 |
-
options.center = ol.proj.fromLonLat([
|
3943 |
-
parseFloat(coords[1]),
|
3944 |
-
parseFloat(coords[0])
|
3945 |
-
]);
|
3946 |
-
else
|
3947 |
-
console.warn("Invalid start location");
|
3948 |
-
}
|
3949 |
-
|
3950 |
-
if(this.center)
|
3951 |
-
{
|
3952 |
-
options.center = ol.proj.fromLonLat([
|
3953 |
-
parseFloat(this.center.lng),
|
3954 |
-
parseFloat(this.center.lat)
|
3955 |
-
]);
|
3956 |
-
}
|
3957 |
-
|
3958 |
-
if(!empty("map_start_lat") && !empty("map_start_lng"))
|
3959 |
-
{
|
3960 |
-
options.center = ol.proj.fromLonLat([
|
3961 |
-
parseFloat(this.map_start_lng),
|
3962 |
-
parseFloat(this.map_start_lat)
|
3963 |
-
]);
|
3964 |
-
}
|
3965 |
-
|
3966 |
-
// Start zoom
|
3967 |
-
if(this.zoom){
|
3968 |
-
options.zoom = parseInt(this.zoom);
|
3969 |
-
}
|
3970 |
-
|
3971 |
-
if(this.start_zoom){
|
3972 |
-
options.zoom = parseInt(this.start_zoom);
|
3973 |
-
}
|
3974 |
-
|
3975 |
-
if(this.map_start_zoom){
|
3976 |
-
options.zoom = parseInt(this.map_start_zoom);
|
3977 |
-
}
|
3978 |
-
|
3979 |
-
// Zoom limits
|
3980 |
-
// TODO: This matches the Google code, so some of these could be potentially put on a parent class
|
3981 |
-
if(this.map_min_zoom && this.map_max_zoom)
|
3982 |
-
{
|
3983 |
-
options.minZoom = Math.min(this.map_min_zoom, this.map_max_zoom);
|
3984 |
-
options.maxZoom = Math.max(this.map_min_zoom, this.map_max_zoom);
|
3985 |
-
}
|
3986 |
-
|
3987 |
-
return options;
|
3988 |
-
}
|
3989 |
-
|
3990 |
-
/**
|
3991 |
-
* Returns settings on this object converted to Google's MapOptions spec.
|
3992 |
-
* @method
|
3993 |
-
* @memberof WPGMZA.MapSettings
|
3994 |
-
* @return {object} The map settings, in the format specified by google.maps.MapOptions
|
3995 |
-
*/
|
3996 |
-
WPGMZA.MapSettings.prototype.toGoogleMapsOptions = function()
|
3997 |
-
{
|
3998 |
-
var self = this;
|
3999 |
-
var latLngCoords = (this.start_location && this.start_location.length ? this.start_location.split(",") : [36.7783, -119.4179]);
|
4000 |
-
|
4001 |
-
function empty(name)
|
4002 |
-
{
|
4003 |
-
if(typeof self[name] == "object")
|
4004 |
-
return false;
|
4005 |
-
|
4006 |
-
return !self[name] || !self[name].length;
|
4007 |
-
}
|
4008 |
-
|
4009 |
-
function formatCoord(coord)
|
4010 |
-
{
|
4011 |
-
if($.isNumeric(coord))
|
4012 |
-
return coord;
|
4013 |
-
return parseFloat( String(coord).replace(/[\(\)\s]/, "") );
|
4014 |
-
}
|
4015 |
-
|
4016 |
-
var latLng = new google.maps.LatLng(
|
4017 |
-
formatCoord(latLngCoords[0]),
|
4018 |
-
formatCoord(latLngCoords[1])
|
4019 |
-
);
|
4020 |
-
|
4021 |
-
var zoom = (this.start_zoom ? parseInt(this.start_zoom) : 4);
|
4022 |
-
|
4023 |
-
if(!this.start_zoom && this.zoom){
|
4024 |
-
zoom = parseInt( this.zoom );
|
4025 |
-
}
|
4026 |
-
|
4027 |
-
if(this.map_start_zoom){
|
4028 |
-
zoom = parseInt(this.map_start_zoom);
|
4029 |
-
}
|
4030 |
-
|
4031 |
-
var options = {
|
4032 |
-
zoom: zoom,
|
4033 |
-
center: latLng
|
4034 |
-
};
|
4035 |
-
|
4036 |
-
if(!empty("center"))
|
4037 |
-
options.center = new google.maps.LatLng({
|
4038 |
-
lat: parseFloat(this.center.lat),
|
4039 |
-
lng: parseFloat(this.center.lng)
|
4040 |
-
});
|
4041 |
-
|
4042 |
-
if(!empty("map_start_lat") && !empty("map_start_lng"))
|
4043 |
-
{
|
4044 |
-
// NB: map_start_lat and map_start_lng are the "real" values. Not sure where start_location comes from
|
4045 |
-
options.center = new google.maps.LatLng({
|
4046 |
-
lat: parseFloat(this.map_start_lat),
|
4047 |
-
lng: parseFloat(this.map_start_lng)
|
4048 |
-
});
|
4049 |
-
}
|
4050 |
-
|
4051 |
-
if(this.map_min_zoom && this.map_max_zoom)
|
4052 |
-
{
|
4053 |
-
options.minZoom = Math.min(this.map_min_zoom, this.map_max_zoom);
|
4054 |
-
options.maxZoom = Math.max(this.map_min_zoom, this.map_max_zoom);
|
4055 |
-
}
|
4056 |
-
|
4057 |
-
// NB: Handles legacy checkboxes as well as new, standard controls
|
4058 |
-
function isSettingDisabled(value)
|
4059 |
-
{
|
4060 |
-
if(value === "yes")
|
4061 |
-
return true;
|
4062 |
-
|
4063 |
-
return (value ? true : false);
|
4064 |
-
}
|
4065 |
-
|
4066 |
-
// These settings are all inverted because the checkbox being set means "disabled"
|
4067 |
-
options.zoomControl = !isSettingDisabled(this.wpgmza_settings_map_zoom);
|
4068 |
-
options.panControl = !isSettingDisabled(this.wpgmza_settings_map_pan);
|
4069 |
-
options.mapTypeControl = !isSettingDisabled(this.wpgmza_settings_map_type);
|
4070 |
-
options.streetViewControl = !isSettingDisabled(this.wpgmza_settings_map_streetview);
|
4071 |
-
options.fullscreenControl = !isSettingDisabled(this.wpgmza_settings_map_full_screen_control);
|
4072 |
-
|
4073 |
-
options.draggable = !isSettingDisabled(this.wpgmza_settings_map_draggable);
|
4074 |
-
options.disableDoubleClickZoom = isSettingDisabled(this.wpgmza_settings_map_clickzoom);
|
4075 |
-
|
4076 |
-
|
4077 |
-
|
4078 |
-
|
4079 |
-
|
4080 |
-
|
4081 |
-
|
4082 |
-
|
4083 |
-
|
4084 |
-
|
4085 |
-
|
4086 |
-
|
4087 |
-
|
4088 |
-
|
4089 |
-
|
4090 |
-
|
4091 |
-
|
4092 |
-
|
4093 |
-
|
4094 |
-
|
4095 |
-
|
4096 |
-
|
4097 |
-
|
4098 |
-
|
4099 |
-
|
4100 |
-
|
4101 |
-
|
4102 |
-
|
4103 |
-
|
4104 |
-
|
4105 |
-
|
4106 |
-
|
4107 |
-
|
4108 |
-
|
4109 |
-
|
4110 |
-
|
4111 |
-
|
4112 |
-
|
4113 |
-
|
4114 |
-
|
4115 |
-
|
4116 |
-
|
|
|
|
|
|
|
|
|
|
|
4117 |
});
|
4118 |
|
4119 |
// js/v8/map.js
|
@@ -8146,426 +8153,426 @@ jQuery(function($) {
|
|
8146 |
});
|
8147 |
|
8148 |
// js/v8/store-locator.js
|
8149 |
-
/**
|
8150 |
-
* @namespace WPGMZA
|
8151 |
-
* @module StoreLocator
|
8152 |
-
* @requires WPGMZA.EventDispatcher
|
8153 |
-
*/
|
8154 |
-
jQuery(function($) {
|
8155 |
-
|
8156 |
-
WPGMZA.StoreLocator = function(map, element)
|
8157 |
-
{
|
8158 |
-
var self = this;
|
8159 |
-
|
8160 |
-
WPGMZA.EventDispatcher.call(this);
|
8161 |
-
|
8162 |
-
this._center = null;
|
8163 |
-
|
8164 |
-
this.map = map;
|
8165 |
-
this.element = element;
|
8166 |
-
this.state = WPGMZA.StoreLocator.STATE_INITIAL;
|
8167 |
-
|
8168 |
-
this.distanceUnits = this.map.settings.store_locator_distance;
|
8169 |
-
|
8170 |
-
this.addressInput = WPGMZA.AddressInput.createInstance(this.addressElement, this.map);
|
8171 |
-
|
8172 |
-
$(element).find(".wpgmza-not-found-msg").hide();
|
8173 |
-
|
8174 |
-
// Default radius
|
8175 |
-
if(this.radiusElement && this.map.settings.wpgmza_store_locator_default_radius){
|
8176 |
-
if(this.radiusElement.find("option[value='" + this.map.settings.wpgmza_store_locator_default_radius + "']").length > 0){
|
8177 |
-
this.radiusElement.val(this.map.settings.wpgmza_store_locator_default_radius);
|
8178 |
-
}
|
8179 |
-
}
|
8180 |
-
|
8181 |
-
// TODO: This will be moved into this module instead of listening to the map event
|
8182 |
-
this.map.on("storelocatorgeocodecomplete", function(event) {
|
8183 |
-
self.onGeocodeComplete(event);
|
8184 |
-
});
|
8185 |
-
|
8186 |
-
this.map.on("init", function(event) {
|
8187 |
-
|
8188 |
-
self.map.markerFilter.on("filteringcomplete", function(event) {
|
8189 |
-
self.onFilteringComplete(event);
|
8190 |
-
});
|
8191 |
-
|
8192 |
-
// Workaround for improper inheritance. Because ModernStoreLocator was written in v7, before this StoreLocator module, the ModernStoreLocator effectively re-arranges the store locators HTML. At some point, ModernStoreLocator should properly inherit from StoreLocator. For now, we'll just initialise this here to get the right look and feel. This is not ideal but it will work.
|
8193 |
-
if(typeof self.map.settings.store_locator_style === 'undefined' || self.map.settings.store_locator_style == "modern" || WPGMZA.settings.user_interface_style === 'modern'){
|
8194 |
-
if(WPGMZA.settings.user_interface_style === 'default' || WPGMZA.settings.user_interface_style == 'modern' || WPGMZA.settings.user_interface_style == 'legacy'){
|
8195 |
-
self.legacyModernAdapter = WPGMZA.ModernStoreLocator.createInstance(map.id);
|
8196 |
-
}
|
8197 |
-
}
|
8198 |
-
|
8199 |
-
});
|
8200 |
-
|
8201 |
-
// Legacy store locator buttons
|
8202 |
-
$(document.body).on("click", ".wpgmza_sl_search_button_" + map.id + ", [data-map-id='" + map.id + "'] .wpgmza_sl_search_button", function(event) {
|
8203 |
-
self.onSearch(event);
|
8204 |
-
});
|
8205 |
-
|
8206 |
-
$(document.body).on("click", ".wpgmza_sl_reset_button_" + map.id + ", [data-map-id='" + map.id + "'] .wpgmza_sl_reset_button_div", function(event) {
|
8207 |
-
self.onReset(event);
|
8208 |
-
});
|
8209 |
-
|
8210 |
-
// Enter listener
|
8211 |
-
$(this.addressElement).on("keypress", function(event) {
|
8212 |
-
|
8213 |
-
if(event.which == 13)
|
8214 |
-
self.onSearch(event);
|
8215 |
-
|
8216 |
-
});
|
8217 |
-
}
|
8218 |
-
|
8219 |
-
WPGMZA.StoreLocator.prototype = Object.create(WPGMZA.EventDispatcher.prototype);
|
8220 |
-
WPGMZA.StoreLocator.prototype.constructor = WPGMZA.StoreLocator;
|
8221 |
-
|
8222 |
-
WPGMZA.StoreLocator.STATE_INITIAL = "initial";
|
8223 |
-
WPGMZA.StoreLocator.STATE_APPLIED = "applied";
|
8224 |
-
|
8225 |
-
WPGMZA.StoreLocator.createInstance = function(map, element)
|
8226 |
-
{
|
8227 |
-
return new WPGMZA.StoreLocator(map, element);
|
8228 |
-
}
|
8229 |
-
|
8230 |
-
Object.defineProperty(WPGMZA.StoreLocator.prototype, "address", {
|
8231 |
-
"get": function() {
|
8232 |
-
return $(this.addressElement).val();
|
8233 |
-
}
|
8234 |
-
});
|
8235 |
-
|
8236 |
-
Object.defineProperty(WPGMZA.StoreLocator.prototype, "addressElement", {
|
8237 |
-
"get": function() {
|
8238 |
-
|
8239 |
-
if(this.legacyModernAdapter)
|
8240 |
-
return $(this.legacyModernAdapter.element).find("input.wpgmza-address")[0];
|
8241 |
-
|
8242 |
-
return $(this.element).find("input.wpgmza-address")[0];
|
8243 |
-
|
8244 |
-
}
|
8245 |
-
});
|
8246 |
-
|
8247 |
-
Object.defineProperty(WPGMZA.StoreLocator.prototype, "countryRestriction", {
|
8248 |
-
"get": function() {
|
8249 |
-
return this.map.settings.wpgmza_store_locator_restrict;
|
8250 |
-
}
|
8251 |
-
});
|
8252 |
-
|
8253 |
-
Object.defineProperty(WPGMZA.StoreLocator.prototype, "radiusElement", {
|
8254 |
-
"get": function() {
|
8255 |
-
return $("#radiusSelect, #radiusSelect_" + this.map.id);
|
8256 |
-
}
|
8257 |
-
});
|
8258 |
-
|
8259 |
-
Object.defineProperty(WPGMZA.StoreLocator.prototype, "radius", {
|
8260 |
-
"get": function() {
|
8261 |
-
return parseFloat(this.radiusElement.val());
|
8262 |
-
}
|
8263 |
-
});
|
8264 |
-
|
8265 |
-
Object.defineProperty(WPGMZA.StoreLocator.prototype, "center", {
|
8266 |
-
"get": function() {
|
8267 |
-
return this._center;
|
8268 |
-
}
|
8269 |
-
});
|
8270 |
-
|
8271 |
-
Object.defineProperty(WPGMZA.StoreLocator.prototype, "bounds", {
|
8272 |
-
"get": function() {
|
8273 |
-
return this._bounds;
|
8274 |
-
}
|
8275 |
-
});
|
8276 |
-
|
8277 |
-
Object.defineProperty(WPGMZA.StoreLocator.prototype, "marker", {
|
8278 |
-
|
8279 |
-
"get": function() {
|
8280 |
-
|
8281 |
-
|
8282 |
-
|
8283 |
-
if(this.map.settings.store_locator_bounce != 1)
|
8284 |
-
return null;
|
8285 |
-
|
8286 |
-
if(this._marker)
|
8287 |
-
return this._marker;
|
8288 |
-
|
8289 |
-
var options = {
|
8290 |
-
visible: false
|
8291 |
-
};
|
8292 |
-
|
8293 |
-
this._marker = WPGMZA.Marker.createInstance(options);
|
8294 |
-
this._marker.disableInfoWindow = true;
|
8295 |
-
this._marker.isFilterable = false;
|
8296 |
-
|
8297 |
-
this._marker.setAnimation(WPGMZA.Marker.ANIMATION_BOUNCE);
|
8298 |
-
|
8299 |
-
return this._marker;
|
8300 |
-
|
8301 |
-
}
|
8302 |
-
|
8303 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8304 |
|
8305 |
-
|
8306 |
-
|
8307 |
-
|
8308 |
-
|
8309 |
-
|
8310 |
-
|
8311 |
-
|
8312 |
-
if(this.map.settings.wpgmza_store_locator_radius_style == "modern" && !WPGMZA.isDeviceiOS())
|
8313 |
-
{
|
8314 |
-
this._circle = WPGMZA.ModernStoreLocatorCircle.createInstance(this.map.id);
|
8315 |
-
this._circle.settings.color = this.circleStrokeColor;
|
8316 |
-
}
|
8317 |
-
else
|
8318 |
-
{
|
8319 |
-
this._circle = WPGMZA.Circle.createInstance({
|
8320 |
-
strokeColor: "#ff0000",
|
8321 |
-
strokeOpacity: "0.25",
|
8322 |
-
strokeWeight: 2,
|
8323 |
-
fillColor: "#ff0000",
|
8324 |
-
fillOpacity: "0.15",
|
8325 |
-
visible: false,
|
8326 |
-
clickable: false,
|
8327 |
-
center: new WPGMZA.LatLng()
|
8328 |
-
});
|
8329 |
-
}
|
8330 |
-
|
8331 |
-
return this._circle;
|
8332 |
-
|
8333 |
-
}
|
8334 |
-
|
8335 |
-
});
|
8336 |
|
8337 |
-
WPGMZA.
|
8338 |
{
|
8339 |
-
|
8340 |
-
{
|
8341 |
-
this._center = null;
|
8342 |
-
this._bounds = null;
|
8343 |
-
|
8344 |
-
return;
|
8345 |
-
}
|
8346 |
-
else
|
8347 |
{
|
8348 |
-
|
8349 |
-
|
|
|
|
|
|
|
|
|
|
|
8350 |
}
|
8351 |
-
|
8352 |
-
this.map.markerFilter.update({}, this);
|
8353 |
}
|
8354 |
|
8355 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8356 |
{
|
8357 |
var self = this;
|
8358 |
|
8359 |
-
|
|
|
|
|
8360 |
|
8361 |
-
|
8362 |
-
if(!this.address || !this.address.length)
|
8363 |
{
|
8364 |
-
this.
|
8365 |
-
return
|
8366 |
}
|
8367 |
|
8368 |
-
if(
|
8369 |
-
WPGMZA.animateScroll(this.map.element);
|
8370 |
-
}
|
8371 |
-
|
8372 |
-
$(this.element).find(".wpgmza-not-found-msg").hide();
|
8373 |
-
|
8374 |
-
function callback(results, status)
|
8375 |
{
|
8376 |
-
|
8377 |
-
|
8378 |
-
results: results,
|
8379 |
-
status: status
|
8380 |
-
});
|
8381 |
-
}
|
8382 |
-
|
8383 |
-
if(!WPGMZA.LatLng.isLatLngString(this.address))
|
8384 |
-
{
|
8385 |
-
var geocoder = WPGMZA.Geocoder.createInstance();
|
8386 |
-
var options = {
|
8387 |
-
address: this.address
|
8388 |
-
};
|
8389 |
-
|
8390 |
-
if(this.countryRestriction)
|
8391 |
-
options.country = this.countryRestriction;
|
8392 |
-
|
8393 |
-
geocoder.geocode(options, function(results, status) {
|
8394 |
-
|
8395 |
-
if(status == WPGMZA.Geocoder.SUCCESS)
|
8396 |
-
callback(results, status);
|
8397 |
-
else{
|
8398 |
-
|
8399 |
-
alert(WPGMZA.localized_strings.address_not_found);
|
8400 |
-
}
|
8401 |
-
|
8402 |
-
});
|
8403 |
-
}
|
8404 |
-
else
|
8405 |
-
callback([WPGMZA.LatLng.fromString(this.address)], WPGMZA.Geocoder.SUCCESS);
|
8406 |
-
|
8407 |
-
return true;
|
8408 |
-
}
|
8409 |
-
|
8410 |
-
WPGMZA.StoreLocator.prototype.onReset = function(event)
|
8411 |
-
{
|
8412 |
-
this.state = WPGMZA.StoreLocator.STATE_INITIAL;
|
8413 |
-
|
8414 |
-
this._center = null;
|
8415 |
-
this._bounds = null;
|
8416 |
-
|
8417 |
-
// NB: Moved in from legacy resetLocations
|
8418 |
-
this.map.setZoom(this.map.settings.map_start_zoom);
|
8419 |
-
|
8420 |
-
$(this.element).find(".wpgmza-not-found-msg").hide();
|
8421 |
-
|
8422 |
-
if(this.circle)
|
8423 |
-
this.circle.setVisible(false);
|
8424 |
-
|
8425 |
-
if(this.marker && this.marker.map)
|
8426 |
-
this.map.removeMarker(this.marker);
|
8427 |
-
|
8428 |
-
this.map.markerFilter.update({}, this);
|
8429 |
-
}
|
8430 |
-
|
8431 |
-
WPGMZA.StoreLocator.prototype.getFilteringParameters = function()
|
8432 |
-
{
|
8433 |
-
if(!this.center)
|
8434 |
-
return {};
|
8435 |
-
|
8436 |
-
return {
|
8437 |
-
center: this.center,
|
8438 |
-
radius: this.radius
|
8439 |
-
};
|
8440 |
-
}
|
8441 |
-
|
8442 |
-
WPGMZA.StoreLocator.prototype.getZoomFromRadius = function(radius){
|
8443 |
-
if(this.distanceUnits == WPGMZA.Distance.MILES)
|
8444 |
-
radius *= WPGMZA.Distance.KILOMETERS_PER_MILE;
|
8445 |
-
|
8446 |
-
return Math.round(14 - Math.log(radius) / Math.LN2);
|
8447 |
-
}
|
8448 |
-
|
8449 |
-
WPGMZA.StoreLocator.prototype.onFilteringComplete = function(event)
|
8450 |
-
{
|
8451 |
-
var params = event.filteringParams;
|
8452 |
-
var marker = this.marker;
|
8453 |
-
|
8454 |
-
if(marker)
|
8455 |
-
marker.setVisible(false);
|
8456 |
-
|
8457 |
-
|
8458 |
-
// Center point marker
|
8459 |
-
if(params.center)
|
8460 |
-
{
|
8461 |
-
this.map.setCenter(params.center);
|
8462 |
-
|
8463 |
-
if(marker)
|
8464 |
-
{
|
8465 |
-
marker.setPosition(params.center);
|
8466 |
-
marker.setVisible(true);
|
8467 |
-
|
8468 |
-
if(marker.map != this.map)
|
8469 |
-
this.map.addMarker(marker);
|
8470 |
-
}
|
8471 |
-
}
|
8472 |
-
|
8473 |
-
// Set zoom level
|
8474 |
-
if(params.radius){
|
8475 |
-
this.map.setZoom(this.getZoomFromRadius(params.radius));
|
8476 |
-
}
|
8477 |
-
|
8478 |
-
// Display circle
|
8479 |
-
var circle = this.circle;
|
8480 |
-
|
8481 |
-
if(circle)
|
8482 |
-
{
|
8483 |
-
circle.setVisible(false);
|
8484 |
-
|
8485 |
-
var factor = (this.distanceUnits == WPGMZA.Distance.MILES ? WPGMZA.Distance.KILOMETERS_PER_MILE : 1.0);
|
8486 |
-
|
8487 |
-
if(params.center && params.radius)
|
8488 |
-
{
|
8489 |
-
circle.setRadius(params.radius * factor);
|
8490 |
-
circle.setCenter(params.center);
|
8491 |
-
circle.setVisible(true);
|
8492 |
-
|
8493 |
-
if(!(circle instanceof WPGMZA.ModernStoreLocatorCircle) && circle.map != this.map)
|
8494 |
-
this.map.addCircle(circle);
|
8495 |
-
}
|
8496 |
-
|
8497 |
-
if(circle instanceof WPGMZA.ModernStoreLocatorCircle)
|
8498 |
-
circle.settings.radiusString = this.radius;
|
8499 |
-
}
|
8500 |
-
|
8501 |
-
if(event.filteredMarkers.length == 0){
|
8502 |
-
if($(this.element).find('.wpgmza-no-results').length > 0 && WPGMZA.settings.user_interface_style === 'legacy'){
|
8503 |
-
$(this.element).find('.wpgmza-no-results').show();
|
8504 |
-
} else {
|
8505 |
-
alert(this.map.settings.store_locator_not_found_message ? this.map.settings.store_locator_not_found_message : WPGMZA.localized_strings.zero_results);
|
8506 |
-
}
|
8507 |
-
}
|
8508 |
-
}
|
8509 |
-
|
8510 |
-
});
|
8511 |
-
|
8512 |
-
// js/v8/text.js
|
8513 |
-
/**
|
8514 |
-
* @namespace WPGMZA
|
8515 |
-
* @module Text
|
8516 |
-
* @requires WPGMZA
|
8517 |
-
*/
|
8518 |
-
jQuery(function($) {
|
8519 |
-
|
8520 |
-
WPGMZA.Text = function(options)
|
8521 |
-
{
|
8522 |
-
if(options)
|
8523 |
-
for(var name in options)
|
8524 |
-
this[name] = options[name];
|
8525 |
-
}
|
8526 |
-
|
8527 |
-
WPGMZA.Text.createInstance = function(options)
|
8528 |
-
{
|
8529 |
-
switch(WPGMZA.settings.engine)
|
8530 |
-
{
|
8531 |
-
case "open-layers":
|
8532 |
-
return new WPGMZA.OLText(options);
|
8533 |
-
break;
|
8534 |
-
|
8535 |
-
default:
|
8536 |
-
return new WPGMZA.GoogleText(options);
|
8537 |
-
break;
|
8538 |
-
}
|
8539 |
-
}
|
8540 |
-
|
8541 |
-
});
|
8542 |
-
|
8543 |
-
// js/v8/theme-editor.js
|
8544 |
-
/**
|
8545 |
-
* @namespace WPGMZA
|
8546 |
-
* @module ThemeEditor
|
8547 |
-
* @requires WPGMZA.EventDispatcher
|
8548 |
-
*/
|
8549 |
-
jQuery(function($) {
|
8550 |
-
|
8551 |
-
WPGMZA.ThemeEditor = function()
|
8552 |
-
{
|
8553 |
-
var self = this;
|
8554 |
-
|
8555 |
-
WPGMZA.EventDispatcher.call(this);
|
8556 |
-
|
8557 |
-
this.element = $("#wpgmza-theme-editor");
|
8558 |
-
|
8559 |
-
if(WPGMZA.settings.engine == "open-layers")
|
8560 |
-
{
|
8561 |
-
this.element.remove();
|
8562 |
-
return;
|
8563 |
-
}
|
8564 |
-
|
8565 |
-
if(!this.element.length)
|
8566 |
-
{
|
8567 |
-
console.warn("No element to initialise theme editor on");
|
8568 |
-
return;
|
8569 |
}
|
8570 |
|
8571 |
this.json = [{}];
|
@@ -9268,4400 +9275,1095 @@ jQuery(function($) {
|
|
9268 |
|
9269 |
});
|
9270 |
|
9271 |
-
// js/v8/
|
9272 |
/**
|
9273 |
* @namespace WPGMZA
|
9274 |
-
* @module
|
9275 |
* @requires WPGMZA
|
9276 |
-
* @description Prevents the document.body.onclick handler firing for markers, which causes the Astra theme to throw an error, preventing the infowindow from opening
|
9277 |
*/
|
9278 |
jQuery(function($) {
|
9279 |
|
9280 |
-
|
9281 |
-
|
9282 |
-
var parent = document.body.onclick;
|
9283 |
-
|
9284 |
-
if(!parent)
|
9285 |
-
return;
|
9286 |
-
|
9287 |
-
document.body.onclick = function(event)
|
9288 |
-
{
|
9289 |
-
if(event.target instanceof WPGMZA.Marker)
|
9290 |
-
return;
|
9291 |
-
|
9292 |
-
parent(event);
|
9293 |
-
}
|
9294 |
-
|
9295 |
-
});
|
9296 |
|
9297 |
});
|
9298 |
|
9299 |
-
// js/v8/
|
|
|
|
|
9300 |
/**
|
9301 |
-
* @namespace WPGMZA
|
9302 |
-
* @module
|
9303 |
-
* @requires WPGMZA
|
9304 |
-
|
9305 |
-
|
9306 |
-
|
9307 |
-
|
9308 |
-
|
9309 |
-
|
9310 |
-
|
9311 |
-
|
9312 |
-
|
9313 |
-
|
9314 |
-
|
9315 |
-
|
9316 |
-
|
9317 |
-
|
9318 |
-
|
9319 |
-
|
9320 |
-
|
9321 |
-
|
9322 |
-
|
9323 |
-
|
9324 |
-
|
9325 |
-
|
9326 |
-
|
9327 |
-
|
9328 |
-
|
9329 |
-
|
9330 |
-
|
9331 |
-
|
9332 |
-
|
9333 |
-
|
9334 |
-
|
9335 |
-
{
|
9336 |
-
|
9337 |
-
|
9338 |
-
|
9339 |
-
|
9340 |
-
|
9341 |
-
|
9342 |
-
|
9343 |
-
|
9344 |
-
|
9345 |
-
|
9346 |
-
|
9347 |
-
|
9348 |
-
|
9349 |
-
|
9350 |
-
|
9351 |
-
|
9352 |
-
|
9353 |
-
|
9354 |
-
|
9355 |
-
|
9356 |
-
|
9357 |
-
|
9358 |
-
|
9359 |
-
|
9360 |
-
|
9361 |
-
|
9362 |
-
|
9363 |
-
|
9364 |
-
|
9365 |
-
|
9366 |
-
|
9367 |
-
|
9368 |
-
|
9369 |
-
|
9370 |
-
|
9371 |
-
|
9372 |
-
|
9373 |
-
|
9374 |
-
|
9375 |
-
|
9376 |
-
|
9377 |
-
|
9378 |
-
|
9379 |
-
|
9380 |
-
|
9381 |
-
|
9382 |
-
|
9383 |
-
|
9384 |
-
|
9385 |
-
|
9386 |
-
|
9387 |
-
|
9388 |
-
|
9389 |
-
|
9390 |
-
|
9391 |
-
|
9392 |
-
|
9393 |
-
|
9394 |
-
|
9395 |
-
|
9396 |
-
|
9397 |
-
|
9398 |
-
|
9399 |
-
|
9400 |
-
|
9401 |
-
|
9402 |
-
|
9403 |
-
|
9404 |
-
|
9405 |
-
|
9406 |
-
|
9407 |
-
|
9408 |
-
|
9409 |
-
|
9410 |
-
|
9411 |
-
|
9412 |
-
|
9413 |
-
|
9414 |
-
|
9415 |
-
|
9416 |
-
|
9417 |
-
|
9418 |
-
|
9419 |
-
|
9420 |
-
|
9421 |
-
|
9422 |
-
|
9423 |
-
|
9424 |
-
|
9425 |
-
|
9426 |
-
|
9427 |
-
|
9428 |
-
|
9429 |
-
|
9430 |
-
|
9431 |
-
|
9432 |
-
|
9433 |
-
|
9434 |
-
|
9435 |
-
|
9436 |
-
|
9437 |
-
|
9438 |
-
|
9439 |
-
|
9440 |
-
|
9441 |
-
|
9442 |
-
|
9443 |
-
|
9444 |
-
|
9445 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9446 |
|
9447 |
-
|
9448 |
-
|
9449 |
-
|
9450 |
-
|
9451 |
-
|
9452 |
-
|
9453 |
-
|
9454 |
-
|
9455 |
-
|
9456 |
-
|
9457 |
-
|
9458 |
-
|
9459 |
-
|
9460 |
-
|
9461 |
-
|
9462 |
-
|
9463 |
-
|
9464 |
-
|
9465 |
-
|
9466 |
-
|
9467 |
-
|
9468 |
-
|
9469 |
-
|
9470 |
-
|
9471 |
-
|
9472 |
-
|
9473 |
-
|
9474 |
-
options.processing = true;
|
9475 |
-
options.serverSide = true;
|
9476 |
-
options.ajax = function(data, callback, settings) {
|
9477 |
-
return WPGMZA.DataTable.prototype.onDataTableAjaxRequest.apply(self, arguments);
|
9478 |
-
}
|
9479 |
-
|
9480 |
-
if(WPGMZA.AdvancedTableDataTable && this instanceof WPGMZA.AdvancedTableDataTable && WPGMZA.settings.wpgmza_default_items)
|
9481 |
-
options.iDisplayLength = parseInt(WPGMZA.settings.wpgmza_default_items);
|
9482 |
-
|
9483 |
-
options.aLengthMenu = [[5, 10, 25, 50, 100, -1], ["5", "10", "25", "50", "100", WPGMZA.localized_strings.all]];
|
9484 |
-
|
9485 |
-
var languageURL = this.getLanguageURL();
|
9486 |
-
if(languageURL)
|
9487 |
-
options.language = {
|
9488 |
-
"url": languageURL
|
9489 |
-
};
|
9490 |
-
|
9491 |
-
return options;
|
9492 |
-
}
|
9493 |
-
|
9494 |
-
WPGMZA.DataTable.prototype.getLanguageURL = function()
|
9495 |
-
{
|
9496 |
-
if(!WPGMZA.locale)
|
9497 |
-
return null;
|
9498 |
-
|
9499 |
-
var languageURL;
|
9500 |
-
|
9501 |
-
switch(WPGMZA.locale.substr(0, 2))
|
9502 |
-
{
|
9503 |
-
case "af":
|
9504 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Afrikaans.json";
|
9505 |
-
break;
|
9506 |
-
|
9507 |
-
case "sq":
|
9508 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Albanian.json";
|
9509 |
-
break;
|
9510 |
-
|
9511 |
-
case "am":
|
9512 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Amharic.json";
|
9513 |
-
break;
|
9514 |
-
|
9515 |
-
case "ar":
|
9516 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Arabic.json";
|
9517 |
-
break;
|
9518 |
-
|
9519 |
-
case "hy":
|
9520 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Armenian.json";
|
9521 |
-
break;
|
9522 |
-
|
9523 |
-
case "az":
|
9524 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Azerbaijan.json";
|
9525 |
-
break;
|
9526 |
-
|
9527 |
-
case "bn":
|
9528 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Bangla.json";
|
9529 |
-
break;
|
9530 |
-
|
9531 |
-
case "eu":
|
9532 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Basque.json";
|
9533 |
-
break;
|
9534 |
-
|
9535 |
-
case "be":
|
9536 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Belarusian.json";
|
9537 |
-
break;
|
9538 |
-
|
9539 |
-
case "bg":
|
9540 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Bulgarian.json";
|
9541 |
-
break;
|
9542 |
-
|
9543 |
-
case "ca":
|
9544 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Catalan.json";
|
9545 |
-
break;
|
9546 |
-
|
9547 |
-
case "zh":
|
9548 |
-
if(WPGMZA.locale == "zh_TW")
|
9549 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Chinese-traditional.json";
|
9550 |
-
else
|
9551 |
-
languageURL = "//cdn.datatables.net/plug-ins/1.10.12/i18n/Chinese.json";
|
9552 |
-
break;
|
9553 |
-
|
9554 |
-
case "hr":
|
9555 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Croatian.json";
|
9556 |
-
break;
|
9557 |
|
9558 |
-
|
9559 |
-
|
9560 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9561 |
|
9562 |
-
|
9563 |
-
|
9564 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9565 |
|
9566 |
-
|
9567 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Dutch.json";
|
9568 |
-
break;
|
9569 |
-
|
9570 |
-
/*case "en":
|
9571 |
-
languageURL = "//cdn.datatables.net/plug-ins/1.10.12/i18n/English.json";
|
9572 |
-
break;*/
|
9573 |
-
|
9574 |
-
case "et":
|
9575 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Estonian.json";
|
9576 |
-
break;
|
9577 |
-
|
9578 |
-
case "fi":
|
9579 |
-
if(WPGMZA.locale.match(/^fil/))
|
9580 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Filipino.json";
|
9581 |
-
else
|
9582 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Finnish.json";
|
9583 |
-
break;
|
9584 |
-
|
9585 |
-
case "fr":
|
9586 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/French.json";
|
9587 |
-
break;
|
9588 |
-
|
9589 |
-
case "gl":
|
9590 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Galician.json";
|
9591 |
-
break;
|
9592 |
-
|
9593 |
-
case "ka":
|
9594 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Georgian.json";
|
9595 |
-
break;
|
9596 |
-
|
9597 |
-
case "de":
|
9598 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/German.json";
|
9599 |
-
break;
|
9600 |
-
|
9601 |
-
case "el":
|
9602 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Greek.json";
|
9603 |
-
break;
|
9604 |
-
|
9605 |
-
case "gu":
|
9606 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Gujarati.json";
|
9607 |
-
break;
|
9608 |
-
|
9609 |
-
case "he":
|
9610 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Hebrew.json";
|
9611 |
-
break;
|
9612 |
-
|
9613 |
-
case "hi":
|
9614 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Hindi.json";
|
9615 |
-
break;
|
9616 |
-
|
9617 |
-
case "hu":
|
9618 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Hungarian.json";
|
9619 |
-
break;
|
9620 |
-
|
9621 |
-
case "is":
|
9622 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Icelandic.json";
|
9623 |
-
break;
|
9624 |
-
|
9625 |
-
/*case "id":
|
9626 |
-
languageURL = "//cdn.datatables.net/plug-ins/1.10.12/i18n/Indonesian-Alternative.json";
|
9627 |
-
break;*/
|
9628 |
-
|
9629 |
-
case "id":
|
9630 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Indonesian.json";
|
9631 |
-
break;
|
9632 |
-
|
9633 |
-
case "ga":
|
9634 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Irish.json";
|
9635 |
-
break;
|
9636 |
-
|
9637 |
-
case "it":
|
9638 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Italian.json";
|
9639 |
-
break;
|
9640 |
-
|
9641 |
-
case "ja":
|
9642 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Japanese.json";
|
9643 |
-
break;
|
9644 |
-
|
9645 |
-
case "kk":
|
9646 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Kazakh.json";
|
9647 |
-
break;
|
9648 |
-
|
9649 |
-
case "ko":
|
9650 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Korean.json";
|
9651 |
-
break;
|
9652 |
-
|
9653 |
-
case "ky":
|
9654 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Kyrgyz.json";
|
9655 |
-
break;
|
9656 |
-
|
9657 |
-
case "lv":
|
9658 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Latvian.json";
|
9659 |
-
break;
|
9660 |
-
|
9661 |
-
case "lt":
|
9662 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Lithuanian.json";
|
9663 |
-
break;
|
9664 |
-
|
9665 |
-
case "mk":
|
9666 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Macedonian.json";
|
9667 |
-
break;
|
9668 |
-
|
9669 |
-
case "ml":
|
9670 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Malay.json";
|
9671 |
-
break;
|
9672 |
-
|
9673 |
-
case "mn":
|
9674 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Mongolian.json";
|
9675 |
-
break;
|
9676 |
-
|
9677 |
-
case "ne":
|
9678 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Nepali.json";
|
9679 |
-
break;
|
9680 |
-
|
9681 |
-
case "nb":
|
9682 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Norwegian-Bokmal.json";
|
9683 |
-
break;
|
9684 |
-
|
9685 |
-
case "nn":
|
9686 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Norwegian-Nynorsk.json";
|
9687 |
-
break;
|
9688 |
-
|
9689 |
-
case "ps":
|
9690 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Pashto.json";
|
9691 |
-
break;
|
9692 |
-
|
9693 |
-
case "fa":
|
9694 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Persian.json";
|
9695 |
-
break;
|
9696 |
-
|
9697 |
-
case "pl":
|
9698 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Polish.json";
|
9699 |
-
break;
|
9700 |
-
|
9701 |
-
case "pt":
|
9702 |
-
if(WPGMZA.locale == "pt_BR")
|
9703 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Portuguese-Brasil.json";
|
9704 |
-
else
|
9705 |
-
languageURL = "//cdn.datatables.net/plug-ins/1.10.12/i18n/Portuguese.json";
|
9706 |
-
break;
|
9707 |
-
|
9708 |
-
case "ro":
|
9709 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Romanian.json";
|
9710 |
-
break;
|
9711 |
-
|
9712 |
-
case "ru":
|
9713 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Russian.json";
|
9714 |
-
break;
|
9715 |
-
|
9716 |
-
case "sr":
|
9717 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Serbian.json";
|
9718 |
-
break;
|
9719 |
-
|
9720 |
-
case "si":
|
9721 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Sinhala.json";
|
9722 |
-
break;
|
9723 |
-
|
9724 |
-
case "sk":
|
9725 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Slovak.json";
|
9726 |
-
break;
|
9727 |
-
|
9728 |
-
case "sl":
|
9729 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Slovenian.json";
|
9730 |
-
break;
|
9731 |
-
|
9732 |
-
case "es":
|
9733 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Spanish.json";
|
9734 |
-
break;
|
9735 |
-
|
9736 |
-
case "sw":
|
9737 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Swahili.json";
|
9738 |
-
break;
|
9739 |
-
|
9740 |
-
case "sv":
|
9741 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Swedish.json";
|
9742 |
-
break;
|
9743 |
-
|
9744 |
-
case "ta":
|
9745 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Tamil.json";
|
9746 |
-
break;
|
9747 |
-
|
9748 |
-
case "te":
|
9749 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/telugu.json";
|
9750 |
-
break;
|
9751 |
-
|
9752 |
-
case "th":
|
9753 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Thai.json";
|
9754 |
-
break;
|
9755 |
-
|
9756 |
-
case "tr":
|
9757 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Turkish.json";
|
9758 |
-
break;
|
9759 |
-
|
9760 |
-
case "uk":
|
9761 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Ukrainian.json";
|
9762 |
-
break;
|
9763 |
-
|
9764 |
-
case "ur":
|
9765 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Urdu.json";
|
9766 |
-
break;
|
9767 |
-
|
9768 |
-
case "uz":
|
9769 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Uzbek.json";
|
9770 |
-
break;
|
9771 |
-
|
9772 |
-
case "vi":
|
9773 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Vietnamese.json";
|
9774 |
-
break;
|
9775 |
-
|
9776 |
-
case "cy":
|
9777 |
-
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Welsh.json";
|
9778 |
-
break;
|
9779 |
-
}
|
9780 |
-
|
9781 |
-
return languageURL;
|
9782 |
-
}
|
9783 |
-
|
9784 |
-
WPGMZA.DataTable.prototype.onAJAXResponse = function(response)
|
9785 |
-
{
|
9786 |
-
|
9787 |
-
}
|
9788 |
-
|
9789 |
-
WPGMZA.DataTable.prototype.reload = function()
|
9790 |
-
{
|
9791 |
-
this.dataTable.ajax.reload(null, false); // null callback, false for resetPaging
|
9792 |
-
}
|
9793 |
-
|
9794 |
-
});
|
9795 |
-
|
9796 |
-
// js/v8/tables/admin-feature-datatable.js
|
9797 |
/**
|
9798 |
* @namespace WPGMZA
|
9799 |
-
* @module
|
9800 |
-
* @requires WPGMZA.
|
9801 |
*/
|
9802 |
jQuery(function($) {
|
9803 |
|
9804 |
-
WPGMZA.
|
9805 |
{
|
9806 |
var self = this;
|
9807 |
-
|
9808 |
-
this.allSelected = false;
|
9809 |
|
9810 |
-
WPGMZA.
|
9811 |
|
9812 |
-
|
9813 |
-
self.onBulkDelete(event);
|
9814 |
-
});
|
9815 |
-
|
9816 |
-
$(element).on("click", ".wpgmza.select_all_markers", function(event) {
|
9817 |
-
self.onSelectAll(event);
|
9818 |
-
});
|
9819 |
|
9820 |
-
|
9821 |
-
|
9822 |
-
|
9823 |
-
|
9824 |
-
|
9825 |
-
|
9826 |
-
|
9827 |
-
|
9828 |
-
|
9829 |
-
|
|
|
|
|
|
|
|
|
|
|
9830 |
|
9831 |
-
|
9832 |
-
return $(this.element).attr("data-wpgmza-feature-type");
|
9833 |
-
}
|
9834 |
|
9835 |
-
|
9836 |
-
|
9837 |
-
|
9838 |
|
9839 |
-
"
|
9840 |
-
|
9841 |
-
}
|
9842 |
|
9843 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9844 |
|
9845 |
-
WPGMZA.
|
|
|
|
|
|
|
9846 |
{
|
9847 |
-
var
|
9848 |
-
var options = WPGMZA.DataTable.prototype.getDataTableSettings.call(this);
|
9849 |
|
9850 |
-
|
|
|
|
|
9851 |
{
|
9852 |
-
|
9853 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9854 |
}
|
9855 |
|
9856 |
-
|
9857 |
}
|
9858 |
|
9859 |
-
WPGMZA.
|
9860 |
{
|
9861 |
-
|
9862 |
-
|
9863 |
-
|
9864 |
-
var plural = this.featureType + "s";
|
9865 |
-
|
9866 |
-
$(this.element).find("input[name='mark']:checked").each(function(index, el) {
|
9867 |
-
var row = $(el).closest("tr")[0];
|
9868 |
-
ids.push(row.wpgmzaFeatureData.id);
|
9869 |
-
});
|
9870 |
-
|
9871 |
-
ids.forEach(function(marker_id) {
|
9872 |
-
var marker = map.getMarkerByID(marker_id);
|
9873 |
-
|
9874 |
-
if(marker)
|
9875 |
-
map.removeMarker(marker);
|
9876 |
});
|
|
|
|
|
|
|
9877 |
|
9878 |
-
WPGMZA.restAPI.call("/" + plural + "/", {
|
9879 |
-
method: "DELETE",
|
9880 |
-
data: {
|
9881 |
-
ids: ids
|
9882 |
-
},
|
9883 |
-
complete: function() {
|
9884 |
-
self.reload();
|
9885 |
-
}
|
9886 |
-
});
|
9887 |
}
|
9888 |
-
|
9889 |
-
WPGMZA.
|
9890 |
-
|
9891 |
-
|
9892 |
-
|
9893 |
-
|
9894 |
-
$(this.element).find("input[name='mark']").each(function(){
|
9895 |
-
if(self.allSelected){
|
9896 |
-
$(this).prop("checked", true);
|
9897 |
-
} else {
|
9898 |
-
$(this).prop("checked", false);
|
9899 |
-
}
|
9900 |
-
});
|
9901 |
}
|
9902 |
|
9903 |
-
|
9904 |
-
WPGMZA.AdminFeatureDataTable.prototype.onCenterMarker = function(event)
|
9905 |
{
|
9906 |
-
var
|
9907 |
-
|
9908 |
-
|
9909 |
-
|
9910 |
-
|
9911 |
-
|
9912 |
-
|
9913 |
-
|
9914 |
-
|
9915 |
-
|
9916 |
-
|
9917 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9918 |
|
9919 |
-
|
9920 |
-
|
9921 |
-
|
9922 |
-
|
9923 |
-
|
9924 |
-
|
9925 |
-
|
9926 |
-
|
9927 |
-
|
9928 |
-
|
9929 |
-
|
9930 |
-
|
9931 |
-
|
9932 |
-
|
|
|
|
|
9933 |
}
|
9934 |
|
9935 |
});
|
9936 |
|
9937 |
-
// js/v8/
|
9938 |
/**
|
9939 |
* @namespace WPGMZA
|
9940 |
-
* @module
|
9941 |
-
* @requires WPGMZA.
|
9942 |
*/
|
9943 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9944 |
|
9945 |
-
|
9946 |
-
|
9947 |
-
|
|
|
|
|
|
|
9948 |
|
9949 |
-
|
9950 |
|
9951 |
-
|
9952 |
-
|
9953 |
-
|
9954 |
-
|
9955 |
-
|
9956 |
-
|
9957 |
-
|
9958 |
-
|
9959 |
-
|
9960 |
-
|
9961 |
-
|
9962 |
-
|
9963 |
-
|
9964 |
-
|
9965 |
-
|
9966 |
-
|
9967 |
-
|
9968 |
-
$(element).find(".wpgmza.bulk_delete_maps").on("click", function(event) {
|
9969 |
-
self.onBulkDelete(event);
|
9970 |
-
});
|
9971 |
-
|
9972 |
-
$(element).on("click", "button[data-action='duplicate']", function(event) {
|
9973 |
-
|
9974 |
-
var map_id = $(event.target).attr('data-map-id');
|
9975 |
-
|
9976 |
-
WPGMZA.restAPI.call("/maps/", {
|
9977 |
-
method: "POST",
|
9978 |
-
data: {
|
9979 |
-
id: map_id,
|
9980 |
-
action: "duplicate"
|
9981 |
-
},
|
9982 |
-
success: function(response, status, xhr) {
|
9983 |
-
self.reload();
|
9984 |
}
|
9985 |
-
|
9986 |
-
|
9987 |
-
|
9988 |
-
|
9989 |
-
$(element).on("click", "button[data-action='trash']", function(event) {
|
9990 |
-
|
9991 |
-
var result = confirm(WPGMZA.localized_strings.map_delete_prompt_text);
|
9992 |
-
|
9993 |
-
if (result) {
|
9994 |
-
|
9995 |
-
var map_id = $(event.target).attr('data-map-id');
|
9996 |
-
|
9997 |
-
WPGMZA.restAPI.call("/maps/", {
|
9998 |
-
method: "DELETE",
|
9999 |
-
data: {
|
10000 |
-
id: map_id
|
10001 |
-
},
|
10002 |
-
success: function(response, status, xhr) {
|
10003 |
-
self.reload();
|
10004 |
-
}
|
10005 |
-
})
|
10006 |
-
}
|
10007 |
-
|
10008 |
-
});
|
10009 |
-
}
|
10010 |
-
|
10011 |
-
WPGMZA.extend(WPGMZA.AdminMapDataTable, WPGMZA.DataTable);
|
10012 |
|
10013 |
-
WPGMZA.AdminMapDataTable.prototype.getDataTableSettings = function()
|
10014 |
-
{
|
10015 |
-
var self = this;
|
10016 |
-
var options = WPGMZA.DataTable.prototype.getDataTableSettings.call(this);
|
10017 |
-
|
10018 |
-
options.createdRow = function(row, data, index)
|
10019 |
-
{
|
10020 |
-
var meta = self.lastResponse.meta[index];
|
10021 |
-
row.wpgmzaMapData = meta;
|
10022 |
}
|
10023 |
|
10024 |
-
|
10025 |
-
|
10026 |
-
|
10027 |
-
|
10028 |
-
|
10029 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10030 |
}
|
10031 |
-
|
10032 |
-
WPGMZA.
|
10033 |
{
|
10034 |
-
|
10035 |
-
|
10036 |
|
10037 |
-
|
10038 |
-
|
10039 |
-
|
|
|
|
|
|
|
|
|
|
|
10040 |
});
|
|
|
10041 |
|
10042 |
-
|
10043 |
-
|
10044 |
-
|
10045 |
-
|
10046 |
-
|
10047 |
-
|
10048 |
-
|
10049 |
-
|
10050 |
-
|
10051 |
-
|
10052 |
-
|
10053 |
-
});
|
10054 |
-
}
|
10055 |
}
|
10056 |
-
|
10057 |
-
|
10058 |
-
|
10059 |
-
$("[data-wpgmza-admin-map-datatable]").each(function(index, el) {
|
10060 |
-
WPGMZA.AdminMapDataTable = new WPGMZA.AdminMapDataTable(el);
|
10061 |
-
});
|
10062 |
-
|
10063 |
-
});
|
10064 |
-
|
10065 |
-
});
|
10066 |
-
|
10067 |
|
10068 |
-
// js/v8/
|
10069 |
/**
|
10070 |
* @namespace WPGMZA
|
10071 |
-
* @module
|
10072 |
-
* @requires WPGMZA
|
10073 |
*/
|
10074 |
jQuery(function($) {
|
10075 |
|
10076 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10077 |
{
|
10078 |
-
|
10079 |
-
|
10080 |
-
this.preventCaching = true;
|
10081 |
-
|
10082 |
-
WPGMZA.DataTable.call(this, element);
|
10083 |
-
|
10084 |
-
// NB: Pro marker panel currently manages edit marker buttons
|
10085 |
-
|
10086 |
-
$(element).on("click", "[data-delete-marker-id]", function(event) {
|
10087 |
-
self.onDeleteMarker(event);
|
10088 |
-
});
|
10089 |
|
10090 |
-
|
10091 |
-
|
10092 |
-
});
|
10093 |
|
10094 |
-
|
10095 |
-
|
10096 |
-
});
|
10097 |
-
|
10098 |
-
$(element).on("click", "[data-center-marker-id]", function(event) {
|
10099 |
-
self.onCenterMarker(event);
|
10100 |
-
});
|
10101 |
}
|
10102 |
|
10103 |
-
WPGMZA.
|
10104 |
-
WPGMZA.AdminMarkerDataTable.prototype.constructor = WPGMZA.AdminMarkerDataTable;
|
10105 |
|
10106 |
-
WPGMZA.
|
10107 |
{
|
10108 |
-
|
|
|
|
|
|
|
|
|
|
|
10109 |
}
|
10110 |
|
10111 |
-
WPGMZA.
|
10112 |
{
|
10113 |
-
|
10114 |
-
var options = WPGMZA.DataTable.prototype.getDataTableSettings.call(this);
|
10115 |
-
|
10116 |
-
options.createdRow = function(row, data, index)
|
10117 |
{
|
10118 |
-
|
10119 |
-
|
10120 |
}
|
10121 |
-
|
10122 |
-
return options;
|
10123 |
}
|
10124 |
|
10125 |
-
WPGMZA.
|
10126 |
{
|
10127 |
-
|
10128 |
}
|
10129 |
|
10130 |
-
WPGMZA.
|
10131 |
{
|
10132 |
-
|
10133 |
-
|
10134 |
|
10135 |
-
|
10136 |
-
action: 'delete_marker',
|
10137 |
-
security: WPGMZA.legacyajaxnonce,
|
10138 |
-
map_id: WPGMZA.mapEditPage.map.id,
|
10139 |
-
marker_id: id
|
10140 |
-
};
|
10141 |
|
10142 |
-
|
10143 |
-
|
10144 |
-
|
10145 |
-
|
10146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10147 |
});
|
|
|
|
|
|
|
|
|
|
|
10148 |
}
|
10149 |
|
10150 |
-
|
10151 |
-
WPGMZA.AdminMarkerDataTable.prototype.onApproveMarker = function(event)
|
10152 |
{
|
10153 |
-
|
10154 |
-
|
10155 |
|
10156 |
-
|
10157 |
-
|
10158 |
-
|
10159 |
-
|
10160 |
-
|
10161 |
-
|
10162 |
-
|
10163 |
-
|
10164 |
-
|
10165 |
-
|
10166 |
-
|
10167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
10168 |
});
|
10169 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10170 |
|
10171 |
-
|
|
|
|
|
10172 |
{
|
10173 |
-
|
|
|
|
|
10174 |
}
|
10175 |
|
10176 |
-
WPGMZA.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10177 |
{
|
10178 |
var self = this;
|
10179 |
-
var ids = [];
|
10180 |
-
var map = WPGMZA.maps[0];
|
10181 |
|
10182 |
-
|
10183 |
-
|
10184 |
-
ids.push(row.wpgmzaMarkerData.id);
|
10185 |
-
});
|
10186 |
|
10187 |
-
|
10188 |
-
|
10189 |
-
|
10190 |
-
|
10191 |
-
|
|
|
10192 |
});
|
10193 |
|
10194 |
-
|
10195 |
-
|
10196 |
-
|
10197 |
-
|
10198 |
-
|
10199 |
-
|
10200 |
-
|
10201 |
-
|
10202 |
});
|
10203 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10204 |
|
10205 |
-
|
10206 |
-
|
10207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10208 |
|
10209 |
-
|
10210 |
-
|
10211 |
-
|
10212 |
-
id = event;
|
10213 |
-
}
|
10214 |
-
else{
|
10215 |
-
id = $(event.currentTarget).attr("data-center-marker-id");
|
10216 |
-
}
|
10217 |
|
10218 |
-
|
10219 |
|
10220 |
-
|
10221 |
-
|
10222 |
-
lat: marker.lat,
|
10223 |
-
lng: marker.lng
|
10224 |
-
});
|
10225 |
|
10226 |
-
|
10227 |
-
|
10228 |
-
|
10229 |
-
|
10230 |
-
|
10231 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10232 |
|
|
|
10233 |
|
|
|
|
|
|
|
10234 |
}
|
10235 |
|
10236 |
-
|
|
|
|
|
10237 |
|
10238 |
-
|
10239 |
-
WPGMZA.adminMarkerDataTable = WPGMZA.AdminMarkerDataTable.createInstance(el);
|
10240 |
-
});
|
10241 |
|
10242 |
-
|
|
|
10243 |
|
10244 |
});
|
10245 |
|
10246 |
-
// js/v8/
|
10247 |
-
/**
|
10248 |
-
* @namespace WPGMZA
|
10249 |
-
* @module
|
10250 |
-
* @requires WPGMZA
|
10251 |
-
|
10252 |
-
|
10253 |
-
|
10254 |
-
|
10255 |
-
|
10256 |
-
|
10257 |
-
|
10258 |
-
|
10259 |
-
|
10260 |
-
|
10261 |
-
|
10262 |
-
|
10263 |
-
|
10264 |
-
|
10265 |
-
|
10266 |
-
|
10267 |
-
|
10268 |
-
|
10269 |
-
|
10270 |
-
|
10271 |
-
|
10272 |
-
|
10273 |
-
* Internal block libraries
|
10274 |
-
*/
|
10275 |
-
jQuery(function ($) {
|
10276 |
-
|
10277 |
-
if (!window.wp || !wp.i18n || !wp.blocks || !wp.editor || !wp.components) return;
|
10278 |
-
|
10279 |
-
var __ = wp.i18n.__;
|
10280 |
-
var registerBlockType = wp.blocks.registerBlockType;
|
10281 |
-
var _wp$editor = wp.editor,
|
10282 |
-
InspectorControls = _wp$editor.InspectorControls,
|
10283 |
-
BlockControls = _wp$editor.BlockControls;
|
10284 |
-
var _wp$components = wp.components,
|
10285 |
-
Dashicon = _wp$components.Dashicon,
|
10286 |
-
Toolbar = _wp$components.Toolbar,
|
10287 |
-
Button = _wp$components.Button,
|
10288 |
-
Tooltip = _wp$components.Tooltip,
|
10289 |
-
PanelBody = _wp$components.PanelBody,
|
10290 |
-
TextareaControl = _wp$components.TextareaControl,
|
10291 |
-
CheckboxControl = _wp$components.CheckboxControl,
|
10292 |
-
TextControl = _wp$components.TextControl,
|
10293 |
-
SelectControl = _wp$components.SelectControl,
|
10294 |
-
RichText = _wp$components.RichText;
|
10295 |
-
|
10296 |
-
|
10297 |
-
WPGMZA.Integration.Gutenberg = function () {
|
10298 |
-
registerBlockType('gutenberg-wpgmza/block', this.getBlockDefinition());
|
10299 |
-
};
|
10300 |
-
|
10301 |
-
WPGMZA.Integration.Gutenberg.prototype.getBlockTitle = function () {
|
10302 |
-
return __("WP Google Maps");
|
10303 |
-
};
|
10304 |
-
|
10305 |
-
WPGMZA.Integration.Gutenberg.prototype.getBlockInspectorControls = function (props) {
|
10306 |
-
|
10307 |
-
/*
|
10308 |
-
<TextControl
|
10309 |
-
name="overrideWidthAmount"
|
10310 |
-
label={__("Override Width Amount")}
|
10311 |
-
checked={props.overrideWidthAmount}
|
10312 |
-
onChange={onPropertiesChanged}
|
10313 |
-
/>
|
10314 |
-
|
10315 |
-
<SelectControl
|
10316 |
-
name="overrideWidthUnits"
|
10317 |
-
label={__("Override Width Units")}
|
10318 |
-
options={[
|
10319 |
-
{value: "px", label: "px"},
|
10320 |
-
{value: "%", label: "%"},
|
10321 |
-
{value: "vw`", label: "vw"},
|
10322 |
-
{value: "vh", label: "vh"}
|
10323 |
-
]}
|
10324 |
-
onChange={onPropertiesChanged}
|
10325 |
-
/>
|
10326 |
-
|
10327 |
-
<CheckboxControl
|
10328 |
-
name="overrideHeight"
|
10329 |
-
label={__("Override Height")}
|
10330 |
-
checked={props.overrideWidth}
|
10331 |
-
onChange={onPropertiesChanged}
|
10332 |
-
/>
|
10333 |
-
|
10334 |
-
<TextControl
|
10335 |
-
name="overrideHeightAmount"
|
10336 |
-
label={__("Override Height Amount")}
|
10337 |
-
checked={props.overrideWidthAmount}
|
10338 |
-
onChange={onPropertiesChanged}
|
10339 |
-
/>
|
10340 |
-
|
10341 |
-
<SelectControl
|
10342 |
-
name="overrideHeightUnits"
|
10343 |
-
label={__("Override Height Units")}
|
10344 |
-
options={[
|
10345 |
-
{value: "px", label: "px"},
|
10346 |
-
{value: "%", label: "%"},
|
10347 |
-
{value: "vw`", label: "vw"},
|
10348 |
-
{value: "vh", label: "vh"}
|
10349 |
-
]}
|
10350 |
-
onChange={onPropertiesChanged}
|
10351 |
-
/>
|
10352 |
-
*/
|
10353 |
-
|
10354 |
-
var onOverrideWidthCheckboxChanged = function onOverrideWidthCheckboxChanged(value) {};
|
10355 |
-
|
10356 |
-
return React.createElement(
|
10357 |
-
InspectorControls,
|
10358 |
-
{ key: "inspector" },
|
10359 |
-
React.createElement(
|
10360 |
-
PanelBody,
|
10361 |
-
{ title: __('Map Settings') },
|
10362 |
-
React.createElement(
|
10363 |
-
"p",
|
10364 |
-
{ "class": "map-block-gutenberg-button-container" },
|
10365 |
-
React.createElement(
|
10366 |
-
"a",
|
10367 |
-
{ href: WPGMZA.adminurl + "admin.php?page=wp-google-maps-menu&action=edit&map_id=1",
|
10368 |
-
target: "_blank",
|
10369 |
-
"class": "button button-primary" },
|
10370 |
-
React.createElement("i", { "class": "fa fa-pencil-square-o", "aria-hidden": "true" }),
|
10371 |
-
__('Go to Map Editor')
|
10372 |
-
)
|
10373 |
-
),
|
10374 |
-
React.createElement(
|
10375 |
-
"p",
|
10376 |
-
{ "class": "map-block-gutenberg-button-container" },
|
10377 |
-
React.createElement(
|
10378 |
-
"a",
|
10379 |
-
{ href: "https://www.wpgmaps.com/documentation/creating-your-first-map/",
|
10380 |
-
target: "_blank",
|
10381 |
-
"class": "button button-primary" },
|
10382 |
-
React.createElement("i", { "class": "fa fa-book", "aria-hidden": "true" }),
|
10383 |
-
__('View Documentation')
|
10384 |
-
)
|
10385 |
-
)
|
10386 |
-
)
|
10387 |
-
);
|
10388 |
-
};
|
10389 |
-
|
10390 |
-
WPGMZA.Integration.Gutenberg.prototype.getBlockAttributes = function () {
|
10391 |
-
return {};
|
10392 |
-
};
|
10393 |
-
|
10394 |
-
WPGMZA.Integration.Gutenberg.prototype.getBlockDefinition = function (props) {
|
10395 |
-
var _this = this;
|
10396 |
-
|
10397 |
-
return {
|
10398 |
-
|
10399 |
-
title: __("WP Google Maps"),
|
10400 |
-
description: __('The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.'),
|
10401 |
-
category: 'common',
|
10402 |
-
icon: 'location-alt',
|
10403 |
-
keywords: [__('Map'), __('Maps'), __('Google')],
|
10404 |
-
attributes: this.getBlockAttributes(),
|
10405 |
-
|
10406 |
-
edit: function edit(props) {
|
10407 |
-
return [!!props.isSelected && _this.getBlockInspectorControls(props), React.createElement(
|
10408 |
-
"div",
|
10409 |
-
{ className: props.className + " wpgmza-gutenberg-block" },
|
10410 |
-
React.createElement(Dashicon, { icon: "location-alt" }),
|
10411 |
-
React.createElement(
|
10412 |
-
"span",
|
10413 |
-
{ "class": "wpgmza-gutenberg-block-title" },
|
10414 |
-
__("Your map will appear here on your websites front end")
|
10415 |
-
)
|
10416 |
-
)];
|
10417 |
-
},
|
10418 |
-
// Defining the front-end interface
|
10419 |
-
save: function save(props) {
|
10420 |
-
// Rendering in PHP
|
10421 |
-
return null;
|
10422 |
-
}
|
10423 |
-
|
10424 |
-
};
|
10425 |
-
};
|
10426 |
-
|
10427 |
-
WPGMZA.Integration.Gutenberg.getConstructor = function () {
|
10428 |
-
return WPGMZA.Integration.Gutenberg;
|
10429 |
-
};
|
10430 |
-
|
10431 |
-
WPGMZA.Integration.Gutenberg.createInstance = function () {
|
10432 |
-
var constructor = WPGMZA.Integration.Gutenberg.getConstructor();
|
10433 |
-
return new constructor();
|
10434 |
-
};
|
10435 |
-
|
10436 |
-
// Allow the Pro module to extend and create the module, only create here when Pro isn't loaded
|
10437 |
-
if(!WPGMZA.isProVersion() && !(/^6/.test(WPGMZA.pro_version))) WPGMZA.integrationModules.gutenberg = WPGMZA.Integration.Gutenberg.createInstance();
|
10438 |
-
});
|
10439 |
|
10440 |
-
|
10441 |
-
|
10442 |
-
|
10443 |
-
|
10444 |
-
|
10445 |
-
|
10446 |
-
|
10447 |
-
|
10448 |
-
|
10449 |
-
|
10450 |
-
|
10451 |
-
|
10452 |
-
|
10453 |
-
|
10454 |
-
|
10455 |
-
|
10456 |
-
|
10457 |
-
|
10458 |
-
|
10459 |
-
|
10460 |
-
|
10461 |
-
|
10462 |
-
|
10463 |
-
|
10464 |
-
|
10465 |
-
|
10466 |
-
|
10467 |
-
|
10468 |
-
|
10469 |
-
);
|
10470 |
-
|
10471 |
-
|
10472 |
-
|
10473 |
-
|
10474 |
-
|
10475 |
-
|
10476 |
-
|
10477 |
-
|
10478 |
-
|
10479 |
-
|
10480 |
-
|
10481 |
-
|
10482 |
-
|
10483 |
-
|
10484 |
-
|
10485 |
-
|
10486 |
-
|
10487 |
-
|
10488 |
-
|
10489 |
-
|
10490 |
-
|
10491 |
-
|
10492 |
-
|
10493 |
-
|
10494 |
-
|
10495 |
-
|
10496 |
-
|
10497 |
-
|
10498 |
-
|
10499 |
-
|
10500 |
-
|
10501 |
-
|
10502 |
-
|
10503 |
-
|
10504 |
-
|
10505 |
-
|
10506 |
-
|
10507 |
-
|
10508 |
-
|
10509 |
-
|
10510 |
-
|
10511 |
-
|
10512 |
-
|
10513 |
-
|
10514 |
-
|
10515 |
-
|
10516 |
-
|
10517 |
-
|
10518 |
-
|
10519 |
-
|
10520 |
-
|
10521 |
-
|
10522 |
-
|
10523 |
-
|
10524 |
-
|
10525 |
-
|
10526 |
-
|
10527 |
-
|
10528 |
-
|
10529 |
-
|
10530 |
-
|
10531 |
-
|
10532 |
-
|
10533 |
-
|
10534 |
-
|
10535 |
-
|
10536 |
-
|
10537 |
-
|
10538 |
-
|
10539 |
-
|
10540 |
-
|
10541 |
-
|
10542 |
-
|
10543 |
-
|
10544 |
-
|
10545 |
-
this.
|
10546 |
-
|
10547 |
-
|
10548 |
-
|
10549 |
-
|
10550 |
-
|
10551 |
-
|
10552 |
-
|
10553 |
-
WPGMZA.OLCircle.prototype.setCenter = function(center)
|
10554 |
-
{
|
10555 |
-
WPGMZA.Circle.prototype.setCenter.apply(this, arguments);
|
10556 |
-
|
10557 |
-
this.recreate();
|
10558 |
-
}
|
10559 |
-
|
10560 |
-
WPGMZA.OLCircle.prototype.getRadius = function()
|
10561 |
-
{
|
10562 |
-
var geom = this.layer.getSource().getFeatures()[0].getGeometry();
|
10563 |
-
return geom.getRadius() / 1000; // Meters to kilometers
|
10564 |
-
}
|
10565 |
-
|
10566 |
-
WPGMZA.OLCircle.prototype.setRadius = function(radius)
|
10567 |
-
{
|
10568 |
-
WPGMZA.Circle.prototype.setRadius.apply(this, arguments);
|
10569 |
-
}
|
10570 |
-
|
10571 |
-
WPGMZA.OLCircle.prototype.setOptions = function(options)
|
10572 |
-
{
|
10573 |
-
Parent.prototype.setOptions.apply(this, arguments);
|
10574 |
-
|
10575 |
-
if("editable" in options)
|
10576 |
-
WPGMZA.OLFeature.setInteractionsOnFeature(this, options.editable);
|
10577 |
-
}
|
10578 |
-
|
10579 |
-
});
|
10580 |
|
10581 |
-
|
10582 |
-
|
10583 |
-
|
10584 |
-
|
10585 |
-
|
10586 |
-
|
10587 |
-
jQuery(function($) {
|
10588 |
-
WPGMZA.OLDrawingManager = function(map)
|
10589 |
-
{
|
10590 |
-
var self = this;
|
10591 |
-
|
10592 |
-
WPGMZA.DrawingManager.call(this, map);
|
10593 |
-
|
10594 |
-
this.source = new ol.source.Vector({wrapX: false});
|
10595 |
-
|
10596 |
-
this.layer = new ol.layer.Vector({
|
10597 |
-
source: this.source
|
10598 |
-
});
|
10599 |
-
|
10600 |
-
/*this.map.on("init", function() {
|
10601 |
-
self.map.olMap.addLayer(self.layer);
|
10602 |
-
});*/
|
10603 |
-
}
|
10604 |
-
|
10605 |
-
WPGMZA.OLDrawingManager.prototype = Object.create(WPGMZA.DrawingManager.prototype);
|
10606 |
-
WPGMZA.OLDrawingManager.prototype.constructor = WPGMZA.OLDrawingManager;
|
10607 |
-
|
10608 |
-
WPGMZA.OLDrawingManager.prototype.setOptions = function(options)
|
10609 |
-
{
|
10610 |
-
var params = {};
|
10611 |
-
|
10612 |
-
if(options.strokeOpacity)
|
10613 |
-
params.stroke = new ol.style.Stroke({
|
10614 |
-
color: WPGMZA.hexOpacityToRGBA(options.strokeColor, options.strokeOpacity)
|
10615 |
-
})
|
10616 |
-
|
10617 |
-
if(options.fillOpacity)
|
10618 |
-
params.fill = new ol.style.Fill({
|
10619 |
-
color: WPGMZA.hexOpacityToRGBA(options.fillColor, options.fillOpacity)
|
10620 |
-
});
|
10621 |
-
|
10622 |
-
this.layer.setStyle(new ol.style.Style(params));
|
10623 |
-
}
|
10624 |
-
|
10625 |
-
WPGMZA.OLDrawingManager.prototype.setDrawingMode = function(mode)
|
10626 |
-
{
|
10627 |
-
var self = this;
|
10628 |
-
var type, endEventType;
|
10629 |
-
|
10630 |
-
WPGMZA.DrawingManager.prototype.setDrawingMode.call(this, mode);
|
10631 |
-
|
10632 |
-
if(this.interaction)
|
10633 |
-
{
|
10634 |
-
this.map.olMap.removeInteraction(this.interaction);
|
10635 |
-
this.interaction = null;
|
10636 |
-
}
|
10637 |
-
|
10638 |
-
switch(mode)
|
10639 |
-
{
|
10640 |
-
case WPGMZA.DrawingManager.MODE_NONE:
|
10641 |
-
return;
|
10642 |
-
break;
|
10643 |
-
|
10644 |
-
case WPGMZA.DrawingManager.MODE_MARKER:
|
10645 |
-
return;
|
10646 |
-
break;
|
10647 |
-
|
10648 |
-
case WPGMZA.DrawingManager.MODE_POLYGON:
|
10649 |
-
type = "Polygon";
|
10650 |
-
endEventType = "polygonclosed";
|
10651 |
-
break;
|
10652 |
-
|
10653 |
-
case WPGMZA.DrawingManager.MODE_POLYLINE:
|
10654 |
-
type = "LineString";
|
10655 |
-
endEventType = "polylinecomplete";
|
10656 |
-
break;
|
10657 |
-
|
10658 |
-
case WPGMZA.DrawingManager.MODE_CIRCLE:
|
10659 |
-
type = "Circle";
|
10660 |
-
endEventType = "circlecomplete";
|
10661 |
-
break;
|
10662 |
-
|
10663 |
-
case WPGMZA.DrawingManager.MODE_RECTANGLE:
|
10664 |
-
type = "Circle";
|
10665 |
-
endEventType = "rectanglecomplete";
|
10666 |
-
break;
|
10667 |
-
|
10668 |
-
case WPGMZA.DrawingManager.MODE_HEATMAP:
|
10669 |
-
return;
|
10670 |
-
break;
|
10671 |
-
|
10672 |
-
default:
|
10673 |
-
throw new Error("Invalid drawing mode");
|
10674 |
-
break;
|
10675 |
-
}
|
10676 |
-
|
10677 |
-
if(WPGMZA.mapEditPage && WPGMZA.mapEditPage.selectInteraction)
|
10678 |
-
{
|
10679 |
-
WPGMZA.mapEditPage.map.olMap.removeInteraction(WPGMZA.mapEditPage.selectInteraction);
|
10680 |
-
}
|
10681 |
-
|
10682 |
-
var options = {
|
10683 |
-
source: this.source,
|
10684 |
-
type: type
|
10685 |
-
};
|
10686 |
-
|
10687 |
-
if(mode == WPGMZA.DrawingManager.MODE_RECTANGLE)
|
10688 |
-
options.geometryFunction = ol.interaction.Draw.createBox();
|
10689 |
-
|
10690 |
-
this.interaction = new ol.interaction.Draw(options);
|
10691 |
-
|
10692 |
-
this.interaction.on("drawend", function(event) {
|
10693 |
-
if(!endEventType)
|
10694 |
-
return;
|
10695 |
-
|
10696 |
-
var WPGMZAEvent = new WPGMZA.Event(endEventType);
|
10697 |
-
|
10698 |
-
switch(mode)
|
10699 |
-
{
|
10700 |
-
case WPGMZA.DrawingManager.MODE_POLYGON:
|
10701 |
-
WPGMZAEvent.enginePolygon = event.feature;
|
10702 |
-
break;
|
10703 |
-
|
10704 |
-
case WPGMZA.DrawingManager.MODE_POLYLINE:
|
10705 |
-
WPGMZAEvent.enginePolyline = event.feature;
|
10706 |
-
break;
|
10707 |
-
|
10708 |
-
case WPGMZA.DrawingManager.MODE_CIRCLE:
|
10709 |
-
WPGMZAEvent.engineCircle = event.feature;
|
10710 |
-
break;
|
10711 |
-
|
10712 |
-
case WPGMZA.DrawingManager.MODE_RECTANGLE:
|
10713 |
-
WPGMZAEvent.engineRectangle = event.feature;
|
10714 |
-
break;
|
10715 |
-
|
10716 |
-
default:
|
10717 |
-
throw new Error("Drawing mode not implemented");
|
10718 |
-
break;
|
10719 |
-
}
|
10720 |
-
|
10721 |
-
self.dispatchEvent(WPGMZAEvent);
|
10722 |
-
});
|
10723 |
-
|
10724 |
-
this.map.olMap.addInteraction(this.interaction);
|
10725 |
-
}
|
10726 |
-
|
10727 |
-
});
|
10728 |
-
|
10729 |
-
// js/v8/open-layers/ol-feature.js
|
10730 |
-
/**
|
10731 |
-
* @namespace WPGMZA
|
10732 |
-
* @module OLFeature
|
10733 |
-
* @requires WPGMZA
|
10734 |
-
*/
|
10735 |
-
jQuery(function($) {
|
10736 |
-
|
10737 |
-
WPGMZA.OLFeature = function(options)
|
10738 |
-
{
|
10739 |
-
WPGMZA.assertInstangeOf(this, "OLFeature");
|
10740 |
-
|
10741 |
-
WPGMZA.Feature.apply(this, arguments);
|
10742 |
-
}
|
10743 |
-
|
10744 |
-
WPGMZA.extend(WPGMZA.OLFeature, WPGMZA.Feature);
|
10745 |
-
|
10746 |
-
WPGMZA.OLFeature.getOLStyle = function(options)
|
10747 |
-
{
|
10748 |
-
var translated = {};
|
10749 |
-
|
10750 |
-
if(!options)
|
10751 |
-
return new ol.style.Style();
|
10752 |
-
|
10753 |
-
options = $.extend({}, options);
|
10754 |
-
|
10755 |
-
// NB: Legacy name support
|
10756 |
-
var map = {
|
10757 |
-
"fillcolor": "fillColor",
|
10758 |
-
"opacity": "fillOpacity",
|
10759 |
-
"linecolor": "strokeColor",
|
10760 |
-
"lineopacity": "strokeOpacity",
|
10761 |
-
"linethickness": "strokeWeight"
|
10762 |
-
};
|
10763 |
-
|
10764 |
-
for(var name in options)
|
10765 |
-
{
|
10766 |
-
if(name in map)
|
10767 |
-
options[map[name]] = options[name];
|
10768 |
-
}
|
10769 |
-
|
10770 |
-
// Translate
|
10771 |
-
if(options.strokeColor)
|
10772 |
-
{
|
10773 |
-
var opacity = 1.0;
|
10774 |
-
var weight = 1;
|
10775 |
-
|
10776 |
-
if("strokeOpacity" in options)
|
10777 |
-
opacity = options.strokeOpacity;
|
10778 |
-
|
10779 |
-
if("strokeWeight" in options)
|
10780 |
-
weight = options.strokeWeight;
|
10781 |
-
|
10782 |
-
translated.stroke = new ol.style.Stroke({
|
10783 |
-
color: WPGMZA.hexOpacityToString(options.strokeColor, opacity),
|
10784 |
-
width: weight
|
10785 |
-
});
|
10786 |
-
}
|
10787 |
-
|
10788 |
-
if(options.fillColor)
|
10789 |
-
{
|
10790 |
-
var opacity = 1.0;
|
10791 |
-
|
10792 |
-
if("fillOpacity" in options)
|
10793 |
-
opacity = options.fillOpacity;
|
10794 |
-
|
10795 |
-
var color = WPGMZA.hexOpacityToString(options.fillColor, opacity);
|
10796 |
-
|
10797 |
-
translated.fill = new ol.style.Fill({
|
10798 |
-
color: color
|
10799 |
-
});
|
10800 |
-
}
|
10801 |
-
|
10802 |
-
return new ol.style.Style(translated);
|
10803 |
-
}
|
10804 |
-
|
10805 |
-
WPGMZA.OLFeature.setInteractionsOnFeature = function(feature, enable)
|
10806 |
-
{
|
10807 |
-
if(enable)
|
10808 |
-
{
|
10809 |
-
if(feature.modifyInteraction)
|
10810 |
-
return;
|
10811 |
-
|
10812 |
-
feature.snapInteraction = new ol.interaction.Snap({
|
10813 |
-
source: feature.layer.getSource()
|
10814 |
-
});
|
10815 |
-
|
10816 |
-
feature.map.olMap.addInteraction(feature.snapInteraction);
|
10817 |
-
|
10818 |
-
feature.modifyInteraction = new ol.interaction.Modify({
|
10819 |
-
source: feature.layer.getSource()
|
10820 |
-
});
|
10821 |
-
|
10822 |
-
feature.map.olMap.addInteraction(feature.modifyInteraction);
|
10823 |
-
|
10824 |
-
feature.modifyInteraction.on("modifyend", function(event) {
|
10825 |
-
feature.trigger("change");
|
10826 |
-
});
|
10827 |
-
|
10828 |
-
// NB: I believe this was causing issues with an older version of OpenLayers when two interactions were simultaneiously on, worth trying again.
|
10829 |
-
/*feature.translateInteraction = new ol.interaction.Translate({
|
10830 |
-
source: feature.layer.getSource()
|
10831 |
-
});
|
10832 |
-
|
10833 |
-
feature.map.olMap.addInteraction(feature.translateInteraction);*/
|
10834 |
-
}
|
10835 |
-
else
|
10836 |
-
{
|
10837 |
-
if(!feature.modifyInteraction)
|
10838 |
-
return;
|
10839 |
-
|
10840 |
-
if(feature.map)
|
10841 |
-
{
|
10842 |
-
feature.map.olMap.removeInteraction(feature.snapInteraction);
|
10843 |
-
feature.map.olMap.removeInteraction(feature.modifyInteraction);
|
10844 |
-
// feature.map.olMap.removeInteraction(feature.translateInteraction);
|
10845 |
-
}
|
10846 |
-
|
10847 |
-
delete feature.snapInteraction;
|
10848 |
-
delete feature.modifyInteraction;
|
10849 |
-
// delete feature.translateInteraction;
|
10850 |
-
}
|
10851 |
-
}
|
10852 |
-
|
10853 |
-
});
|
10854 |
-
|
10855 |
-
// js/v8/open-layers/ol-geocoder.js
|
10856 |
-
/**
|
10857 |
-
* @namespace WPGMZA
|
10858 |
-
* @module OLGeocoder
|
10859 |
-
* @requires WPGMZA.Geocoder
|
10860 |
-
*/
|
10861 |
-
jQuery(function($) {
|
10862 |
-
|
10863 |
-
/**
|
10864 |
-
* @class OLGeocoder
|
10865 |
-
* @extends Geocoder
|
10866 |
-
* @summary OpenLayers geocoder - uses Nominatim by default
|
10867 |
-
*/
|
10868 |
-
WPGMZA.OLGeocoder = function()
|
10869 |
-
{
|
10870 |
-
|
10871 |
-
}
|
10872 |
-
|
10873 |
-
WPGMZA.OLGeocoder.prototype = Object.create(WPGMZA.Geocoder.prototype);
|
10874 |
-
WPGMZA.OLGeocoder.prototype.constructor = WPGMZA.OLGeocoder;
|
10875 |
-
|
10876 |
-
/**
|
10877 |
-
* @function getResponseFromCache
|
10878 |
-
* @access protected
|
10879 |
-
* @summary Tries to retrieve cached coordinates from server cache
|
10880 |
-
* @param {string} address The street address to geocode
|
10881 |
-
* @param {function} callback Where to send the results, as an array
|
10882 |
-
* @return {void}
|
10883 |
-
*/
|
10884 |
-
WPGMZA.OLGeocoder.prototype.getResponseFromCache = function(query, callback)
|
10885 |
-
{
|
10886 |
-
WPGMZA.restAPI.call("/geocode-cache", {
|
10887 |
-
data: {
|
10888 |
-
query: JSON.stringify(query)
|
10889 |
-
},
|
10890 |
-
success: function(response, xhr, status) {
|
10891 |
-
// Legacy compatibility support
|
10892 |
-
response.lng = response.lon;
|
10893 |
-
|
10894 |
-
callback(response);
|
10895 |
-
},
|
10896 |
-
useCompressedPathVariable: true
|
10897 |
-
});
|
10898 |
-
|
10899 |
-
/*$.ajax(WPGMZA.ajaxurl, {
|
10900 |
-
data: {
|
10901 |
-
action: "wpgmza_query_nominatim_cache",
|
10902 |
-
query: JSON.stringify(query)
|
10903 |
-
},
|
10904 |
-
success: function(response, xhr, status) {
|
10905 |
-
// Legacy compatibility support
|
10906 |
-
response.lng = response.lon;
|
10907 |
-
|
10908 |
-
callback(response);
|
10909 |
-
}
|
10910 |
-
});*/
|
10911 |
-
}
|
10912 |
-
|
10913 |
-
/**
|
10914 |
-
* @function getResponseFromNominatim
|
10915 |
-
* @access protected
|
10916 |
-
* @summary Queries Nominatim on the specified address
|
10917 |
-
* @param {object} options An object containing the options for geocoding, address is a mandatory field
|
10918 |
-
* @param {function} callback The function to send the results to, as an array
|
10919 |
-
*/
|
10920 |
-
WPGMZA.OLGeocoder.prototype.getResponseFromNominatim = function(options, callback)
|
10921 |
-
{
|
10922 |
-
var data = {
|
10923 |
-
q: options.address,
|
10924 |
-
format: "json"
|
10925 |
-
};
|
10926 |
-
|
10927 |
-
if(options.componentRestrictions && options.componentRestrictions.country){
|
10928 |
-
data.countrycodes = options.componentRestrictions.country;
|
10929 |
-
} else if(options.country){
|
10930 |
-
data.countrycodes = options.country;
|
10931 |
-
}
|
10932 |
-
|
10933 |
-
$.ajax("https://nominatim.openstreetmap.org/search/", {
|
10934 |
-
data: data,
|
10935 |
-
success: function(response, xhr, status) {
|
10936 |
-
callback(response);
|
10937 |
-
},
|
10938 |
-
error: function(response, xhr, status) {
|
10939 |
-
callback(null, WPGMZA.Geocoder.FAIL)
|
10940 |
-
}
|
10941 |
-
});
|
10942 |
-
}
|
10943 |
-
|
10944 |
-
/**
|
10945 |
-
* @function cacheResponse
|
10946 |
-
* @access protected
|
10947 |
-
* @summary Caches a response on the server, usually after it's been returned from Nominatim
|
10948 |
-
* @param {string} address The street address
|
10949 |
-
* @param {object|array} response The response to cache
|
10950 |
-
* @returns {void}
|
10951 |
-
*/
|
10952 |
-
WPGMZA.OLGeocoder.prototype.cacheResponse = function(query, response)
|
10953 |
-
{
|
10954 |
-
$.ajax(WPGMZA.ajaxurl, {
|
10955 |
-
data: {
|
10956 |
-
action: "wpgmza_store_nominatim_cache",
|
10957 |
-
query: JSON.stringify(query),
|
10958 |
-
response: JSON.stringify(response)
|
10959 |
-
},
|
10960 |
-
method: "POST"
|
10961 |
-
});
|
10962 |
-
}
|
10963 |
-
|
10964 |
-
/**
|
10965 |
-
* @function clearCache
|
10966 |
-
* @access protected
|
10967 |
-
* @summary Clears the Nomanatim geocode cache
|
10968 |
-
* @returns {void}
|
10969 |
-
*/
|
10970 |
-
WPGMZA.OLGeocoder.prototype.clearCache = function(callback)
|
10971 |
-
{
|
10972 |
-
$.ajax(WPGMZA.ajaxurl, {
|
10973 |
-
data: {
|
10974 |
-
action: "wpgmza_clear_nominatim_cache"
|
10975 |
-
},
|
10976 |
-
method: "POST",
|
10977 |
-
success: function(response){
|
10978 |
-
callback(response);
|
10979 |
-
}
|
10980 |
-
});
|
10981 |
-
}
|
10982 |
-
|
10983 |
-
WPGMZA.OLGeocoder.prototype.getLatLngFromAddress = function(options, callback)
|
10984 |
-
{
|
10985 |
-
return WPGMZA.OLGeocoder.prototype.geocode(options, callback);
|
10986 |
-
}
|
10987 |
-
|
10988 |
-
WPGMZA.OLGeocoder.prototype.getAddressFromLatLng = function(options, callback)
|
10989 |
-
{
|
10990 |
-
return WPGMZA.OLGeocoder.prototype.geocode(options, callback);
|
10991 |
-
}
|
10992 |
-
|
10993 |
-
WPGMZA.OLGeocoder.prototype.geocode = function(options, callback)
|
10994 |
-
{
|
10995 |
-
var self = this;
|
10996 |
-
|
10997 |
-
if(!options)
|
10998 |
-
throw new Error("Invalid options");
|
10999 |
-
|
11000 |
-
if(WPGMZA.LatLng.REGEXP.test(options.address))
|
11001 |
-
{
|
11002 |
-
var latLng = WPGMZA.LatLng.fromString(options.address);
|
11003 |
-
|
11004 |
-
callback([{
|
11005 |
-
geometry: {
|
11006 |
-
location: latLng
|
11007 |
-
},
|
11008 |
-
latLng: latLng,
|
11009 |
-
lat: latLng.lat,
|
11010 |
-
lng: latLng.lng
|
11011 |
-
}], WPGMZA.Geocoder.SUCCESS);
|
11012 |
-
|
11013 |
-
return;
|
11014 |
-
}
|
11015 |
-
|
11016 |
-
if(options.location)
|
11017 |
-
options.latLng = new WPGMZA.LatLng(options.location);
|
11018 |
-
|
11019 |
-
var finish, location;
|
11020 |
-
|
11021 |
-
if(options.address)
|
11022 |
-
{
|
11023 |
-
location = options.address;
|
11024 |
-
|
11025 |
-
finish = function(response, status)
|
11026 |
-
{
|
11027 |
-
for(var i = 0; i < response.length; i++)
|
11028 |
-
{
|
11029 |
-
response[i].geometry = {
|
11030 |
-
location: new WPGMZA.LatLng({
|
11031 |
-
lat: parseFloat(response[i].lat),
|
11032 |
-
lng: parseFloat(response[i].lon)
|
11033 |
-
})
|
11034 |
-
};
|
11035 |
-
|
11036 |
-
response[i].latLng = {
|
11037 |
-
lat: parseFloat(response[i].lat),
|
11038 |
-
lng: parseFloat(response[i].lon)
|
11039 |
-
};
|
11040 |
-
|
11041 |
-
response[i].bounds = new WPGMZA.LatLngBounds(
|
11042 |
-
new WPGMZA.LatLng({
|
11043 |
-
lat: response[i].boundingbox[1],
|
11044 |
-
lng: response[i].boundingbox[2]
|
11045 |
-
}),
|
11046 |
-
new WPGMZA.LatLng({
|
11047 |
-
lat: response[i].boundingbox[0],
|
11048 |
-
lng: response[i].boundingbox[3]
|
11049 |
-
})
|
11050 |
-
);
|
11051 |
-
|
11052 |
-
// Backward compatibility with old UGM
|
11053 |
-
response[i].lng = response[i].lon;
|
11054 |
-
}
|
11055 |
-
|
11056 |
-
callback(response, status);
|
11057 |
-
}
|
11058 |
-
}
|
11059 |
-
else if(options.latLng)
|
11060 |
-
{
|
11061 |
-
location = options.latLng.toString();
|
11062 |
-
|
11063 |
-
finish = function(response, status)
|
11064 |
-
{
|
11065 |
-
var address = response[0].display_name;
|
11066 |
-
callback([address], status);
|
11067 |
-
}
|
11068 |
-
}
|
11069 |
-
else
|
11070 |
-
throw new Error("You must supply either a latLng or address")
|
11071 |
-
|
11072 |
-
var query = {location: location, options: options};
|
11073 |
-
this.getResponseFromCache(query, function(response) {
|
11074 |
-
if(response.length)
|
11075 |
-
{
|
11076 |
-
finish(response, WPGMZA.Geocoder.SUCCESS);
|
11077 |
-
return;
|
11078 |
-
}
|
11079 |
-
|
11080 |
-
self.getResponseFromNominatim($.extend(options, {address: location}), function(response, status) {
|
11081 |
-
if(status == WPGMZA.Geocoder.FAIL)
|
11082 |
-
{
|
11083 |
-
callback(null, WPGMZA.Geocoder.FAIL);
|
11084 |
-
return;
|
11085 |
-
}
|
11086 |
-
|
11087 |
-
if(response.length == 0)
|
11088 |
-
{
|
11089 |
-
callback([], WPGMZA.Geocoder.ZERO_RESULTS);
|
11090 |
-
return;
|
11091 |
-
}
|
11092 |
-
|
11093 |
-
finish(response, WPGMZA.Geocoder.SUCCESS);
|
11094 |
-
|
11095 |
-
self.cacheResponse(query, response);
|
11096 |
-
});
|
11097 |
-
});
|
11098 |
-
}
|
11099 |
-
|
11100 |
-
});
|
11101 |
-
|
11102 |
-
// js/v8/open-layers/ol-info-window.js
|
11103 |
-
/**
|
11104 |
-
* @namespace WPGMZA
|
11105 |
-
* @module OLInfoWindow
|
11106 |
-
* @requires WPGMZA.InfoWindow
|
11107 |
-
* @pro-requires WPGMZA.ProInfoWindow
|
11108 |
-
*/
|
11109 |
-
jQuery(function($) {
|
11110 |
-
|
11111 |
-
var Parent;
|
11112 |
-
|
11113 |
-
WPGMZA.OLInfoWindow = function(feature)
|
11114 |
-
{
|
11115 |
-
var self = this;
|
11116 |
-
|
11117 |
-
Parent.call(this, feature);
|
11118 |
-
|
11119 |
-
this.element = $("<div class='wpgmza-infowindow ol-info-window-container ol-info-window-plain'></div>")[0];
|
11120 |
-
|
11121 |
-
$(this.element).on("click", ".ol-info-window-close", function(event) {
|
11122 |
-
self.close();
|
11123 |
-
});
|
11124 |
-
}
|
11125 |
-
|
11126 |
-
if(WPGMZA.isProVersion())
|
11127 |
-
Parent = WPGMZA.ProInfoWindow;
|
11128 |
-
else
|
11129 |
-
Parent = WPGMZA.InfoWindow;
|
11130 |
-
|
11131 |
-
WPGMZA.OLInfoWindow.prototype = Object.create(Parent.prototype);
|
11132 |
-
WPGMZA.OLInfoWindow.prototype.constructor = WPGMZA.OLInfoWindow;
|
11133 |
-
|
11134 |
-
Object.defineProperty(WPGMZA.OLInfoWindow.prototype, "isPanIntoViewAllowed", {
|
11135 |
-
|
11136 |
-
"get": function()
|
11137 |
-
{
|
11138 |
-
return true;
|
11139 |
-
}
|
11140 |
-
|
11141 |
-
});
|
11142 |
-
|
11143 |
-
/**
|
11144 |
-
* Opens the info window
|
11145 |
-
* TODO: This should take a feature, not an event
|
11146 |
-
* @return boolean FALSE if the info window should not & will not open, TRUE if it will
|
11147 |
-
*/
|
11148 |
-
WPGMZA.OLInfoWindow.prototype.open = function(map, feature)
|
11149 |
-
{
|
11150 |
-
var self = this;
|
11151 |
-
var latLng = feature.getPosition();
|
11152 |
-
|
11153 |
-
if(!Parent.prototype.open.call(this, map, feature))
|
11154 |
-
return false;
|
11155 |
-
|
11156 |
-
// Set parent for events to bubble up
|
11157 |
-
this.parent = map;
|
11158 |
-
|
11159 |
-
if(this.overlay)
|
11160 |
-
this.feature.map.olMap.removeOverlay(this.overlay);
|
11161 |
-
|
11162 |
-
this.overlay = new ol.Overlay({
|
11163 |
-
element: this.element,
|
11164 |
-
stopEvent: true,
|
11165 |
-
insertFirst: true
|
11166 |
-
});
|
11167 |
-
|
11168 |
-
this.overlay.setPosition(ol.proj.fromLonLat([
|
11169 |
-
latLng.lng,
|
11170 |
-
latLng.lat
|
11171 |
-
]));
|
11172 |
-
self.feature.map.olMap.addOverlay(this.overlay);
|
11173 |
-
|
11174 |
-
$(this.element).show();
|
11175 |
-
|
11176 |
-
this.setContent(this.content);
|
11177 |
-
|
11178 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
11179 |
-
{
|
11180 |
-
WPGMZA.getImageDimensions(feature.getIcon(), function(size) {
|
11181 |
-
|
11182 |
-
$(self.element).css({left: Math.round(size.width / 2) + "px"});
|
11183 |
-
|
11184 |
-
});
|
11185 |
-
}
|
11186 |
-
|
11187 |
-
this.trigger("infowindowopen");
|
11188 |
-
this.trigger("domready");
|
11189 |
-
}
|
11190 |
-
|
11191 |
-
WPGMZA.OLInfoWindow.prototype.close = function(event)
|
11192 |
-
{
|
11193 |
-
// TODO: Why? This shouldn't have to be here. Removing the overlay should hide the element (it doesn't)
|
11194 |
-
$(this.element).hide();
|
11195 |
-
|
11196 |
-
if(!this.overlay)
|
11197 |
-
return;
|
11198 |
-
|
11199 |
-
WPGMZA.InfoWindow.prototype.close.call(this);
|
11200 |
-
|
11201 |
-
this.trigger("infowindowclose");
|
11202 |
-
|
11203 |
-
this.feature.map.olMap.removeOverlay(this.overlay);
|
11204 |
-
this.overlay = null;
|
11205 |
-
}
|
11206 |
-
|
11207 |
-
WPGMZA.OLInfoWindow.prototype.setContent = function(html)
|
11208 |
-
{
|
11209 |
-
Parent.prototype.setContent.call(this, html);
|
11210 |
-
|
11211 |
-
this.content = html;
|
11212 |
-
var eaBtn = !WPGMZA.isProVersion() ? this.addEditButton() : '';
|
11213 |
-
$(this.element).html(eaBtn+"<i class='fa fa-times ol-info-window-close' aria-hidden='true'></i>" + html);
|
11214 |
-
}
|
11215 |
-
|
11216 |
-
WPGMZA.OLInfoWindow.prototype.setOptions = function(options)
|
11217 |
-
{
|
11218 |
-
if(options.maxWidth)
|
11219 |
-
{
|
11220 |
-
$(this.element).css({"max-width": options.maxWidth + "px"});
|
11221 |
-
}
|
11222 |
-
}
|
11223 |
-
|
11224 |
-
WPGMZA.OLInfoWindow.prototype.onOpen = function()
|
11225 |
-
{
|
11226 |
-
var self = this;
|
11227 |
-
var imgs = $(this.element).find("img");
|
11228 |
-
var numImages = imgs.length;
|
11229 |
-
var numImagesLoaded = 0;
|
11230 |
-
|
11231 |
-
WPGMZA.InfoWindow.prototype.onOpen.apply(this, arguments);
|
11232 |
-
|
11233 |
-
if(this.isPanIntoViewAllowed)
|
11234 |
-
{
|
11235 |
-
function inside(el, viewport)
|
11236 |
-
{
|
11237 |
-
var a = $(el)[0].getBoundingClientRect();
|
11238 |
-
var b = $(viewport)[0].getBoundingClientRect();
|
11239 |
-
|
11240 |
-
return a.left >= b.left && a.left <= b.right &&
|
11241 |
-
a.right <= b.right && a.right >= b.left &&
|
11242 |
-
a.top >= b.top && a.top <= b.bottom &&
|
11243 |
-
a.bottom <= b.bottom && a.bottom >= b.top;
|
11244 |
-
}
|
11245 |
-
|
11246 |
-
function panIntoView()
|
11247 |
-
{
|
11248 |
-
var height = $(self.element).height();
|
11249 |
-
var offset = -height * 0.45;
|
11250 |
-
|
11251 |
-
self.feature.map.animateNudge(0, offset, self.feature.getPosition());
|
11252 |
-
}
|
11253 |
-
|
11254 |
-
imgs.each(function(index, el) {
|
11255 |
-
el.onload = function() {
|
11256 |
-
if(++numImagesLoaded == numImages && !inside(self.element, self.feature.map.element))
|
11257 |
-
panIntoView();
|
11258 |
-
}
|
11259 |
-
});
|
11260 |
-
|
11261 |
-
if(numImages == 0 && !inside(self.element, self.feature.map.element))
|
11262 |
-
panIntoView();
|
11263 |
-
}
|
11264 |
-
}
|
11265 |
-
|
11266 |
-
});
|
11267 |
-
|
11268 |
-
// js/v8/open-layers/ol-map.js
|
11269 |
-
/**
|
11270 |
-
* @namespace WPGMZA
|
11271 |
-
* @module OLMap
|
11272 |
-
* @requires WPGMZA.Map
|
11273 |
-
* @pro-requires WPGMZA.ProMap
|
11274 |
-
*/
|
11275 |
-
jQuery(function($) {
|
11276 |
-
|
11277 |
-
var Parent;
|
11278 |
-
|
11279 |
-
WPGMZA.OLMap = function(element, options)
|
11280 |
-
{
|
11281 |
-
var self = this;
|
11282 |
-
|
11283 |
-
Parent.call(this, element);
|
11284 |
-
|
11285 |
-
this.setOptions(options);
|
11286 |
-
|
11287 |
-
var viewOptions = this.settings.toOLViewOptions();
|
11288 |
-
|
11289 |
-
$(this.element).html("");
|
11290 |
-
|
11291 |
-
this.olMap = new ol.Map({
|
11292 |
-
target: $(element)[0],
|
11293 |
-
layers: [
|
11294 |
-
this.getTileLayer()
|
11295 |
-
],
|
11296 |
-
view: new ol.View(viewOptions)
|
11297 |
-
});
|
11298 |
-
|
11299 |
-
// NB: Handles legacy checkboxes as well as new, standard controls
|
11300 |
-
function isSettingDisabled(value)
|
11301 |
-
{
|
11302 |
-
if(value === "yes")
|
11303 |
-
return true;
|
11304 |
-
|
11305 |
-
return (value ? true : false);
|
11306 |
-
}
|
11307 |
-
|
11308 |
-
// TODO: Re-implement using correct setting names
|
11309 |
-
// Interactions
|
11310 |
-
this.olMap.getInteractions().forEach(function(interaction) {
|
11311 |
-
|
11312 |
-
// NB: The true and false values are flipped because these settings represent the "disabled" state when true
|
11313 |
-
if(interaction instanceof ol.interaction.DragPan)
|
11314 |
-
interaction.setActive(
|
11315 |
-
!isSettingDisabled(self.settings.wpgmza_settings_map_draggable)
|
11316 |
-
);
|
11317 |
-
else if(interaction instanceof ol.interaction.DoubleClickZoom)
|
11318 |
-
interaction.setActive(
|
11319 |
-
!isSettingDisabled(self.settings.wpgmza_settings_map_clickzoom)
|
11320 |
-
);
|
11321 |
-
else if(interaction instanceof ol.interaction.MouseWheelZoom)
|
11322 |
-
interaction.setActive(
|
11323 |
-
!isSettingDisabled(self.settings.wpgmza_settings_map_scroll)
|
11324 |
-
);
|
11325 |
-
|
11326 |
-
}, this);
|
11327 |
-
|
11328 |
-
// Cooperative gesture handling
|
11329 |
-
if(!(this.settings.wpgmza_force_greedy_gestures == "greedy" || this.settings.wpgmza_force_greedy_gestures == "yes" || this.settings.wpgmza_force_greedy_gestures == true))
|
11330 |
-
{
|
11331 |
-
this.gestureOverlay = $("<div class='wpgmza-gesture-overlay'></div>")
|
11332 |
-
this.gestureOverlayTimeoutID = null;
|
11333 |
-
|
11334 |
-
if(WPGMZA.isTouchDevice())
|
11335 |
-
{
|
11336 |
-
// On touch devices, require two fingers to drag and pan
|
11337 |
-
// NB: Temporarily removed due to inconsistent behaviour
|
11338 |
-
/*this.olMap.getInteractions().forEach(function(interaction) {
|
11339 |
-
|
11340 |
-
if(interaction instanceof ol.interaction.DragPan)
|
11341 |
-
self.olMap.removeInteraction(interaction);
|
11342 |
-
|
11343 |
-
});
|
11344 |
-
|
11345 |
-
this.olMap.addInteraction(new ol.interaction.DragPan({
|
11346 |
-
|
11347 |
-
condition: function(olBrowserEvent) {
|
11348 |
-
|
11349 |
-
var allowed = olBrowserEvent.originalEvent.touches.length == 2;
|
11350 |
-
|
11351 |
-
if(!allowed)
|
11352 |
-
self.showGestureOverlay();
|
11353 |
-
|
11354 |
-
return allowed;
|
11355 |
-
}
|
11356 |
-
|
11357 |
-
}));
|
11358 |
-
|
11359 |
-
this.gestureOverlay.text(WPGMZA.localized_strings.use_two_fingers);*/
|
11360 |
-
}
|
11361 |
-
else
|
11362 |
-
{
|
11363 |
-
// On desktops, require Ctrl + zoom to zoom, show an overlay if that condition is not met
|
11364 |
-
this.olMap.on("wheel", function(event) {
|
11365 |
-
|
11366 |
-
if(!ol.events.condition.platformModifierKeyOnly(event))
|
11367 |
-
{
|
11368 |
-
self.showGestureOverlay();
|
11369 |
-
event.originalEvent.preventDefault();
|
11370 |
-
return false;
|
11371 |
-
}
|
11372 |
-
|
11373 |
-
});
|
11374 |
-
|
11375 |
-
this.gestureOverlay.text(WPGMZA.localized_strings.use_ctrl_scroll_to_zoom);
|
11376 |
-
}
|
11377 |
-
}
|
11378 |
-
|
11379 |
-
// Controls
|
11380 |
-
this.olMap.getControls().forEach(function(control) {
|
11381 |
-
|
11382 |
-
// NB: The true and false values are flipped because these settings represent the "disabled" state when true
|
11383 |
-
if(control instanceof ol.control.Zoom && WPGMZA.settings.wpgmza_settings_map_zoom == true)
|
11384 |
-
self.olMap.removeControl(control);
|
11385 |
-
|
11386 |
-
}, this);
|
11387 |
-
|
11388 |
-
if(!isSettingDisabled(WPGMZA.settings.wpgmza_settings_map_full_screen_control))
|
11389 |
-
this.olMap.addControl(new ol.control.FullScreen());
|
11390 |
-
|
11391 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
11392 |
-
{
|
11393 |
-
// Marker layer
|
11394 |
-
this.markerLayer = new ol.layer.Vector({
|
11395 |
-
source: new ol.source.Vector({
|
11396 |
-
features: []
|
11397 |
-
})
|
11398 |
-
});
|
11399 |
-
this.olMap.addLayer(this.markerLayer);
|
11400 |
-
|
11401 |
-
this.olMap.on("click", function(event) {
|
11402 |
-
var features = self.olMap.getFeaturesAtPixel(event.pixel);
|
11403 |
-
|
11404 |
-
if(!features || !features.length)
|
11405 |
-
return;
|
11406 |
-
|
11407 |
-
var marker = features[0].wpgmzaMarker;
|
11408 |
-
|
11409 |
-
if(!marker){
|
11410 |
-
return;
|
11411 |
-
}
|
11412 |
-
|
11413 |
-
marker.trigger("click");
|
11414 |
-
marker.trigger("select");
|
11415 |
-
});
|
11416 |
-
}
|
11417 |
-
|
11418 |
-
// Listen for drag start
|
11419 |
-
this.olMap.on("movestart", function(event) {
|
11420 |
-
self.isBeingDragged = true;
|
11421 |
-
});
|
11422 |
-
|
11423 |
-
// Listen for end of pan so we can wrap longitude if needs be
|
11424 |
-
this.olMap.on("moveend", function(event) {
|
11425 |
-
self.wrapLongitude();
|
11426 |
-
|
11427 |
-
self.isBeingDragged = false;
|
11428 |
-
self.dispatchEvent("dragend");
|
11429 |
-
self.onIdle();
|
11430 |
-
});
|
11431 |
-
|
11432 |
-
// Listen for zoom
|
11433 |
-
this.olMap.getView().on("change:resolution", function(event) {
|
11434 |
-
self.dispatchEvent("zoom_changed");
|
11435 |
-
self.dispatchEvent("zoomchanged");
|
11436 |
-
setTimeout(function() {
|
11437 |
-
self.onIdle();
|
11438 |
-
}, 10);
|
11439 |
-
});
|
11440 |
-
|
11441 |
-
// Listen for bounds changing
|
11442 |
-
this.olMap.getView().on("change", function() {
|
11443 |
-
// Wrap longitude
|
11444 |
-
self.onBoundsChanged();
|
11445 |
-
});
|
11446 |
-
self.onBoundsChanged();
|
11447 |
-
|
11448 |
-
// Hover interaction
|
11449 |
-
this._mouseoverNativeFeatures = [];
|
11450 |
-
|
11451 |
-
this.olMap.on("pointermove", function(event) {
|
11452 |
-
|
11453 |
-
if(event.dragging)
|
11454 |
-
return;
|
11455 |
-
|
11456 |
-
try{
|
11457 |
-
var featuresUnderPixel = event.target.getFeaturesAtPixel(event.pixel);
|
11458 |
-
}catch(e) {
|
11459 |
-
// NB: Hacktacular.. An error is thrown when you mouse over a heatmap. See https://github.com/openlayers/openlayers/issues/10100. This was allegedly solved and merged in but seems to still be present in OpenLayers 6.4.3.
|
11460 |
-
return;
|
11461 |
-
}
|
11462 |
-
|
11463 |
-
if(!featuresUnderPixel)
|
11464 |
-
featuresUnderPixel = [];
|
11465 |
-
|
11466 |
-
var nativeFeaturesUnderPixel = [], i, props;
|
11467 |
-
|
11468 |
-
for(i = 0; i < featuresUnderPixel.length; i++)
|
11469 |
-
{
|
11470 |
-
props = featuresUnderPixel[i].getProperties();
|
11471 |
-
|
11472 |
-
if(!props.wpgmzaFeature)
|
11473 |
-
continue;
|
11474 |
-
|
11475 |
-
nativeFeature = props.wpgmzaFeature;
|
11476 |
-
nativeFeaturesUnderPixel.push(nativeFeature);
|
11477 |
-
|
11478 |
-
if(self._mouseoverNativeFeatures.indexOf(nativeFeature) == -1)
|
11479 |
-
{
|
11480 |
-
// Now hovering over this feature, when we weren't previously
|
11481 |
-
nativeFeature.trigger("mouseover");
|
11482 |
-
self._mouseoverNativeFeatures.push(nativeFeature);
|
11483 |
-
}
|
11484 |
-
}
|
11485 |
-
|
11486 |
-
for(i = self._mouseoverNativeFeatures.length - 1; i >= 0; i--)
|
11487 |
-
{
|
11488 |
-
nativeFeature = self._mouseoverNativeFeatures[i];
|
11489 |
-
|
11490 |
-
if(nativeFeaturesUnderPixel.indexOf(nativeFeature) == -1)
|
11491 |
-
{
|
11492 |
-
// No longer hovering over this feature, where we had been previously
|
11493 |
-
nativeFeature.trigger("mouseout");
|
11494 |
-
self._mouseoverNativeFeatures.splice(i, 1);
|
11495 |
-
}
|
11496 |
-
}
|
11497 |
-
|
11498 |
-
});
|
11499 |
-
|
11500 |
-
// Right click listener
|
11501 |
-
$(this.element).on("click contextmenu", function(event) {
|
11502 |
-
|
11503 |
-
var isRight;
|
11504 |
-
event = event || window.event;
|
11505 |
-
|
11506 |
-
var latLng = self.pixelsToLatLng(event.offsetX, event.offsetY);
|
11507 |
-
|
11508 |
-
if("which" in event)
|
11509 |
-
isRight = event.which == 3;
|
11510 |
-
else if("button" in event)
|
11511 |
-
isRight = event.button == 2;
|
11512 |
-
|
11513 |
-
if(event.which == 1 || event.button == 1){
|
11514 |
-
if(self.isBeingDragged)
|
11515 |
-
return;
|
11516 |
-
|
11517 |
-
// Left click
|
11518 |
-
if($(event.target).closest(".ol-marker").length)
|
11519 |
-
return; // A marker was clicked, not the map. Do nothing
|
11520 |
-
|
11521 |
-
/*
|
11522 |
-
* User is clicking on the map, but looks like it was not a marker...
|
11523 |
-
*
|
11524 |
-
* Finding a light at the end of the tunnel
|
11525 |
-
*/
|
11526 |
-
try{
|
11527 |
-
var featuresUnderPixel = self.olMap.getFeaturesAtPixel([event.offsetX, event.offsetY]);
|
11528 |
-
}catch(e) {
|
11529 |
-
return;
|
11530 |
-
}
|
11531 |
-
|
11532 |
-
if(!featuresUnderPixel)
|
11533 |
-
featuresUnderPixel = [];
|
11534 |
-
|
11535 |
-
var nativeFeaturesUnderPixel = [], i, props;
|
11536 |
-
for(i = 0; i < featuresUnderPixel.length; i++){
|
11537 |
-
props = featuresUnderPixel[i].getProperties();
|
11538 |
-
|
11539 |
-
if(!props.wpgmzaFeature)
|
11540 |
-
continue;
|
11541 |
-
|
11542 |
-
nativeFeature = props.wpgmzaFeature;
|
11543 |
-
nativeFeaturesUnderPixel.push(nativeFeature);
|
11544 |
-
|
11545 |
-
nativeFeature.trigger("click");
|
11546 |
-
}
|
11547 |
-
|
11548 |
-
self.trigger({
|
11549 |
-
type: "click",
|
11550 |
-
latLng: latLng
|
11551 |
-
});
|
11552 |
-
|
11553 |
-
return;
|
11554 |
-
}
|
11555 |
-
|
11556 |
-
if(!isRight){
|
11557 |
-
return;
|
11558 |
-
}
|
11559 |
-
|
11560 |
-
return self.onRightClick(event);
|
11561 |
-
});
|
11562 |
-
|
11563 |
-
// Dispatch event
|
11564 |
-
if(!WPGMZA.isProVersion())
|
11565 |
-
{
|
11566 |
-
this.trigger("init");
|
11567 |
-
|
11568 |
-
this.dispatchEvent("created");
|
11569 |
-
WPGMZA.events.dispatchEvent({type: "mapcreated", map: this});
|
11570 |
-
|
11571 |
-
// Legacy event
|
11572 |
-
$(this.element).trigger("wpgooglemaps_loaded");
|
11573 |
-
}
|
11574 |
-
}
|
11575 |
-
|
11576 |
-
if(WPGMZA.isProVersion())
|
11577 |
-
Parent = WPGMZA.ProMap;
|
11578 |
-
else
|
11579 |
-
Parent = WPGMZA.Map;
|
11580 |
-
|
11581 |
-
WPGMZA.OLMap.prototype = Object.create(Parent.prototype);
|
11582 |
-
WPGMZA.OLMap.prototype.constructor = WPGMZA.OLMap;
|
11583 |
-
|
11584 |
-
WPGMZA.OLMap.prototype.getTileLayer = function()
|
11585 |
-
{
|
11586 |
-
var options = {};
|
11587 |
-
|
11588 |
-
if(WPGMZA.settings.tile_server_url){
|
11589 |
-
options.url = WPGMZA.settings.tile_server_url;
|
11590 |
-
|
11591 |
-
if(WPGMZA.settings.tile_server_url === 'custom_override'){
|
11592 |
-
if(WPGMZA.settings.tile_server_url_override && WPGMZA.settings.tile_server_url_override.trim() !== ""){
|
11593 |
-
options.url = WPGMZA.settings.tile_server_url_override.trim();
|
11594 |
-
} else {
|
11595 |
-
//Override attempt, let's default?
|
11596 |
-
options.url = "https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
11597 |
-
}
|
11598 |
-
}
|
11599 |
-
|
11600 |
-
if(WPGMZA.settings.open_layers_api_key && WPGMZA.settings.open_layers_api_key !== ""){
|
11601 |
-
options.url += "?apikey=" + WPGMZA.settings.open_layers_api_key.trim();
|
11602 |
-
}
|
11603 |
-
}
|
11604 |
-
|
11605 |
-
return new ol.layer.Tile({
|
11606 |
-
source: new ol.source.OSM(options)
|
11607 |
-
});
|
11608 |
-
}
|
11609 |
-
|
11610 |
-
WPGMZA.OLMap.prototype.wrapLongitude = function()
|
11611 |
-
{
|
11612 |
-
var transformed = ol.proj.transform(this.olMap.getView().getCenter(), "EPSG:3857", "EPSG:4326");
|
11613 |
-
var center = {
|
11614 |
-
lat: transformed[1],
|
11615 |
-
lng: transformed[0]
|
11616 |
-
};
|
11617 |
-
|
11618 |
-
if(center.lng >= -180 && center.lng <= 180)
|
11619 |
-
return;
|
11620 |
-
|
11621 |
-
center.lng = center.lng - 360 * Math.floor(center.lng / 360);
|
11622 |
-
|
11623 |
-
if(center.lng > 180)
|
11624 |
-
center.lng -= 360;
|
11625 |
-
|
11626 |
-
this.setCenter(center);
|
11627 |
-
}
|
11628 |
-
|
11629 |
-
WPGMZA.OLMap.prototype.getCenter = function()
|
11630 |
-
{
|
11631 |
-
var lonLat = ol.proj.toLonLat(
|
11632 |
-
this.olMap.getView().getCenter()
|
11633 |
-
);
|
11634 |
-
return {
|
11635 |
-
lat: lonLat[1],
|
11636 |
-
lng: lonLat[0]
|
11637 |
-
};
|
11638 |
-
}
|
11639 |
-
|
11640 |
-
WPGMZA.OLMap.prototype.setCenter = function(latLng)
|
11641 |
-
{
|
11642 |
-
var view = this.olMap.getView();
|
11643 |
-
|
11644 |
-
WPGMZA.Map.prototype.setCenter.call(this, latLng);
|
11645 |
-
|
11646 |
-
view.setCenter(ol.proj.fromLonLat([
|
11647 |
-
latLng.lng,
|
11648 |
-
latLng.lat
|
11649 |
-
]));
|
11650 |
-
|
11651 |
-
this.wrapLongitude();
|
11652 |
-
|
11653 |
-
this.onBoundsChanged();
|
11654 |
-
}
|
11655 |
-
|
11656 |
-
WPGMZA.OLMap.prototype.getBounds = function()
|
11657 |
-
{
|
11658 |
-
var bounds = this.olMap.getView().calculateExtent(this.olMap.getSize());
|
11659 |
-
var nativeBounds = new WPGMZA.LatLngBounds();
|
11660 |
-
|
11661 |
-
var topLeft = ol.proj.toLonLat([bounds[0], bounds[1]]);
|
11662 |
-
var bottomRight = ol.proj.toLonLat([bounds[2], bounds[3]]);
|
11663 |
-
|
11664 |
-
nativeBounds.north = topLeft[1];
|
11665 |
-
nativeBounds.south = bottomRight[1];
|
11666 |
-
|
11667 |
-
nativeBounds.west = topLeft[0];
|
11668 |
-
nativeBounds.east = bottomRight[0];
|
11669 |
-
|
11670 |
-
return nativeBounds;
|
11671 |
-
}
|
11672 |
-
|
11673 |
-
/**
|
11674 |
-
* Fit to given boundaries
|
11675 |
-
* @return void
|
11676 |
-
*/
|
11677 |
-
WPGMZA.OLMap.prototype.fitBounds = function(southWest, northEast)
|
11678 |
-
{
|
11679 |
-
if(southWest instanceof WPGMZA.LatLng)
|
11680 |
-
southWest = {lat: southWest.lat, lng: southWest.lng};
|
11681 |
-
if(northEast instanceof WPGMZA.LatLng)
|
11682 |
-
northEast = {lat: northEast.lat, lng: northEast.lng};
|
11683 |
-
else if(southWest instanceof WPGMZA.LatLngBounds)
|
11684 |
-
{
|
11685 |
-
var bounds = southWest;
|
11686 |
-
|
11687 |
-
southWest = {
|
11688 |
-
lat: bounds.south,
|
11689 |
-
lng: bounds.west
|
11690 |
-
};
|
11691 |
-
|
11692 |
-
northEast = {
|
11693 |
-
lat: bounds.north,
|
11694 |
-
lng: bounds.east
|
11695 |
-
};
|
11696 |
-
}
|
11697 |
-
|
11698 |
-
var view = this.olMap.getView();
|
11699 |
-
|
11700 |
-
var extent = ol.extent.boundingExtent([
|
11701 |
-
ol.proj.fromLonLat([
|
11702 |
-
parseFloat(southWest.lng),
|
11703 |
-
parseFloat(southWest.lat)
|
11704 |
-
]),
|
11705 |
-
ol.proj.fromLonLat([
|
11706 |
-
parseFloat(northEast.lng),
|
11707 |
-
parseFloat(northEast.lat)
|
11708 |
-
])
|
11709 |
-
]);
|
11710 |
-
view.fit(extent, this.olMap.getSize());
|
11711 |
-
}
|
11712 |
-
|
11713 |
-
WPGMZA.OLMap.prototype.panTo = function(latLng, zoom)
|
11714 |
-
{
|
11715 |
-
var view = this.olMap.getView();
|
11716 |
-
var options = {
|
11717 |
-
center: ol.proj.fromLonLat([
|
11718 |
-
parseFloat(latLng.lng),
|
11719 |
-
parseFloat(latLng.lat),
|
11720 |
-
]),
|
11721 |
-
duration: 500
|
11722 |
-
};
|
11723 |
-
|
11724 |
-
if(arguments.length > 1)
|
11725 |
-
options.zoom = parseInt(zoom);
|
11726 |
-
|
11727 |
-
view.animate(options);
|
11728 |
-
}
|
11729 |
-
|
11730 |
-
WPGMZA.OLMap.prototype.getZoom = function()
|
11731 |
-
{
|
11732 |
-
return Math.round( this.olMap.getView().getZoom() );
|
11733 |
-
}
|
11734 |
-
|
11735 |
-
WPGMZA.OLMap.prototype.setZoom = function(value)
|
11736 |
-
{
|
11737 |
-
this.olMap.getView().setZoom(value);
|
11738 |
-
}
|
11739 |
-
|
11740 |
-
WPGMZA.OLMap.prototype.getMinZoom = function()
|
11741 |
-
{
|
11742 |
-
return this.olMap.getView().getMinZoom();
|
11743 |
-
}
|
11744 |
-
|
11745 |
-
WPGMZA.OLMap.prototype.setMinZoom = function(value)
|
11746 |
-
{
|
11747 |
-
this.olMap.getView().setMinZoom(value);
|
11748 |
-
}
|
11749 |
-
|
11750 |
-
WPGMZA.OLMap.prototype.getMaxZoom = function()
|
11751 |
-
{
|
11752 |
-
return this.olMap.getView().getMaxZoom();
|
11753 |
-
}
|
11754 |
-
|
11755 |
-
WPGMZA.OLMap.prototype.setMaxZoom = function(value)
|
11756 |
-
{
|
11757 |
-
this.olMap.getView().setMaxZoom(value);
|
11758 |
-
}
|
11759 |
-
|
11760 |
-
WPGMZA.OLMap.prototype.setOptions = function(options)
|
11761 |
-
{
|
11762 |
-
Parent.prototype.setOptions.call(this, options);
|
11763 |
-
|
11764 |
-
if(!this.olMap)
|
11765 |
-
return;
|
11766 |
-
|
11767 |
-
this.olMap.getView().setProperties( this.settings.toOLViewOptions() );
|
11768 |
-
}
|
11769 |
-
|
11770 |
-
/**
|
11771 |
-
* TODO: Consider moving all these functions to their respective classes, same on google map (DO IT!!! It's very misleading having them here)
|
11772 |
-
*/
|
11773 |
-
WPGMZA.OLMap.prototype.addMarker = function(marker)
|
11774 |
-
{
|
11775 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT)
|
11776 |
-
this.olMap.addOverlay(marker.overlay);
|
11777 |
-
else
|
11778 |
-
{
|
11779 |
-
this.markerLayer.getSource().addFeature(marker.feature);
|
11780 |
-
marker.featureInSource = true;
|
11781 |
-
}
|
11782 |
-
|
11783 |
-
Parent.prototype.addMarker.call(this, marker);
|
11784 |
-
}
|
11785 |
-
|
11786 |
-
WPGMZA.OLMap.prototype.removeMarker = function(marker)
|
11787 |
-
{
|
11788 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT)
|
11789 |
-
this.olMap.removeOverlay(marker.overlay);
|
11790 |
-
else
|
11791 |
-
{
|
11792 |
-
this.markerLayer.getSource().removeFeature(marker.feature);
|
11793 |
-
marker.featureInSource = false;
|
11794 |
-
}
|
11795 |
-
|
11796 |
-
Parent.prototype.removeMarker.call(this, marker);
|
11797 |
-
}
|
11798 |
-
|
11799 |
-
WPGMZA.OLMap.prototype.addPolygon = function(polygon)
|
11800 |
-
{
|
11801 |
-
this.olMap.addLayer(polygon.layer);
|
11802 |
-
|
11803 |
-
Parent.prototype.addPolygon.call(this, polygon);
|
11804 |
-
}
|
11805 |
-
|
11806 |
-
WPGMZA.OLMap.prototype.removePolygon = function(polygon)
|
11807 |
-
{
|
11808 |
-
this.olMap.removeLayer(polygon.layer);
|
11809 |
-
|
11810 |
-
Parent.prototype.removePolygon.call(this, polygon);
|
11811 |
-
}
|
11812 |
-
|
11813 |
-
WPGMZA.OLMap.prototype.addPolyline = function(polyline)
|
11814 |
-
{
|
11815 |
-
this.olMap.addLayer(polyline.layer);
|
11816 |
-
|
11817 |
-
Parent.prototype.addPolyline.call(this, polyline);
|
11818 |
-
}
|
11819 |
-
|
11820 |
-
WPGMZA.OLMap.prototype.removePolyline = function(polyline)
|
11821 |
-
{
|
11822 |
-
this.olMap.removeLayer(polyline.layer);
|
11823 |
-
|
11824 |
-
Parent.prototype.removePolyline.call(this, polyline);
|
11825 |
-
}
|
11826 |
-
|
11827 |
-
WPGMZA.OLMap.prototype.addCircle = function(circle)
|
11828 |
-
{
|
11829 |
-
this.olMap.addLayer(circle.layer);
|
11830 |
-
|
11831 |
-
Parent.prototype.addCircle.call(this, circle);
|
11832 |
-
}
|
11833 |
-
|
11834 |
-
WPGMZA.OLMap.prototype.removeCircle = function(circle)
|
11835 |
-
{
|
11836 |
-
this.olMap.removeLayer(circle.layer);
|
11837 |
-
|
11838 |
-
Parent.prototype.removeCircle.call(this, circle);
|
11839 |
-
}
|
11840 |
-
|
11841 |
-
WPGMZA.OLMap.prototype.addRectangle = function(rectangle)
|
11842 |
-
{
|
11843 |
-
this.olMap.addLayer(rectangle.layer);
|
11844 |
-
|
11845 |
-
Parent.prototype.addRectangle.call(this, rectangle);
|
11846 |
-
}
|
11847 |
-
|
11848 |
-
WPGMZA.OLMap.prototype.removeRectangle = function(rectangle)
|
11849 |
-
{
|
11850 |
-
this.olMap.removeLayer(rectangle.layer);
|
11851 |
-
|
11852 |
-
Parent.prototype.removeRectangle.call(this, rectangle);
|
11853 |
-
}
|
11854 |
-
|
11855 |
-
WPGMZA.OLMap.prototype.pixelsToLatLng = function(x, y)
|
11856 |
-
{
|
11857 |
-
if(y == undefined)
|
11858 |
-
{
|
11859 |
-
if("x" in x && "y" in x)
|
11860 |
-
{
|
11861 |
-
y = x.y;
|
11862 |
-
x = x.x;
|
11863 |
-
}
|
11864 |
-
else
|
11865 |
-
console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)");
|
11866 |
-
}
|
11867 |
-
|
11868 |
-
var coord = this.olMap.getCoordinateFromPixel([x, y]);
|
11869 |
-
|
11870 |
-
if(!coord)
|
11871 |
-
return {
|
11872 |
-
x: null,
|
11873 |
-
y: null
|
11874 |
-
};
|
11875 |
-
|
11876 |
-
var lonLat = ol.proj.toLonLat(coord);
|
11877 |
-
return {
|
11878 |
-
lat: lonLat[1],
|
11879 |
-
lng: lonLat[0]
|
11880 |
-
};
|
11881 |
-
}
|
11882 |
-
|
11883 |
-
WPGMZA.OLMap.prototype.latLngToPixels = function(latLng)
|
11884 |
-
{
|
11885 |
-
var coord = ol.proj.fromLonLat([latLng.lng, latLng.lat]);
|
11886 |
-
var pixel = this.olMap.getPixelFromCoordinate(coord);
|
11887 |
-
|
11888 |
-
if(!pixel)
|
11889 |
-
return {
|
11890 |
-
x: null,
|
11891 |
-
y: null
|
11892 |
-
};
|
11893 |
-
|
11894 |
-
return {
|
11895 |
-
x: pixel[0],
|
11896 |
-
y: pixel[1]
|
11897 |
-
};
|
11898 |
-
}
|
11899 |
-
|
11900 |
-
WPGMZA.OLMap.prototype.enableBicycleLayer = function(value)
|
11901 |
-
{
|
11902 |
-
if(value)
|
11903 |
-
{
|
11904 |
-
if(!this.bicycleLayer)
|
11905 |
-
this.bicycleLayer = new ol.layer.Tile({
|
11906 |
-
source: new ol.source.OSM({
|
11907 |
-
url: "http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png"
|
11908 |
-
})
|
11909 |
-
});
|
11910 |
-
|
11911 |
-
this.olMap.addLayer(this.bicycleLayer);
|
11912 |
-
}
|
11913 |
-
else
|
11914 |
-
{
|
11915 |
-
if(!this.bicycleLayer)
|
11916 |
-
return;
|
11917 |
-
|
11918 |
-
this.olMap.removeLayer(this.bicycleLayer);
|
11919 |
-
}
|
11920 |
-
}
|
11921 |
-
|
11922 |
-
WPGMZA.OLMap.prototype.showGestureOverlay = function()
|
11923 |
-
{
|
11924 |
-
var self = this;
|
11925 |
-
|
11926 |
-
clearTimeout(this.gestureOverlayTimeoutID);
|
11927 |
-
|
11928 |
-
$(this.gestureOverlay).stop().animate({opacity: "100"});
|
11929 |
-
$(this.element).append(this.gestureOverlay);
|
11930 |
-
|
11931 |
-
$(this.gestureOverlay).css({
|
11932 |
-
"line-height": $(this.element).height() + "px",
|
11933 |
-
"opacity": "1.0"
|
11934 |
-
});
|
11935 |
-
$(this.gestureOverlay).show();
|
11936 |
-
|
11937 |
-
this.gestureOverlayTimeoutID = setTimeout(function() {
|
11938 |
-
self.gestureOverlay.fadeOut(2000);
|
11939 |
-
}, 2000);
|
11940 |
-
}
|
11941 |
-
|
11942 |
-
WPGMZA.OLMap.prototype.onElementResized = function(event)
|
11943 |
-
{
|
11944 |
-
this.olMap.updateSize();
|
11945 |
-
}
|
11946 |
-
|
11947 |
-
WPGMZA.OLMap.prototype.onRightClick = function(event)
|
11948 |
-
{
|
11949 |
-
if($(event.target).closest(".ol-marker, .wpgmza_modern_infowindow, .wpgmza-modern-store-locator").length)
|
11950 |
-
return true;
|
11951 |
-
|
11952 |
-
var parentOffset = $(this.element).offset();
|
11953 |
-
var relX = event.pageX - parentOffset.left;
|
11954 |
-
var relY = event.pageY - parentOffset.top;
|
11955 |
-
var latLng = this.pixelsToLatLng(relX, relY);
|
11956 |
-
|
11957 |
-
this.trigger({type: "rightclick", latLng: latLng});
|
11958 |
-
|
11959 |
-
// Legacy event compatibility
|
11960 |
-
$(this.element).trigger({type: "rightclick", latLng: latLng});
|
11961 |
-
|
11962 |
-
// Prevent menu
|
11963 |
-
event.preventDefault();
|
11964 |
-
return false;
|
11965 |
-
}
|
11966 |
-
|
11967 |
-
WPGMZA.OLMap.prototype.enableAllInteractions = function()
|
11968 |
-
{
|
11969 |
-
|
11970 |
-
this.olMap.getInteractions().forEach(function(interaction) {
|
11971 |
-
|
11972 |
-
if(interaction instanceof ol.interaction.DragPan || interaction instanceof ol.interaction.DoubleClickZoom || interaction instanceof ol.interaction.MouseWheelZoom)
|
11973 |
-
{
|
11974 |
-
interaction.setActive(true);
|
11975 |
-
}
|
11976 |
-
|
11977 |
-
}, this);
|
11978 |
-
|
11979 |
-
}
|
11980 |
-
|
11981 |
-
});
|
11982 |
-
|
11983 |
-
// js/v8/open-layers/ol-marker.js
|
11984 |
-
/**
|
11985 |
-
* @namespace WPGMZA
|
11986 |
-
* @module OLMarker
|
11987 |
-
* @requires WPGMZA.Marker
|
11988 |
-
* @pro-requires WPGMZA.ProMarker
|
11989 |
-
*/
|
11990 |
-
jQuery(function($) {
|
11991 |
-
|
11992 |
-
var Parent;
|
11993 |
-
|
11994 |
-
WPGMZA.OLMarker = function(options)
|
11995 |
-
{
|
11996 |
-
var self = this;
|
11997 |
-
|
11998 |
-
Parent.call(this, options);
|
11999 |
-
|
12000 |
-
var settings = {};
|
12001 |
-
if(options)
|
12002 |
-
{
|
12003 |
-
for(var name in options)
|
12004 |
-
{
|
12005 |
-
if(options[name] instanceof WPGMZA.LatLng)
|
12006 |
-
{
|
12007 |
-
settings[name] = options[name].toLatLngLiteral();
|
12008 |
-
}
|
12009 |
-
else if(options[name] instanceof WPGMZA.Map)
|
12010 |
-
{
|
12011 |
-
// Do nothing (ignore)
|
12012 |
-
}
|
12013 |
-
else
|
12014 |
-
settings[name] = options[name];
|
12015 |
-
}
|
12016 |
-
}
|
12017 |
-
|
12018 |
-
var origin = ol.proj.fromLonLat([
|
12019 |
-
parseFloat(this.lng),
|
12020 |
-
parseFloat(this.lat)
|
12021 |
-
]);
|
12022 |
-
|
12023 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT)
|
12024 |
-
{
|
12025 |
-
var img = $("<img alt=''/>")[0];
|
12026 |
-
img.onload = function(event) {
|
12027 |
-
self.updateElementHeight();
|
12028 |
-
if(self.map)
|
12029 |
-
self.map.olMap.updateSize();
|
12030 |
-
}
|
12031 |
-
img.src = WPGMZA.defaultMarkerIcon;
|
12032 |
-
|
12033 |
-
this.element = $("<div class='ol-marker'></div>")[0];
|
12034 |
-
this.element.appendChild(img);
|
12035 |
-
|
12036 |
-
this.element.wpgmzaMarker = this;
|
12037 |
-
|
12038 |
-
$(this.element).on("mouseover", function(event) {
|
12039 |
-
self.dispatchEvent("mouseover");
|
12040 |
-
});
|
12041 |
-
|
12042 |
-
this.overlay = new ol.Overlay({
|
12043 |
-
element: this.element,
|
12044 |
-
position: origin,
|
12045 |
-
positioning: "bottom-center",
|
12046 |
-
stopEvent: false
|
12047 |
-
});
|
12048 |
-
this.overlay.setPosition(origin);
|
12049 |
-
|
12050 |
-
if(this.animation)
|
12051 |
-
this.setAnimation(this.animation);
|
12052 |
-
else if(this.anim) // NB: Code to support old name
|
12053 |
-
this.setAnimation(this.anim);
|
12054 |
-
|
12055 |
-
if(options)
|
12056 |
-
{
|
12057 |
-
if(options.draggable)
|
12058 |
-
this.setDraggable(true);
|
12059 |
-
}
|
12060 |
-
|
12061 |
-
this.rebindClickListener();
|
12062 |
-
}
|
12063 |
-
else if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
12064 |
-
{
|
12065 |
-
this.feature = new ol.Feature({
|
12066 |
-
geometry: new ol.geom.Point(origin)
|
12067 |
-
});
|
12068 |
-
|
12069 |
-
this.feature.setStyle(this.getVectorLayerStyle());
|
12070 |
-
this.feature.wpgmzaMarker = this;
|
12071 |
-
this.feature.wpgmzaFeature = this;
|
12072 |
-
}
|
12073 |
-
else
|
12074 |
-
throw new Error("Invalid marker render mode");
|
12075 |
-
|
12076 |
-
this.setOptions(settings);
|
12077 |
-
this.trigger("init");
|
12078 |
-
}
|
12079 |
-
|
12080 |
-
// NB: Does not presently inherit OLFeature, which it probably should
|
12081 |
-
|
12082 |
-
if(WPGMZA.isProVersion())
|
12083 |
-
Parent = WPGMZA.ProMarker;
|
12084 |
-
else
|
12085 |
-
Parent = WPGMZA.Marker;
|
12086 |
-
|
12087 |
-
WPGMZA.OLMarker.prototype = Object.create(Parent.prototype);
|
12088 |
-
WPGMZA.OLMarker.prototype.constructor = WPGMZA.OLMarker;
|
12089 |
-
|
12090 |
-
WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT = "element";
|
12091 |
-
WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER = "vector"; // NB: This feature is experimental
|
12092 |
-
|
12093 |
-
WPGMZA.OLMarker.renderMode = WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT;
|
12094 |
-
|
12095 |
-
if(WPGMZA.settings.engine == "open-layers" && WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
12096 |
-
{
|
12097 |
-
WPGMZA.OLMarker.defaultVectorLayerStyle = new ol.style.Style({
|
12098 |
-
image: new ol.style.Icon({
|
12099 |
-
anchor: [0.5, 1],
|
12100 |
-
src: WPGMZA.defaultMarkerIcon
|
12101 |
-
})
|
12102 |
-
});
|
12103 |
-
|
12104 |
-
WPGMZA.OLMarker.hiddenVectorLayerStyle = new ol.style.Style({});
|
12105 |
-
}
|
12106 |
-
|
12107 |
-
WPGMZA.OLMarker.prototype.getVectorLayerStyle = function()
|
12108 |
-
{
|
12109 |
-
if(this.vectorLayerStyle)
|
12110 |
-
return this.vectorLayerStyle;
|
12111 |
-
|
12112 |
-
return WPGMZA.OLMarker.defaultVectorLayerStyle;
|
12113 |
-
}
|
12114 |
-
|
12115 |
-
WPGMZA.OLMarker.prototype.updateElementHeight = function(height, calledOnFocus)
|
12116 |
-
{
|
12117 |
-
var self = this;
|
12118 |
-
|
12119 |
-
if(!height)
|
12120 |
-
height = $(this.element).find("img").height();
|
12121 |
-
|
12122 |
-
if(height == 0 && !calledOnFocus)
|
12123 |
-
{
|
12124 |
-
$(window).one("focus", function(event) {
|
12125 |
-
self.updateElementHeight(false, true);
|
12126 |
-
});
|
12127 |
-
}
|
12128 |
-
|
12129 |
-
$(this.element).css({height: height + "px"});
|
12130 |
-
}
|
12131 |
-
|
12132 |
-
WPGMZA.OLMarker.prototype.addLabel = function()
|
12133 |
-
{
|
12134 |
-
this.setLabel(this.getLabelText());
|
12135 |
-
}
|
12136 |
-
|
12137 |
-
WPGMZA.OLMarker.prototype.setLabel = function(label)
|
12138 |
-
{
|
12139 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
12140 |
-
{
|
12141 |
-
console.warn("Marker labels are not currently supported in Vector Layer rendering mode");
|
12142 |
-
return;
|
12143 |
-
}
|
12144 |
-
|
12145 |
-
if(!label)
|
12146 |
-
{
|
12147 |
-
if(this.label)
|
12148 |
-
$(this.element).find(".ol-marker-label").remove();
|
12149 |
-
|
12150 |
-
return;
|
12151 |
-
}
|
12152 |
-
|
12153 |
-
if(!this.label)
|
12154 |
-
{
|
12155 |
-
this.label = $("<div class='ol-marker-label'/>");
|
12156 |
-
$(this.element).append(this.label);
|
12157 |
-
}
|
12158 |
-
|
12159 |
-
this.label.html(label);
|
12160 |
-
}
|
12161 |
-
|
12162 |
-
WPGMZA.OLMarker.prototype.getVisible = function(visible)
|
12163 |
-
{
|
12164 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
12165 |
-
{
|
12166 |
-
|
12167 |
-
}
|
12168 |
-
else
|
12169 |
-
return this.overlay.getElement().style.display != "none";
|
12170 |
-
}
|
12171 |
-
|
12172 |
-
WPGMZA.OLMarker.prototype.setVisible = function(visible)
|
12173 |
-
{
|
12174 |
-
Parent.prototype.setVisible.call(this, visible);
|
12175 |
-
|
12176 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
12177 |
-
{
|
12178 |
-
if(visible)
|
12179 |
-
{
|
12180 |
-
var style = this.getVectorLayerStyle();
|
12181 |
-
this.feature.setStyle(style);
|
12182 |
-
}
|
12183 |
-
else
|
12184 |
-
this.feature.setStyle(null);
|
12185 |
-
|
12186 |
-
/*var source = this.map.markerLayer.getSource();
|
12187 |
-
|
12188 |
-
/*if(this.featureInSource == visible)
|
12189 |
-
return;
|
12190 |
-
|
12191 |
-
if(visible)
|
12192 |
-
source.addFeature(this.feature);
|
12193 |
-
else
|
12194 |
-
source.removeFeature(this.feature);
|
12195 |
-
|
12196 |
-
this.featureInSource = visible;*/
|
12197 |
-
}
|
12198 |
-
else
|
12199 |
-
this.overlay.getElement().style.display = (visible ? "block" : "none");
|
12200 |
-
}
|
12201 |
-
|
12202 |
-
WPGMZA.OLMarker.prototype.setPosition = function(latLng)
|
12203 |
-
{
|
12204 |
-
Parent.prototype.setPosition.call(this, latLng);
|
12205 |
-
|
12206 |
-
var origin = ol.proj.fromLonLat([
|
12207 |
-
parseFloat(this.lng),
|
12208 |
-
parseFloat(this.lat)
|
12209 |
-
]);
|
12210 |
-
|
12211 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
12212 |
-
this.feature.setGeometry(new ol.geom.Point(origin));
|
12213 |
-
else
|
12214 |
-
this.overlay.setPosition(origin);
|
12215 |
-
}
|
12216 |
-
|
12217 |
-
WPGMZA.OLMarker.prototype.updateOffset = function(x, y)
|
12218 |
-
{
|
12219 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
12220 |
-
{
|
12221 |
-
console.warn("Marker offset is not currently supported in Vector Layer rendering mode");
|
12222 |
-
return;
|
12223 |
-
}
|
12224 |
-
|
12225 |
-
var x = this._offset.x;
|
12226 |
-
var y = this._offset.y;
|
12227 |
-
|
12228 |
-
this.element.style.position = "relative";
|
12229 |
-
this.element.style.left = x + "px";
|
12230 |
-
this.element.style.top = y + "px";
|
12231 |
-
}
|
12232 |
-
|
12233 |
-
WPGMZA.OLMarker.prototype.setAnimation = function(anim)
|
12234 |
-
{
|
12235 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
12236 |
-
{
|
12237 |
-
console.warn("Marker animation is not currently supported in Vector Layer rendering mode");
|
12238 |
-
return;
|
12239 |
-
}
|
12240 |
-
|
12241 |
-
Parent.prototype.setAnimation.call(this, anim);
|
12242 |
-
|
12243 |
-
switch(anim)
|
12244 |
-
{
|
12245 |
-
case WPGMZA.Marker.ANIMATION_NONE:
|
12246 |
-
$(this.element).removeAttr("data-anim");
|
12247 |
-
break;
|
12248 |
-
|
12249 |
-
case WPGMZA.Marker.ANIMATION_BOUNCE:
|
12250 |
-
$(this.element).attr("data-anim", "bounce");
|
12251 |
-
break;
|
12252 |
-
|
12253 |
-
case WPGMZA.Marker.ANIMATION_DROP:
|
12254 |
-
$(this.element).attr("data-anim", "drop");
|
12255 |
-
break;
|
12256 |
-
}
|
12257 |
-
}
|
12258 |
-
|
12259 |
-
WPGMZA.OLMarker.prototype.setDraggable = function(draggable)
|
12260 |
-
{
|
12261 |
-
var self = this;
|
12262 |
-
|
12263 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
12264 |
-
{
|
12265 |
-
console.warn("Marker dragging is not currently supported in Vector Layer rendering mode");
|
12266 |
-
return;
|
12267 |
-
}
|
12268 |
-
|
12269 |
-
if(draggable)
|
12270 |
-
{
|
12271 |
-
var options = {
|
12272 |
-
disabled: false
|
12273 |
-
};
|
12274 |
-
|
12275 |
-
if(!this.jQueryDraggableInitialized)
|
12276 |
-
{
|
12277 |
-
options.start = function(event) {
|
12278 |
-
self.onDragStart(event);
|
12279 |
-
}
|
12280 |
-
|
12281 |
-
options.stop = function(event) {
|
12282 |
-
self.onDragEnd(event);
|
12283 |
-
};
|
12284 |
-
}
|
12285 |
-
|
12286 |
-
$(this.element).draggable(options);
|
12287 |
-
this.jQueryDraggableInitialized = true;
|
12288 |
-
|
12289 |
-
this.rebindClickListener();
|
12290 |
-
}
|
12291 |
-
else
|
12292 |
-
$(this.element).draggable({disabled: true});
|
12293 |
-
}
|
12294 |
-
|
12295 |
-
WPGMZA.OLMarker.prototype.setOpacity = function(opacity)
|
12296 |
-
{
|
12297 |
-
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
12298 |
-
{
|
12299 |
-
console.warn("Marker opacity is not currently supported in Vector Layer rendering mode");
|
12300 |
-
return;
|
12301 |
-
}
|
12302 |
-
|
12303 |
-
$(this.element).css({opacity: opacity});
|
12304 |
-
}
|
12305 |
-
|
12306 |
-
WPGMZA.OLMarker.prototype.onDragStart = function(event)
|
12307 |
-
{
|
12308 |
-
this.isBeingDragged = true;
|
12309 |
-
|
12310 |
-
this.map.olMap.getInteractions().forEach(function(interaction) {
|
12311 |
-
|
12312 |
-
if(interaction instanceof ol.interaction.DragPan)
|
12313 |
-
interaction.setActive(false);
|
12314 |
-
|
12315 |
-
});
|
12316 |
-
}
|
12317 |
-
|
12318 |
-
WPGMZA.OLMarker.prototype.onDragEnd = function(event)
|
12319 |
-
{
|
12320 |
-
var self = this;
|
12321 |
-
var offset = {
|
12322 |
-
top: parseFloat( $(this.element).css("top").match(/-?\d+/)[0] ),
|
12323 |
-
left: parseFloat( $(this.element).css("left").match(/-?\d+/)[0] )
|
12324 |
-
};
|
12325 |
-
|
12326 |
-
$(this.element).css({
|
12327 |
-
top: "0px",
|
12328 |
-
left: "0px"
|
12329 |
-
});
|
12330 |
-
|
12331 |
-
var currentLatLng = this.getPosition();
|
12332 |
-
var pixelsBeforeDrag = this.map.latLngToPixels(currentLatLng);
|
12333 |
-
var pixelsAfterDrag = {
|
12334 |
-
x: pixelsBeforeDrag.x + offset.left,
|
12335 |
-
y: pixelsBeforeDrag.y + offset.top
|
12336 |
-
};
|
12337 |
-
var latLngAfterDrag = this.map.pixelsToLatLng(pixelsAfterDrag);
|
12338 |
-
|
12339 |
-
this.setPosition(latLngAfterDrag);
|
12340 |
-
|
12341 |
-
this.isBeingDragged = false;
|
12342 |
-
this.trigger({type: "dragend", latLng: latLngAfterDrag});
|
12343 |
-
|
12344 |
-
this.trigger("change");
|
12345 |
-
|
12346 |
-
// NB: "yes" represents disabled
|
12347 |
-
if(this.map.settings.wpgmza_settings_map_draggable != "yes")
|
12348 |
-
this.map.olMap.getInteractions().forEach(function(interaction) {
|
12349 |
-
|
12350 |
-
if(interaction instanceof ol.interaction.DragPan)
|
12351 |
-
interaction.setActive(true);
|
12352 |
-
|
12353 |
-
});
|
12354 |
-
}
|
12355 |
-
|
12356 |
-
WPGMZA.OLMarker.prototype.onElementClick = function(event)
|
12357 |
-
{
|
12358 |
-
var self = event.currentTarget.wpgmzaMarker;
|
12359 |
-
|
12360 |
-
if(self.isBeingDragged)
|
12361 |
-
return; // Don't dispatch click event after a drag
|
12362 |
-
|
12363 |
-
self.dispatchEvent("click");
|
12364 |
-
self.dispatchEvent("select");
|
12365 |
-
}
|
12366 |
-
|
12367 |
-
/**
|
12368 |
-
* Binds / rebinds the click listener. This must be bound after draggable is initialized,
|
12369 |
-
* this solves the click listener firing before dragend
|
12370 |
-
*/
|
12371 |
-
WPGMZA.OLMarker.prototype.rebindClickListener = function()
|
12372 |
-
{
|
12373 |
-
$(this.element).off("click", this.onElementClick);
|
12374 |
-
$(this.element).on("click", this.onElementClick);
|
12375 |
-
}
|
12376 |
-
|
12377 |
-
});
|
12378 |
-
|
12379 |
-
// js/v8/open-layers/ol-modern-store-locator-circle.js
|
12380 |
-
/**
|
12381 |
-
* @namespace WPGMZA
|
12382 |
-
* @module OLModernStoreLocatorCircle
|
12383 |
-
* @requires WPGMZA.ModernStoreLocatorCircle
|
12384 |
-
*/
|
12385 |
-
jQuery(function($) {
|
12386 |
-
|
12387 |
-
WPGMZA.OLModernStoreLocatorCircle = function(map, settings)
|
12388 |
-
{
|
12389 |
-
WPGMZA.ModernStoreLocatorCircle.call(this, map, settings);
|
12390 |
-
}
|
12391 |
-
|
12392 |
-
WPGMZA.OLModernStoreLocatorCircle.prototype = Object.create(WPGMZA.ModernStoreLocatorCircle.prototype);
|
12393 |
-
WPGMZA.OLModernStoreLocatorCircle.prototype.constructor = WPGMZA.OLModernStoreLocatorCircle;
|
12394 |
-
|
12395 |
-
WPGMZA.OLModernStoreLocatorCircle.prototype.initCanvasLayer = function()
|
12396 |
-
{
|
12397 |
-
var self = this;
|
12398 |
-
var mapElement = $(this.map.element);
|
12399 |
-
var olViewportElement = mapElement.children(".ol-viewport");
|
12400 |
-
|
12401 |
-
this.canvas = document.createElement("canvas");
|
12402 |
-
this.canvas.className = "wpgmza-ol-canvas-overlay";
|
12403 |
-
olViewportElement.find('.ol-layers .ol-layer:first-child').prepend(this.canvas);
|
12404 |
-
|
12405 |
-
this.renderFunction = function(event) {
|
12406 |
-
|
12407 |
-
if(self.canvas.width != olViewportElement.width() || self.canvas.height != olViewportElement.height())
|
12408 |
-
{
|
12409 |
-
self.canvas.width = olViewportElement.width();
|
12410 |
-
self.canvas.height = olViewportElement.height();
|
12411 |
-
|
12412 |
-
$(this.canvas).css({
|
12413 |
-
width: olViewportElement.width() + "px",
|
12414 |
-
height: olViewportElement.height() + "px"
|
12415 |
-
});
|
12416 |
-
}
|
12417 |
-
|
12418 |
-
self.draw();
|
12419 |
-
};
|
12420 |
-
|
12421 |
-
this.map.olMap.on("postrender", this.renderFunction);
|
12422 |
-
}
|
12423 |
-
|
12424 |
-
WPGMZA.OLModernStoreLocatorCircle.prototype.getContext = function(type)
|
12425 |
-
{
|
12426 |
-
return this.canvas.getContext(type);
|
12427 |
-
}
|
12428 |
-
|
12429 |
-
WPGMZA.OLModernStoreLocatorCircle.prototype.getCanvasDimensions = function()
|
12430 |
-
{
|
12431 |
-
return {
|
12432 |
-
width: this.canvas.width,
|
12433 |
-
height: this.canvas.height
|
12434 |
-
};
|
12435 |
-
}
|
12436 |
-
|
12437 |
-
WPGMZA.OLModernStoreLocatorCircle.prototype.getCenterPixels = function()
|
12438 |
-
{
|
12439 |
-
var center = this.map.latLngToPixels(this.settings.center);
|
12440 |
-
|
12441 |
-
return center;
|
12442 |
-
}
|
12443 |
-
|
12444 |
-
WPGMZA.OLModernStoreLocatorCircle.prototype.getWorldOriginOffset = function()
|
12445 |
-
{
|
12446 |
-
return {
|
12447 |
-
x: 0,
|
12448 |
-
y: 0
|
12449 |
-
};
|
12450 |
-
}
|
12451 |
-
|
12452 |
-
WPGMZA.OLModernStoreLocatorCircle.prototype.getTransformedRadius = function(km)
|
12453 |
-
{
|
12454 |
-
var center = new WPGMZA.LatLng(this.settings.center);
|
12455 |
-
var outer = new WPGMZA.LatLng(center);
|
12456 |
-
|
12457 |
-
outer.moveByDistance(km, 90);
|
12458 |
-
|
12459 |
-
var centerPixels = this.map.latLngToPixels(center);
|
12460 |
-
var outerPixels = this.map.latLngToPixels(outer);
|
12461 |
-
|
12462 |
-
return Math.abs(outerPixels.x - centerPixels.x);
|
12463 |
-
|
12464 |
-
/*if(!window.testMarker){
|
12465 |
-
window.testMarker = WPGMZA.Marker.createInstance({
|
12466 |
-
position: outer
|
12467 |
-
});
|
12468 |
-
WPGMZA.maps[0].addMarker(window.testMarker);
|
12469 |
-
}
|
12470 |
-
|
12471 |
-
return 100;*/
|
12472 |
-
}
|
12473 |
-
|
12474 |
-
WPGMZA.OLModernStoreLocatorCircle.prototype.getScale = function()
|
12475 |
-
{
|
12476 |
-
return 1;
|
12477 |
-
}
|
12478 |
-
|
12479 |
-
WPGMZA.OLModernStoreLocatorCircle.prototype.destroy = function()
|
12480 |
-
{
|
12481 |
-
$(this.canvas).remove();
|
12482 |
-
|
12483 |
-
this.map.olMap.un("postrender", this.renderFunction);
|
12484 |
-
this.map = null;
|
12485 |
-
this.canvas = null;
|
12486 |
-
}
|
12487 |
-
|
12488 |
-
});
|
12489 |
-
|
12490 |
-
// js/v8/open-layers/ol-modern-store-locator.js
|
12491 |
-
/**
|
12492 |
-
* @namespace WPGMZA
|
12493 |
-
* @module OLModernStoreLocator
|
12494 |
-
* @requires WPGMZA.ModernStoreLocator
|
12495 |
-
*/
|
12496 |
-
jQuery(function($) {
|
12497 |
-
|
12498 |
-
WPGMZA.OLModernStoreLocator = function(map_id)
|
12499 |
-
{
|
12500 |
-
var element;
|
12501 |
-
|
12502 |
-
WPGMZA.ModernStoreLocator.call(this, map_id);
|
12503 |
-
|
12504 |
-
if(WPGMZA.isProVersion())
|
12505 |
-
element = $(".wpgmza_map[data-map-id='" + map_id + "']");
|
12506 |
-
else
|
12507 |
-
element = $("#wpgmza_map");
|
12508 |
-
|
12509 |
-
element.append(this.element);
|
12510 |
-
}
|
12511 |
-
|
12512 |
-
WPGMZA.OLModernStoreLocator.prototype = Object.create(WPGMZA.ModernStoreLocator);
|
12513 |
-
WPGMZA.OLModernStoreLocator.prototype.constructor = WPGMZA.OLModernStoreLocator;
|
12514 |
-
|
12515 |
-
});
|
12516 |
-
|
12517 |
-
// js/v8/open-layers/ol-polygon.js
|
12518 |
-
/**
|
12519 |
-
* @namespace WPGMZA
|
12520 |
-
* @module OLPolygon
|
12521 |
-
* @requires WPGMZA.Polygon
|
12522 |
-
* @pro-requires WPGMZA.ProPolygon
|
12523 |
-
*/
|
12524 |
-
jQuery(function($) {
|
12525 |
-
|
12526 |
-
var Parent;
|
12527 |
-
|
12528 |
-
WPGMZA.OLPolygon = function(options, olFeature)
|
12529 |
-
{
|
12530 |
-
var self = this;
|
12531 |
-
|
12532 |
-
Parent.call(this, options, olFeature);
|
12533 |
-
|
12534 |
-
if(olFeature)
|
12535 |
-
{
|
12536 |
-
this.olFeature = olFeature;
|
12537 |
-
}
|
12538 |
-
else
|
12539 |
-
{
|
12540 |
-
var coordinates = [[]];
|
12541 |
-
|
12542 |
-
if(options && options.polydata)
|
12543 |
-
{
|
12544 |
-
var paths = this.parseGeometry(options.polydata);
|
12545 |
-
|
12546 |
-
// NB: We have to close the polygon in OpenLayers for the edit interaction to pick up on the last edge
|
12547 |
-
for(var i = 0; i <= paths.length; i++)
|
12548 |
-
coordinates[0].push(ol.proj.fromLonLat([
|
12549 |
-
parseFloat(paths[i % paths.length].lng),
|
12550 |
-
parseFloat(paths[i % paths.length].lat)
|
12551 |
-
]));
|
12552 |
-
}
|
12553 |
-
|
12554 |
-
this.olFeature = new ol.Feature({
|
12555 |
-
geometry: new ol.geom.Polygon(coordinates)
|
12556 |
-
});
|
12557 |
-
}
|
12558 |
-
|
12559 |
-
this.layer = new ol.layer.Vector({
|
12560 |
-
source: new ol.source.Vector({
|
12561 |
-
features: [this.olFeature]
|
12562 |
-
})
|
12563 |
-
});
|
12564 |
-
|
12565 |
-
this.layer.getSource().getFeatures()[0].setProperties({
|
12566 |
-
wpgmzaPolygon: this,
|
12567 |
-
wpgmzaFeature: this
|
12568 |
-
});
|
12569 |
-
|
12570 |
-
if(options)
|
12571 |
-
this.setOptions(options);
|
12572 |
-
}
|
12573 |
-
|
12574 |
-
if(WPGMZA.isProVersion())
|
12575 |
-
Parent = WPGMZA.ProPolygon;
|
12576 |
-
else
|
12577 |
-
Parent = WPGMZA.Polygon;
|
12578 |
-
|
12579 |
-
WPGMZA.OLPolygon.prototype = Object.create(Parent.prototype);
|
12580 |
-
WPGMZA.OLPolygon.prototype.constructor = WPGMZA.OLPolygon;
|
12581 |
-
|
12582 |
-
WPGMZA.OLPolygon.prototype.getGeometry = function()
|
12583 |
-
{
|
12584 |
-
var coordinates = this.olFeature.getGeometry().getCoordinates()[0];
|
12585 |
-
var result = [];
|
12586 |
-
|
12587 |
-
for(var i = 0; i < coordinates.length; i++)
|
12588 |
-
{
|
12589 |
-
var lonLat = ol.proj.toLonLat(coordinates[i]);
|
12590 |
-
var latLng = {
|
12591 |
-
lat: lonLat[1],
|
12592 |
-
lng: lonLat[0]
|
12593 |
-
};
|
12594 |
-
result.push(latLng);
|
12595 |
-
}
|
12596 |
-
|
12597 |
-
return result;
|
12598 |
-
}
|
12599 |
-
|
12600 |
-
WPGMZA.OLPolygon.prototype.setOptions = function(options)
|
12601 |
-
{
|
12602 |
-
Parent.prototype.setOptions.apply(this, arguments);
|
12603 |
-
|
12604 |
-
if("editable" in options)
|
12605 |
-
WPGMZA.OLFeature.setInteractionsOnFeature(this, options.editable);
|
12606 |
-
}
|
12607 |
-
|
12608 |
-
});
|
12609 |
-
|
12610 |
-
// js/v8/open-layers/ol-polyline.js
|
12611 |
-
/**
|
12612 |
-
* @namespace WPGMZA
|
12613 |
-
* @module OLPolyline
|
12614 |
-
* @requires WPGMZA.Polyline
|
12615 |
-
*/
|
12616 |
-
jQuery(function($) {
|
12617 |
-
|
12618 |
-
var Parent;
|
12619 |
-
|
12620 |
-
WPGMZA.OLPolyline = function(options, olFeature)
|
12621 |
-
{
|
12622 |
-
var self = this;
|
12623 |
-
|
12624 |
-
WPGMZA.Polyline.call(this, options);
|
12625 |
-
|
12626 |
-
if(olFeature)
|
12627 |
-
{
|
12628 |
-
this.olFeature = olFeature;
|
12629 |
-
}
|
12630 |
-
else
|
12631 |
-
{
|
12632 |
-
var coordinates = [];
|
12633 |
-
|
12634 |
-
if(options && options.polydata)
|
12635 |
-
{
|
12636 |
-
var path = this.parseGeometry(options.polydata);
|
12637 |
-
|
12638 |
-
for(var i = 0; i < path.length; i++)
|
12639 |
-
{
|
12640 |
-
if(!($.isNumeric(path[i].lat)))
|
12641 |
-
throw new Error("Invalid latitude");
|
12642 |
-
|
12643 |
-
if(!($.isNumeric(path[i].lng)))
|
12644 |
-
throw new Error("Invalid longitude");
|
12645 |
-
|
12646 |
-
coordinates.push(ol.proj.fromLonLat([
|
12647 |
-
parseFloat(path[i].lng),
|
12648 |
-
parseFloat(path[i].lat)
|
12649 |
-
]));
|
12650 |
-
}
|
12651 |
-
}
|
12652 |
-
|
12653 |
-
this.olFeature = new ol.Feature({
|
12654 |
-
geometry: new ol.geom.LineString(coordinates)
|
12655 |
-
});
|
12656 |
-
}
|
12657 |
-
|
12658 |
-
this.layer = new ol.layer.Vector({
|
12659 |
-
source: new ol.source.Vector({
|
12660 |
-
features: [this.olFeature]
|
12661 |
-
})
|
12662 |
-
});
|
12663 |
-
|
12664 |
-
this.layer.getSource().getFeatures()[0].setProperties({
|
12665 |
-
wpgmzaPolyline: this,
|
12666 |
-
wpgmzaFeature: this
|
12667 |
-
});
|
12668 |
-
|
12669 |
-
if(options)
|
12670 |
-
this.setOptions(options);
|
12671 |
-
}
|
12672 |
-
|
12673 |
-
Parent = WPGMZA.Polyline;
|
12674 |
-
|
12675 |
-
WPGMZA.OLPolyline.prototype = Object.create(Parent.prototype);
|
12676 |
-
WPGMZA.OLPolyline.prototype.constructor = WPGMZA.OLPolyline;
|
12677 |
-
|
12678 |
-
WPGMZA.OLPolyline.prototype.getGeometry = function()
|
12679 |
-
{
|
12680 |
-
var result = [];
|
12681 |
-
var coordinates = this.olFeature.getGeometry().getCoordinates();
|
12682 |
-
|
12683 |
-
for(var i = 0; i < coordinates.length; i++)
|
12684 |
-
{
|
12685 |
-
var lonLat = ol.proj.toLonLat(coordinates[i]);
|
12686 |
-
var latLng = {
|
12687 |
-
lat: lonLat[1],
|
12688 |
-
lng: lonLat[0]
|
12689 |
-
};
|
12690 |
-
result.push(latLng);
|
12691 |
-
}
|
12692 |
-
|
12693 |
-
return result;
|
12694 |
-
}
|
12695 |
-
|
12696 |
-
WPGMZA.OLPolyline.prototype.setOptions = function(options)
|
12697 |
-
{
|
12698 |
-
Parent.prototype.setOptions.apply(this, arguments);
|
12699 |
-
|
12700 |
-
if("editable" in options)
|
12701 |
-
WPGMZA.OLFeature.setInteractionsOnFeature(this, options.editable);
|
12702 |
-
}
|
12703 |
-
|
12704 |
-
});
|
12705 |
-
|
12706 |
-
// js/v8/open-layers/ol-rectangle.js
|
12707 |
-
/**
|
12708 |
-
* @namespace WPGMZA
|
12709 |
-
* @module OLRectangle
|
12710 |
-
* @requires WPGMZA.Rectangle
|
12711 |
-
*/
|
12712 |
-
jQuery(function($) {
|
12713 |
-
|
12714 |
-
var Parent = WPGMZA.Rectangle;
|
12715 |
-
|
12716 |
-
WPGMZA.OLRectangle = function(options, olFeature)
|
12717 |
-
{
|
12718 |
-
var self = this;
|
12719 |
-
|
12720 |
-
Parent.apply(this, arguments);
|
12721 |
-
|
12722 |
-
if(olFeature)
|
12723 |
-
{
|
12724 |
-
this.olFeature = olFeature;
|
12725 |
-
}
|
12726 |
-
else
|
12727 |
-
{
|
12728 |
-
var coordinates = [[]];
|
12729 |
-
|
12730 |
-
if(options.cornerA && options.cornerB)
|
12731 |
-
{
|
12732 |
-
coordinates[0].push(ol.proj.fromLonLat([
|
12733 |
-
parseFloat(options.cornerA.lng),
|
12734 |
-
parseFloat(options.cornerA.lat)
|
12735 |
-
]));
|
12736 |
-
|
12737 |
-
coordinates[0].push(ol.proj.fromLonLat([
|
12738 |
-
parseFloat(options.cornerB.lng),
|
12739 |
-
parseFloat(options.cornerA.lat)
|
12740 |
-
]));
|
12741 |
-
|
12742 |
-
coordinates[0].push(ol.proj.fromLonLat([
|
12743 |
-
parseFloat(options.cornerB.lng),
|
12744 |
-
parseFloat(options.cornerB.lat)
|
12745 |
-
]));
|
12746 |
-
|
12747 |
-
coordinates[0].push(ol.proj.fromLonLat([
|
12748 |
-
parseFloat(options.cornerA.lng),
|
12749 |
-
parseFloat(options.cornerB.lat)
|
12750 |
-
]));
|
12751 |
-
|
12752 |
-
coordinates[0].push(ol.proj.fromLonLat([
|
12753 |
-
parseFloat(options.cornerA.lng),
|
12754 |
-
parseFloat(options.cornerA.lat)
|
12755 |
-
]));
|
12756 |
-
}
|
12757 |
-
|
12758 |
-
this.olFeature = new ol.Feature({
|
12759 |
-
geometry: new ol.geom.Polygon(coordinates)
|
12760 |
-
});
|
12761 |
-
}
|
12762 |
-
|
12763 |
-
this.layer = new ol.layer.Vector({
|
12764 |
-
source: new ol.source.Vector({
|
12765 |
-
features: [this.olFeature]
|
12766 |
-
}),
|
12767 |
-
style: this.olStyle
|
12768 |
-
});
|
12769 |
-
|
12770 |
-
this.layer.getSource().getFeatures()[0].setProperties({
|
12771 |
-
wpgmzaRectangle: this,
|
12772 |
-
wpgmzaFeature: this
|
12773 |
-
});
|
12774 |
-
|
12775 |
-
if(options)
|
12776 |
-
this.setOptions(options);
|
12777 |
-
}
|
12778 |
-
|
12779 |
-
WPGMZA.extend(WPGMZA.OLRectangle, WPGMZA.Rectangle);
|
12780 |
-
|
12781 |
-
// NB: Would be nice to move this onto OLFeature
|
12782 |
-
WPGMZA.OLRectangle.prototype.getBounds = function()
|
12783 |
-
{
|
12784 |
-
var extent = this.olFeature.getGeometry().getExtent();
|
12785 |
-
var topLeft = ol.extent.getTopLeft(extent);
|
12786 |
-
var bottomRight = ol.extent.getBottomRight(extent);
|
12787 |
-
|
12788 |
-
var topLeftLonLat = ol.proj.toLonLat(topLeft);
|
12789 |
-
var bottomRightLonLat = ol.proj.toLonLat(bottomRight);
|
12790 |
-
|
12791 |
-
var topLeftLatLng = new WPGMZA.LatLng(topLeftLonLat[1], topLeftLonLat[0]);
|
12792 |
-
var bottomRightLatLng = new WPGMZA.LatLng(bottomRightLonLat[1], bottomRightLonLat[0]);
|
12793 |
-
|
12794 |
-
return new WPGMZA.LatLngBounds(
|
12795 |
-
topLeftLatLng,
|
12796 |
-
bottomRightLatLng
|
12797 |
-
);
|
12798 |
-
}
|
12799 |
-
|
12800 |
-
WPGMZA.OLRectangle.prototype.setOptions = function(options)
|
12801 |
-
{
|
12802 |
-
Parent.prototype.setOptions.apply(this, arguments);
|
12803 |
-
|
12804 |
-
if("editable" in options)
|
12805 |
-
WPGMZA.OLFeature.setInteractionsOnFeature(this, options.editable);
|
12806 |
-
}
|
12807 |
-
|
12808 |
-
});
|
12809 |
-
|
12810 |
-
// js/v8/open-layers/ol-text.js
|
12811 |
-
/**
|
12812 |
-
* @namespace WPGMZA
|
12813 |
-
* @module OLText
|
12814 |
-
* @requires WPGMZA.Text
|
12815 |
-
*/
|
12816 |
-
jQuery(function($) {
|
12817 |
-
|
12818 |
-
WPGMZA.OLText = function()
|
12819 |
-
{
|
12820 |
-
|
12821 |
-
}
|
12822 |
-
|
12823 |
-
});
|
12824 |
-
|
12825 |
-
// js/v8/google-maps/google-circle.js
|
12826 |
-
/**
|
12827 |
-
* @namespace WPGMZA
|
12828 |
-
* @module GoogleCircle
|
12829 |
-
* @requires WPGMZA.Circle
|
12830 |
-
*/
|
12831 |
-
jQuery(function($) {
|
12832 |
-
|
12833 |
-
/**
|
12834 |
-
* Subclass, used when Google is the maps engine. <strong>Please <em>do not</em> call this constructor directly. Always use createInstance rather than instantiating this class directly.</strong> Using createInstance allows this class to be externally extensible.
|
12835 |
-
* @class WPGMZA.GoogleCircle
|
12836 |
-
* @constructor WPGMZA.GoogleCircle
|
12837 |
-
* @memberof WPGMZA
|
12838 |
-
* @augments WPGMZA.Circle
|
12839 |
-
* @see WPGMZA.Circle.createInstance
|
12840 |
-
*/
|
12841 |
-
WPGMZA.GoogleCircle = function(options, googleCircle)
|
12842 |
-
{
|
12843 |
-
var self = this;
|
12844 |
-
|
12845 |
-
WPGMZA.Circle.call(this, options, googleCircle);
|
12846 |
-
|
12847 |
-
if(googleCircle)
|
12848 |
-
{
|
12849 |
-
this.googleCircle = googleCircle;
|
12850 |
-
|
12851 |
-
if(options)
|
12852 |
-
{
|
12853 |
-
|
12854 |
-
options.center = WPGMZA.LatLng.fromGoogleLatLng( googleCircle.getCenter() );
|
12855 |
-
options.radius = googleCircle.getRadius() / 1000; // Meters to kilometers
|
12856 |
-
}
|
12857 |
-
}
|
12858 |
-
else
|
12859 |
-
{
|
12860 |
-
this.googleCircle = new google.maps.Circle();
|
12861 |
-
this.googleCircle.wpgmzaCircle = this;
|
12862 |
-
}
|
12863 |
-
|
12864 |
-
this.googleFeature = this.googleCircle;
|
12865 |
-
|
12866 |
-
if(options)
|
12867 |
-
this.setOptions(options);
|
12868 |
-
|
12869 |
-
google.maps.event.addListener(this.googleCircle, "click", function() {
|
12870 |
-
self.dispatchEvent({type: "click"});
|
12871 |
-
});
|
12872 |
-
}
|
12873 |
-
|
12874 |
-
WPGMZA.GoogleCircle.prototype = Object.create(WPGMZA.Circle.prototype);
|
12875 |
-
WPGMZA.GoogleCircle.prototype.constructor = WPGMZA.GoogleCircle;
|
12876 |
-
|
12877 |
-
WPGMZA.GoogleCircle.prototype.getCenter = function()
|
12878 |
-
{
|
12879 |
-
return WPGMZA.LatLng.fromGoogleLatLng( this.googleCircle.getCenter() );
|
12880 |
-
}
|
12881 |
-
|
12882 |
-
WPGMZA.GoogleCircle.prototype.setCenter = function(center)
|
12883 |
-
{
|
12884 |
-
WPGMZA.Circle.prototype.setCenter.apply(this, arguments);
|
12885 |
-
|
12886 |
-
this.googleCircle.setCenter(center);
|
12887 |
-
}
|
12888 |
-
|
12889 |
-
WPGMZA.GoogleCircle.prototype.getRadius = function()
|
12890 |
-
{
|
12891 |
-
return this.googleCircle.getRadius() / 1000; // Meters to kilometers
|
12892 |
-
}
|
12893 |
-
|
12894 |
-
WPGMZA.GoogleCircle.prototype.setRadius = function(radius)
|
12895 |
-
{
|
12896 |
-
WPGMZA.Circle.prototype.setRadius.apply(this, arguments);
|
12897 |
-
|
12898 |
-
this.googleCircle.setRadius(parseFloat(radius) * 1000); // Kilometers to meters
|
12899 |
-
}
|
12900 |
-
|
12901 |
-
WPGMZA.GoogleCircle.prototype.setVisible = function(visible)
|
12902 |
-
{
|
12903 |
-
this.googleCircle.setVisible(visible ? true : false);
|
12904 |
-
}
|
12905 |
-
|
12906 |
-
WPGMZA.GoogleCircle.prototype.setDraggable = function(value)
|
12907 |
-
{
|
12908 |
-
this.googleCircle.setDraggable(value ? true : false);
|
12909 |
-
}
|
12910 |
-
|
12911 |
-
WPGMZA.GoogleCircle.prototype.setEditable = function(value)
|
12912 |
-
{
|
12913 |
-
var self = this;
|
12914 |
-
|
12915 |
-
this.googleCircle.setOptions({editable: value});
|
12916 |
-
|
12917 |
-
if(value)
|
12918 |
-
{
|
12919 |
-
google.maps.event.addListener(this.googleCircle, "center_changed", function(event) {
|
12920 |
-
|
12921 |
-
self.center = WPGMZA.LatLng.fromGoogleLatLng(self.googleCircle.getCenter());
|
12922 |
-
self.trigger("change");
|
12923 |
-
|
12924 |
-
});
|
12925 |
-
|
12926 |
-
google.maps.event.addListener(this.googleCircle, "radius_changed", function(event) {
|
12927 |
-
|
12928 |
-
self.radius = self.googleCircle.getRadius() / 1000; // Meters to kilometers
|
12929 |
-
self.trigger("change");
|
12930 |
-
|
12931 |
-
});
|
12932 |
-
}
|
12933 |
-
}
|
12934 |
-
|
12935 |
-
WPGMZA.GoogleCircle.prototype.setOptions = function(options)
|
12936 |
-
{
|
12937 |
-
WPGMZA.Circle.prototype.setOptions.apply(this, arguments);
|
12938 |
-
|
12939 |
-
if(options.center)
|
12940 |
-
this.center = new WPGMZA.LatLng(options.center);
|
12941 |
-
}
|
12942 |
-
|
12943 |
-
WPGMZA.GoogleCircle.prototype.updateNativeFeature = function()
|
12944 |
-
{
|
12945 |
-
var googleOptions = this.getScalarProperties();
|
12946 |
-
var center = new WPGMZA.LatLng(this.center); // In case center is a lat lng literal, this should really happen though
|
12947 |
-
|
12948 |
-
googleOptions.radius *= 1000; // Kilometers to meters
|
12949 |
-
googleOptions.center = center.toGoogleLatLng();
|
12950 |
-
|
12951 |
-
this.googleCircle.setOptions(googleOptions);
|
12952 |
-
}
|
12953 |
-
|
12954 |
-
});
|
12955 |
-
|
12956 |
-
// js/v8/google-maps/google-drawing-manager.js
|
12957 |
-
/**
|
12958 |
-
* @namespace WPGMZA
|
12959 |
-
* @module GoogleDrawingManager
|
12960 |
-
* @requires WPGMZA.DrawingManager
|
12961 |
-
*/
|
12962 |
-
jQuery(function($) {
|
12963 |
-
|
12964 |
-
WPGMZA.GoogleDrawingManager = function(map)
|
12965 |
-
{
|
12966 |
-
var self = this;
|
12967 |
-
|
12968 |
-
WPGMZA.DrawingManager.call(this, map);
|
12969 |
-
|
12970 |
-
this.mode = null;
|
12971 |
-
|
12972 |
-
this.googleDrawingManager = new google.maps.drawing.DrawingManager({
|
12973 |
-
drawingControl: false,
|
12974 |
-
polygonOptions: {
|
12975 |
-
editable: true
|
12976 |
-
},
|
12977 |
-
polylineOptions: {
|
12978 |
-
editable: true
|
12979 |
-
},
|
12980 |
-
circleOptions: {
|
12981 |
-
editable: true
|
12982 |
-
},
|
12983 |
-
rectangleOptions: {
|
12984 |
-
editable: true
|
12985 |
-
}
|
12986 |
-
});
|
12987 |
-
|
12988 |
-
this.googleDrawingManager.setMap(map.googleMap);
|
12989 |
-
|
12990 |
-
google.maps.event.addListener(this.googleDrawingManager, "polygoncomplete", function(polygon) {
|
12991 |
-
self.onPolygonClosed(polygon);
|
12992 |
-
});
|
12993 |
-
|
12994 |
-
google.maps.event.addListener(this.googleDrawingManager, "polylinecomplete", function(polyline) {
|
12995 |
-
self.onPolylineComplete(polyline);
|
12996 |
-
});
|
12997 |
-
|
12998 |
-
google.maps.event.addListener(this.googleDrawingManager, "circlecomplete", function(circle) {
|
12999 |
-
self.onCircleComplete(circle);
|
13000 |
-
});
|
13001 |
-
|
13002 |
-
google.maps.event.addListener(this.googleDrawingManager, "rectanglecomplete", function(rectangle) {
|
13003 |
-
self.onRectangleComplete(rectangle);
|
13004 |
-
});
|
13005 |
-
}
|
13006 |
-
|
13007 |
-
WPGMZA.GoogleDrawingManager.prototype = Object.create(WPGMZA.DrawingManager.prototype);
|
13008 |
-
WPGMZA.GoogleDrawingManager.prototype.constructor = WPGMZA.GoogleDrawingManager;
|
13009 |
-
|
13010 |
-
WPGMZA.GoogleDrawingManager.prototype.setDrawingMode = function(mode)
|
13011 |
-
{
|
13012 |
-
var googleMode;
|
13013 |
-
|
13014 |
-
WPGMZA.DrawingManager.prototype.setDrawingMode.call(this, mode);
|
13015 |
-
|
13016 |
-
switch(mode)
|
13017 |
-
{
|
13018 |
-
case WPGMZA.DrawingManager.MODE_NONE:
|
13019 |
-
googleMode = null;
|
13020 |
-
break;
|
13021 |
-
|
13022 |
-
case WPGMZA.DrawingManager.MODE_MARKER:
|
13023 |
-
/* Set to null to allow only right click */
|
13024 |
-
/*
|
13025 |
-
googleMode = google.maps.drawing.OverlayType.MARKER;
|
13026 |
-
*/
|
13027 |
-
googleMode = null;
|
13028 |
-
break;
|
13029 |
-
|
13030 |
-
case WPGMZA.DrawingManager.MODE_POLYGON:
|
13031 |
-
googleMode = google.maps.drawing.OverlayType.POLYGON;
|
13032 |
-
break;
|
13033 |
-
|
13034 |
-
case WPGMZA.DrawingManager.MODE_POLYLINE:
|
13035 |
-
googleMode = google.maps.drawing.OverlayType.POLYLINE;
|
13036 |
-
break;
|
13037 |
-
|
13038 |
-
case WPGMZA.DrawingManager.MODE_CIRCLE:
|
13039 |
-
googleMode = google.maps.drawing.OverlayType.CIRCLE;
|
13040 |
-
break;
|
13041 |
-
|
13042 |
-
case WPGMZA.DrawingManager.MODE_RECTANGLE:
|
13043 |
-
googleMode = google.maps.drawing.OverlayType.RECTANGLE;
|
13044 |
-
break;
|
13045 |
-
|
13046 |
-
case WPGMZA.DrawingManager.MODE_HEATMAP:
|
13047 |
-
googleMode = null;
|
13048 |
-
break;
|
13049 |
-
|
13050 |
-
default:
|
13051 |
-
throw new Error("Invalid drawing mode");
|
13052 |
-
break;
|
13053 |
-
}
|
13054 |
-
|
13055 |
-
this.googleDrawingManager.setDrawingMode(googleMode);
|
13056 |
-
}
|
13057 |
-
|
13058 |
-
WPGMZA.GoogleDrawingManager.prototype.setOptions = function(options)
|
13059 |
-
{
|
13060 |
-
this.googleDrawingManager.setOptions({
|
13061 |
-
polygonOptions: options,
|
13062 |
-
polylineOptions: options
|
13063 |
-
});
|
13064 |
-
}
|
13065 |
-
|
13066 |
-
WPGMZA.GoogleDrawingManager.prototype.onVertexClicked = function(event) {
|
13067 |
-
|
13068 |
-
}
|
13069 |
-
|
13070 |
-
WPGMZA.GoogleDrawingManager.prototype.onPolygonClosed = function(googlePolygon)
|
13071 |
-
{
|
13072 |
-
var event = new WPGMZA.Event("polygonclosed");
|
13073 |
-
event.enginePolygon = googlePolygon;
|
13074 |
-
this.dispatchEvent(event);
|
13075 |
-
}
|
13076 |
-
|
13077 |
-
WPGMZA.GoogleDrawingManager.prototype.onPolylineComplete = function(googlePolyline)
|
13078 |
-
{
|
13079 |
-
var event = new WPGMZA.Event("polylinecomplete");
|
13080 |
-
event.enginePolyline = googlePolyline;
|
13081 |
-
this.dispatchEvent(event);
|
13082 |
-
}
|
13083 |
-
|
13084 |
-
WPGMZA.GoogleDrawingManager.prototype.onCircleComplete = function(googleCircle)
|
13085 |
-
{
|
13086 |
-
var event = new WPGMZA.Event("circlecomplete");
|
13087 |
-
event.engineCircle = googleCircle;
|
13088 |
-
this.dispatchEvent(event);
|
13089 |
-
}
|
13090 |
-
|
13091 |
-
WPGMZA.GoogleDrawingManager.prototype.onRectangleComplete = function(googleRectangle)
|
13092 |
-
{
|
13093 |
-
var event = new WPGMZA.Event("rectanglecomplete");
|
13094 |
-
event.engineRectangle = googleRectangle;
|
13095 |
-
this.dispatchEvent(event);
|
13096 |
-
}
|
13097 |
-
|
13098 |
-
WPGMZA.GoogleDrawingManager.prototype.onHeatmapPointAdded = function(googleMarker)
|
13099 |
-
{
|
13100 |
-
var position = WPGMZA.LatLng.fromGoogleLatLng(googleMarker.getPosition());
|
13101 |
-
googleMarker.setMap(null);
|
13102 |
-
|
13103 |
-
var marker = WPGMZA.Marker.createInstance();
|
13104 |
-
marker.setPosition(position);
|
13105 |
-
|
13106 |
-
var image = {
|
13107 |
-
url: WPGMZA.imageFolderURL + "heatmap-point.png",
|
13108 |
-
origin: new google.maps.Point(0, 0),
|
13109 |
-
anchor: new google.maps.Point(13, 13)
|
13110 |
-
};
|
13111 |
-
|
13112 |
-
marker.googleMarker.setIcon(image);
|
13113 |
-
|
13114 |
-
this.map.addMarker(marker);
|
13115 |
-
|
13116 |
-
var event = new WPGMZA.Event("heatmappointadded");
|
13117 |
-
event.position = position;
|
13118 |
-
this.trigger(event);
|
13119 |
-
}
|
13120 |
-
|
13121 |
-
});
|
13122 |
-
|
13123 |
-
// js/v8/google-maps/google-geocoder.js
|
13124 |
-
/**
|
13125 |
-
* @namespace WPGMZA
|
13126 |
-
* @module GoogleGeocoder
|
13127 |
-
* @requires WPGMZA.Geocoder
|
13128 |
-
*/
|
13129 |
-
jQuery(function($) {
|
13130 |
-
|
13131 |
-
/**
|
13132 |
-
* Subclass, used when Google is the maps engine. <strong>Please <em>do not</em> call this constructor directly. Always use createInstance rather than instantiating this class directly.</strong> Using createInstance allows this class to be externally extensible.
|
13133 |
-
* @class WPGMZA.GoogleGeocoder
|
13134 |
-
* @constructor WPGMZA.GoogleGeocoder
|
13135 |
-
* @memberof WPGMZA
|
13136 |
-
* @augments WPGMZA.Geocoder
|
13137 |
-
* @see WPGMZA.Geocoder.createInstance
|
13138 |
-
*/
|
13139 |
-
WPGMZA.GoogleGeocoder = function()
|
13140 |
-
{
|
13141 |
-
|
13142 |
-
}
|
13143 |
-
|
13144 |
-
WPGMZA.GoogleGeocoder.prototype = Object.create(WPGMZA.Geocoder.prototype);
|
13145 |
-
WPGMZA.GoogleGeocoder.prototype.constructor = WPGMZA.GoogleGeocoder;
|
13146 |
-
|
13147 |
-
WPGMZA.GoogleGeocoder.prototype.getLatLngFromAddress = function(options, callback) {
|
13148 |
-
|
13149 |
-
if(!options || !options.address) {
|
13150 |
-
|
13151 |
-
nativeStatus = WPGMZA.Geocoder.NO_ADDRESS;
|
13152 |
-
callback(null, nativeStatus);
|
13153 |
-
return;
|
13154 |
-
/*throw new Error("No address specified");*/
|
13155 |
-
|
13156 |
-
}
|
13157 |
-
|
13158 |
-
if (options.lat && options.lng) {
|
13159 |
-
var latLng = {
|
13160 |
-
lat: options.lat,
|
13161 |
-
lng: options.lng
|
13162 |
-
};
|
13163 |
-
var bounds = null;
|
13164 |
-
|
13165 |
-
var results = [
|
13166 |
-
{
|
13167 |
-
geometry: {
|
13168 |
-
location: latLng
|
13169 |
-
},
|
13170 |
-
latLng: latLng,
|
13171 |
-
lat: latLng.lat,
|
13172 |
-
lng: latLng.lng,
|
13173 |
-
bounds: bounds
|
13174 |
-
}
|
13175 |
-
];
|
13176 |
-
|
13177 |
-
callback(results, WPGMZA.Geocoder.SUCCESS);
|
13178 |
-
} else {
|
13179 |
-
|
13180 |
-
}
|
13181 |
-
|
13182 |
-
if(WPGMZA.isLatLngString(options.address))
|
13183 |
-
return WPGMZA.Geocoder.prototype.getLatLngFromAddress.call(this, options, callback);
|
13184 |
-
|
13185 |
-
if(options.country)
|
13186 |
-
options.componentRestrictions = {
|
13187 |
-
country: options.country
|
13188 |
-
};
|
13189 |
-
|
13190 |
-
var geocoder = new google.maps.Geocoder();
|
13191 |
-
|
13192 |
-
geocoder.geocode(options, function(results, status) {
|
13193 |
-
if(status == google.maps.GeocoderStatus.OK)
|
13194 |
-
{
|
13195 |
-
var location = results[0].geometry.location;
|
13196 |
-
var latLng = {
|
13197 |
-
lat: location.lat(),
|
13198 |
-
lng: location.lng()
|
13199 |
-
};
|
13200 |
-
var bounds = null;
|
13201 |
-
|
13202 |
-
if(results[0].geometry.bounds)
|
13203 |
-
bounds = WPGMZA.LatLngBounds.fromGoogleLatLngBounds(results[0].geometry.bounds);
|
13204 |
-
|
13205 |
-
var results = [
|
13206 |
-
{
|
13207 |
-
geometry: {
|
13208 |
-
location: latLng
|
13209 |
-
},
|
13210 |
-
latLng: latLng,
|
13211 |
-
lat: latLng.lat,
|
13212 |
-
lng: latLng.lng,
|
13213 |
-
bounds: bounds
|
13214 |
-
}
|
13215 |
-
];
|
13216 |
-
|
13217 |
-
|
13218 |
-
|
13219 |
-
callback(results, WPGMZA.Geocoder.SUCCESS);
|
13220 |
-
}
|
13221 |
-
else
|
13222 |
-
{
|
13223 |
-
var nativeStatus = WPGMZA.Geocoder.FAIL;
|
13224 |
-
|
13225 |
-
if(status == google.maps.GeocoderStatus.ZERO_RESULTS)
|
13226 |
-
nativeStatus = WPGMZA.Geocoder.ZERO_RESULTS;
|
13227 |
-
|
13228 |
-
callback(null, nativeStatus);
|
13229 |
-
}
|
13230 |
-
});
|
13231 |
-
}
|
13232 |
-
|
13233 |
-
WPGMZA.GoogleGeocoder.prototype.getAddressFromLatLng = function(options, callback)
|
13234 |
-
{
|
13235 |
-
if(!options || !options.latLng)
|
13236 |
-
throw new Error("No latLng specified");
|
13237 |
-
|
13238 |
-
var latLng = new WPGMZA.LatLng(options.latLng);
|
13239 |
-
var geocoder = new google.maps.Geocoder();
|
13240 |
-
|
13241 |
-
var options = $.extend(options, {
|
13242 |
-
location: {
|
13243 |
-
lat: latLng.lat,
|
13244 |
-
lng: latLng.lng
|
13245 |
-
}
|
13246 |
-
});
|
13247 |
-
delete options.latLng;
|
13248 |
-
|
13249 |
-
geocoder.geocode(options, function(results, status) {
|
13250 |
-
|
13251 |
-
if(status !== "OK")
|
13252 |
-
callback(null, WPGMZA.Geocoder.FAIL);
|
13253 |
-
|
13254 |
-
if(!results || !results.length)
|
13255 |
-
callback([], WPGMZA.Geocoder.NO_RESULTS);
|
13256 |
-
|
13257 |
-
callback([results[0].formatted_address], WPGMZA.Geocoder.SUCCESS);
|
13258 |
-
|
13259 |
-
});
|
13260 |
-
}
|
13261 |
-
|
13262 |
-
});
|
13263 |
-
|
13264 |
-
// js/v8/google-maps/google-html-overlay.js
|
13265 |
-
/**
|
13266 |
-
* @namespace WPGMZA
|
13267 |
-
* @module GoogleHTMLOverlay
|
13268 |
-
* @requires WPGMZA
|
13269 |
-
*/
|
13270 |
-
jQuery(function($) {
|
13271 |
-
|
13272 |
-
// https://developers.google.com/maps/documentation/javascript/customoverlays
|
13273 |
-
|
13274 |
-
if(WPGMZA.settings.engine && WPGMZA.settings.engine != "google-maps")
|
13275 |
-
return;
|
13276 |
-
|
13277 |
-
if(!window.google || !window.google.maps)
|
13278 |
-
return;
|
13279 |
-
|
13280 |
-
WPGMZA.GoogleHTMLOverlay = function(map)
|
13281 |
-
{
|
13282 |
-
this.element = $("<div class='wpgmza-google-html-overlay'></div>");
|
13283 |
-
|
13284 |
-
this.visible = true;
|
13285 |
-
this.position = new WPGMZA.LatLng();
|
13286 |
-
|
13287 |
-
this.setMap(map.googleMap);
|
13288 |
-
this.wpgmzaMap = map;
|
13289 |
-
}
|
13290 |
-
|
13291 |
-
WPGMZA.GoogleHTMLOverlay.prototype = new google.maps.OverlayView();
|
13292 |
-
|
13293 |
-
WPGMZA.GoogleHTMLOverlay.prototype.onAdd = function()
|
13294 |
-
{
|
13295 |
-
var panes = this.getPanes();
|
13296 |
-
panes.overlayMouseTarget.appendChild(this.element[0]);
|
13297 |
-
|
13298 |
-
/*google.maps.event.addDomListener(this.element, "click", function() {
|
13299 |
-
|
13300 |
-
});*/
|
13301 |
-
}
|
13302 |
-
|
13303 |
-
WPGMZA.GoogleHTMLOverlay.prototype.onRemove = function()
|
13304 |
-
{
|
13305 |
-
if(this.element && $(this.element).parent().length)
|
13306 |
-
{
|
13307 |
-
$(this.element).remove();
|
13308 |
-
this.element = null;
|
13309 |
-
}
|
13310 |
-
}
|
13311 |
-
|
13312 |
-
WPGMZA.GoogleHTMLOverlay.prototype.draw = function()
|
13313 |
-
{
|
13314 |
-
this.updateElementPosition();
|
13315 |
-
}
|
13316 |
-
|
13317 |
-
/*WPGMZA.GoogleHTMLOverlay.prototype.setMap = function(map)
|
13318 |
-
{
|
13319 |
-
if(!(map instanceof WPGMZA.Map))
|
13320 |
-
throw new Error("Map must be an instance of WPGMZA.Map");
|
13321 |
-
|
13322 |
-
google.maps.OverlayView.prototype.setMap.call(this, map.googleMap);
|
13323 |
-
|
13324 |
-
this.wpgmzaMap = map;
|
13325 |
-
}*/
|
13326 |
-
|
13327 |
-
/*WPGMZA.GoogleHTMLOverlay.prototype.getVisible = function()
|
13328 |
-
{
|
13329 |
-
return $(this.element).css("display") != "none";
|
13330 |
-
}
|
13331 |
-
|
13332 |
-
WPGMZA.GoogleHTMLOverlay.prototype.setVisible = function(visible)
|
13333 |
-
{
|
13334 |
-
$(this.element).css({
|
13335 |
-
"display": (visible ? "block" : "none")
|
13336 |
-
});
|
13337 |
-
}*/
|
13338 |
-
|
13339 |
-
/*WPGMZA.GoogleHTMLOverlay.prototype.getPosition = function()
|
13340 |
-
{
|
13341 |
-
return new WPGMZA.LatLng(this.position);
|
13342 |
-
}
|
13343 |
-
|
13344 |
-
WPGMZA.GoogleHTMLOverlay.prototype.setPosition = function(position)
|
13345 |
-
{
|
13346 |
-
if(!(position instanceof WPGMZA.LatLng))
|
13347 |
-
throw new Error("Argument must be an instance of WPGMZA.LatLng");
|
13348 |
-
|
13349 |
-
this.position = position;
|
13350 |
-
this.updateElementPosition();
|
13351 |
-
}*/
|
13352 |
-
|
13353 |
-
WPGMZA.GoogleHTMLOverlay.prototype.updateElementPosition = function()
|
13354 |
-
{
|
13355 |
-
//var pixels = this.wpgmzaMap.latLngToPixels(this.position);
|
13356 |
-
|
13357 |
-
var projection = this.getProjection();
|
13358 |
-
|
13359 |
-
if(!projection)
|
13360 |
-
return;
|
13361 |
-
|
13362 |
-
var pixels = projection.fromLatLngToDivPixel(this.position.toGoogleLatLng());
|
13363 |
-
|
13364 |
-
$(this.element).css({
|
13365 |
-
"left": pixels.x,
|
13366 |
-
"top": pixels.y
|
13367 |
-
});
|
13368 |
-
}
|
13369 |
-
});
|
13370 |
-
|
13371 |
-
// js/v8/google-maps/google-info-window.js
|
13372 |
-
/**
|
13373 |
-
* @namespace WPGMZA
|
13374 |
-
* @module GoogleInfoWindow
|
13375 |
-
* @requires WPGMZA.InfoWindow
|
13376 |
-
* @pro-requires WPGMZA.ProInfoWindow
|
13377 |
-
*/
|
13378 |
-
jQuery(function($) {
|
13379 |
-
|
13380 |
-
var Parent;
|
13381 |
-
|
13382 |
-
WPGMZA.GoogleInfoWindow = function(feature)
|
13383 |
-
{
|
13384 |
-
Parent.call(this, feature);
|
13385 |
-
|
13386 |
-
this.setFeature(feature);
|
13387 |
-
}
|
13388 |
-
|
13389 |
-
WPGMZA.GoogleInfoWindow.Z_INDEX = 99;
|
13390 |
-
|
13391 |
-
if(WPGMZA.isProVersion())
|
13392 |
-
Parent = WPGMZA.ProInfoWindow;
|
13393 |
-
else
|
13394 |
-
Parent = WPGMZA.InfoWindow;
|
13395 |
-
|
13396 |
-
WPGMZA.GoogleInfoWindow.prototype = Object.create(Parent.prototype);
|
13397 |
-
WPGMZA.GoogleInfoWindow.prototype.constructor = WPGMZA.GoogleInfoWindow;
|
13398 |
-
|
13399 |
-
WPGMZA.GoogleInfoWindow.prototype.setFeature = function(feature)
|
13400 |
-
{
|
13401 |
-
this.feature = feature;
|
13402 |
-
|
13403 |
-
if(feature instanceof WPGMZA.Marker)
|
13404 |
-
this.googleObject = feature.googleMarker;
|
13405 |
-
else if(feature instanceof WPGMZA.Polygon)
|
13406 |
-
this.googleObject = feature.googlePolygon;
|
13407 |
-
else if(feature instanceof WPGMZA.Polyline)
|
13408 |
-
this.googleObject = feature.googlePolyline;
|
13409 |
-
}
|
13410 |
-
|
13411 |
-
WPGMZA.GoogleInfoWindow.prototype.createGoogleInfoWindow = function()
|
13412 |
-
{
|
13413 |
-
var self = this;
|
13414 |
-
|
13415 |
-
if(this.googleInfoWindow)
|
13416 |
-
return;
|
13417 |
-
|
13418 |
-
this.googleInfoWindow = new google.maps.InfoWindow();
|
13419 |
-
|
13420 |
-
this.googleInfoWindow.setZIndex(WPGMZA.GoogleInfoWindow.Z_INDEX);
|
13421 |
-
|
13422 |
-
google.maps.event.addListener(this.googleInfoWindow, "domready", function(event) {
|
13423 |
-
self.trigger("domready");
|
13424 |
-
});
|
13425 |
-
|
13426 |
-
google.maps.event.addListener(this.googleInfoWindow, "closeclick", function(event) {
|
13427 |
-
|
13428 |
-
if(self.state == WPGMZA.InfoWindow.STATE_CLOSED)
|
13429 |
-
return;
|
13430 |
-
|
13431 |
-
self.state = WPGMZA.InfoWindow.STATE_CLOSED;
|
13432 |
-
self.feature.map.trigger("infowindowclose");
|
13433 |
-
|
13434 |
-
});
|
13435 |
-
}
|
13436 |
-
|
13437 |
-
/**
|
13438 |
-
* Opens the info window
|
13439 |
-
* @return boolean FALSE if the info window should not & will not open, TRUE if it will
|
13440 |
-
*/
|
13441 |
-
WPGMZA.GoogleInfoWindow.prototype.open = function(map, feature) {
|
13442 |
-
var self = this;
|
13443 |
-
|
13444 |
-
if(!Parent.prototype.open.call(this, map, feature))
|
13445 |
-
return false;
|
13446 |
-
|
13447 |
-
|
13448 |
-
// Set parent for events to bubble up to
|
13449 |
-
this.parent = map;
|
13450 |
-
|
13451 |
-
this.createGoogleInfoWindow();
|
13452 |
-
this.setFeature(feature);
|
13453 |
-
|
13454 |
-
this.googleInfoWindow.open(
|
13455 |
-
this.feature.map.googleMap,
|
13456 |
-
this.googleObject
|
13457 |
-
);
|
13458 |
-
|
13459 |
-
var guid = WPGMZA.guid();
|
13460 |
-
var eaBtn = !WPGMZA.isProVersion() ? this.addEditButton() : '';
|
13461 |
-
var html = "<div id='" + guid + "'>" + eaBtn + ' ' + this.content + "</div>";
|
13462 |
-
|
13463 |
-
this.googleInfoWindow.setContent(html);
|
13464 |
-
|
13465 |
-
var intervalID;
|
13466 |
-
intervalID = setInterval(function(event) {
|
13467 |
-
|
13468 |
-
div = $("#" + guid);
|
13469 |
-
|
13470 |
-
if(div.length)
|
13471 |
-
{
|
13472 |
-
clearInterval(intervalID);
|
13473 |
-
|
13474 |
-
div[0].wpgmzaFeature = self.feature;
|
13475 |
-
div.addClass("wpgmza-infowindow");
|
13476 |
-
|
13477 |
-
self.element = div[0];
|
13478 |
-
self.trigger("infowindowopen");
|
13479 |
-
}
|
13480 |
-
|
13481 |
-
}, 50);
|
13482 |
-
|
13483 |
-
return true;
|
13484 |
-
}
|
13485 |
-
|
13486 |
-
WPGMZA.GoogleInfoWindow.prototype.close = function()
|
13487 |
-
{
|
13488 |
-
if(!this.googleInfoWindow)
|
13489 |
-
return;
|
13490 |
-
|
13491 |
-
WPGMZA.InfoWindow.prototype.close.call(this);
|
13492 |
-
|
13493 |
-
this.googleInfoWindow.close();
|
13494 |
-
}
|
13495 |
-
|
13496 |
-
WPGMZA.GoogleInfoWindow.prototype.setContent = function(html)
|
13497 |
-
{
|
13498 |
-
Parent.prototype.setContent.call(this, html);
|
13499 |
-
|
13500 |
-
this.content = html;
|
13501 |
-
|
13502 |
-
this.createGoogleInfoWindow();
|
13503 |
-
|
13504 |
-
this.googleInfoWindow.setContent(html);
|
13505 |
-
}
|
13506 |
-
|
13507 |
-
WPGMZA.GoogleInfoWindow.prototype.setOptions = function(options)
|
13508 |
-
{
|
13509 |
-
Parent.prototype.setOptions.call(this, options);
|
13510 |
-
|
13511 |
-
this.createGoogleInfoWindow();
|
13512 |
-
|
13513 |
-
this.googleInfoWindow.setOptions(options);
|
13514 |
-
}
|
13515 |
-
|
13516 |
-
});
|
13517 |
-
|
13518 |
-
// js/v8/google-maps/google-map.js
|
13519 |
-
/**
|
13520 |
-
* @namespace WPGMZA
|
13521 |
-
* @module GoogleMap
|
13522 |
-
* @requires WPGMZA.Map
|
13523 |
-
* @pro-requires WPGMZA.ProMap
|
13524 |
-
*/
|
13525 |
-
jQuery(function($) {
|
13526 |
-
var Parent;
|
13527 |
-
|
13528 |
-
/**
|
13529 |
-
* Constructor
|
13530 |
-
* @param element to contain the map
|
13531 |
-
*/
|
13532 |
-
WPGMZA.GoogleMap = function(element, options)
|
13533 |
-
{
|
13534 |
-
var self = this;
|
13535 |
-
|
13536 |
-
Parent.call(this, element, options);
|
13537 |
-
|
13538 |
-
this.loadGoogleMap();
|
13539 |
-
|
13540 |
-
if(options){
|
13541 |
-
this.setOptions(options, true);
|
13542 |
-
} else {
|
13543 |
-
this.setOptions({}, true);
|
13544 |
-
}
|
13545 |
-
|
13546 |
-
google.maps.event.addListener(this.googleMap, "click", function(event) {
|
13547 |
-
var wpgmzaEvent = new WPGMZA.Event("click");
|
13548 |
-
wpgmzaEvent.latLng = {
|
13549 |
-
lat: event.latLng.lat(),
|
13550 |
-
lng: event.latLng.lng()
|
13551 |
-
};
|
13552 |
-
self.dispatchEvent(wpgmzaEvent);
|
13553 |
-
});
|
13554 |
-
|
13555 |
-
google.maps.event.addListener(this.googleMap, "rightclick", function(event) {
|
13556 |
-
var wpgmzaEvent = new WPGMZA.Event("rightclick");
|
13557 |
-
wpgmzaEvent.latLng = {
|
13558 |
-
lat: event.latLng.lat(),
|
13559 |
-
lng: event.latLng.lng()
|
13560 |
-
};
|
13561 |
-
self.dispatchEvent(wpgmzaEvent);
|
13562 |
-
});
|
13563 |
-
|
13564 |
-
google.maps.event.addListener(this.googleMap, "dragend", function(event) {
|
13565 |
-
self.dispatchEvent("dragend");
|
13566 |
-
});
|
13567 |
-
|
13568 |
-
google.maps.event.addListener(this.googleMap, "zoom_changed", function(event) {
|
13569 |
-
self.dispatchEvent("zoom_changed");
|
13570 |
-
self.dispatchEvent("zoomchanged");
|
13571 |
-
});
|
13572 |
-
|
13573 |
-
// Idle event
|
13574 |
-
google.maps.event.addListener(this.googleMap, "idle", function(event) {
|
13575 |
-
self.onIdle(event);
|
13576 |
-
});
|
13577 |
-
|
13578 |
-
// Dispatch event
|
13579 |
-
if(!WPGMZA.isProVersion())
|
13580 |
-
{
|
13581 |
-
this.trigger("init");
|
13582 |
-
|
13583 |
-
this.dispatchEvent("created");
|
13584 |
-
WPGMZA.events.dispatchEvent({type: "mapcreated", map: this});
|
13585 |
-
|
13586 |
-
// Legacy event
|
13587 |
-
$(this.element).trigger("wpgooglemaps_loaded");
|
13588 |
-
}
|
13589 |
-
}
|
13590 |
-
|
13591 |
-
// If we're running the Pro version, inherit from ProMap, otherwise, inherit from Map
|
13592 |
-
if(WPGMZA.isProVersion())
|
13593 |
-
{
|
13594 |
-
Parent = WPGMZA.ProMap;
|
13595 |
-
WPGMZA.GoogleMap.prototype = Object.create(WPGMZA.ProMap.prototype);
|
13596 |
-
}
|
13597 |
-
else
|
13598 |
-
{
|
13599 |
-
Parent = WPGMZA.Map;
|
13600 |
-
WPGMZA.GoogleMap.prototype = Object.create(WPGMZA.Map.prototype);
|
13601 |
-
}
|
13602 |
-
WPGMZA.GoogleMap.prototype.constructor = WPGMZA.GoogleMap;
|
13603 |
-
|
13604 |
-
WPGMZA.GoogleMap.parseThemeData = function(raw)
|
13605 |
-
{
|
13606 |
-
var json;
|
13607 |
-
|
13608 |
-
try{
|
13609 |
-
json = JSON.parse(raw); // Try to parse strict JSON
|
13610 |
-
}catch(e) {
|
13611 |
-
|
13612 |
-
try{
|
13613 |
-
|
13614 |
-
json = eval(raw); // Try to parse JS object
|
13615 |
-
|
13616 |
-
}catch(e) {
|
13617 |
-
|
13618 |
-
var str = raw;
|
13619 |
-
|
13620 |
-
str = str.replace(/\\'/g, '\'');
|
13621 |
-
str = str.replace(/\\"/g, '"');
|
13622 |
-
str = str.replace(/\\0/g, '\0');
|
13623 |
-
str = str.replace(/\\\\/g, '\\');
|
13624 |
-
|
13625 |
-
try{
|
13626 |
-
|
13627 |
-
json = eval(str);
|
13628 |
-
|
13629 |
-
}catch(e) {
|
13630 |
-
|
13631 |
-
console.warn("Couldn't parse theme data");
|
13632 |
-
|
13633 |
-
return [];
|
13634 |
-
|
13635 |
-
}
|
13636 |
-
|
13637 |
-
}
|
13638 |
-
|
13639 |
-
}
|
13640 |
-
|
13641 |
-
return json;
|
13642 |
-
}
|
13643 |
-
|
13644 |
-
/**
|
13645 |
-
* Creates the Google Maps map
|
13646 |
-
* @return void
|
13647 |
-
*/
|
13648 |
-
WPGMZA.GoogleMap.prototype.loadGoogleMap = function()
|
13649 |
-
{
|
13650 |
-
var self = this;
|
13651 |
-
var options = this.settings.toGoogleMapsOptions();
|
13652 |
-
|
13653 |
-
this.googleMap = new google.maps.Map(this.engineElement, options);
|
13654 |
-
|
13655 |
-
google.maps.event.addListener(this.googleMap, "bounds_changed", function() {
|
13656 |
-
self.onBoundsChanged();
|
13657 |
-
});
|
13658 |
-
|
13659 |
-
if(this.settings.bicycle == 1)
|
13660 |
-
this.enableBicycleLayer(true);
|
13661 |
-
if(this.settings.traffic == 1)
|
13662 |
-
this.enableTrafficLayer(true);
|
13663 |
-
if(this.settings.transport_layer)
|
13664 |
-
this.enablePublicTransportLayer(true);
|
13665 |
|
13666 |
this.showPointsOfInterest(this.settings.wpgmza_show_point_of_interest);
|
13667 |
|
@@ -13934,2861 +10636,6175 @@ jQuery(function($) {
|
|
13934 |
}
|
13935 |
|
13936 |
/**
|
13937 |
-
* Fit the map boundaries to visible markers
|
13938 |
-
* @return void
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13939 |
*/
|
13940 |
-
WPGMZA.GoogleMap.prototype.
|
13941 |
{
|
13942 |
-
|
13943 |
-
for(var i = 0; i < this.markers.length; i++)
|
13944 |
-
{
|
13945 |
-
if(markers[i].getVisible())
|
13946 |
-
bounds.extend(markers[i].getPosition());
|
13947 |
-
}
|
13948 |
-
this.googleMap.fitBounds(bounds);
|
13949 |
}
|
13950 |
|
13951 |
/**
|
13952 |
-
*
|
13953 |
-
* @param enable boolean, enable or not
|
13954 |
* @return void
|
13955 |
*/
|
13956 |
-
WPGMZA.GoogleMap.prototype.
|
13957 |
{
|
13958 |
-
|
13959 |
-
this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13960 |
|
13961 |
-
this.
|
13962 |
-
|
13963 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13964 |
}
|
13965 |
|
13966 |
/**
|
13967 |
-
*
|
13968 |
-
* @param enable boolean, enable or not
|
13969 |
* @return void
|
13970 |
*/
|
13971 |
-
WPGMZA.GoogleMap.prototype.
|
13972 |
{
|
13973 |
-
if(!this.
|
13974 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13975 |
|
13976 |
-
this.
|
13977 |
-
enable ? this.googleMap : null
|
13978 |
-
);
|
13979 |
}
|
13980 |
|
13981 |
-
|
13982 |
-
|
13983 |
-
|
13984 |
-
|
13985 |
-
|
13986 |
-
|
13987 |
-
|
13988 |
-
|
13989 |
-
|
13990 |
-
|
13991 |
-
|
13992 |
-
|
13993 |
-
|
13994 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13995 |
|
13996 |
-
|
13997 |
-
* Shows / hides points of interest
|
13998 |
-
* @param show boolean, enable or not
|
13999 |
-
* @return void
|
14000 |
-
*/
|
14001 |
-
WPGMZA.GoogleMap.prototype.showPointsOfInterest = function(show)
|
14002 |
{
|
14003 |
-
|
14004 |
-
var text = $("textarea[name='theme_data']").val();
|
14005 |
|
14006 |
-
if(!
|
14007 |
-
|
14008 |
|
14009 |
-
|
14010 |
|
14011 |
-
|
14012 |
-
|
14013 |
-
|
14014 |
-
|
14015 |
-
|
14016 |
-
|
14017 |
-
|
14018 |
-
}
|
14019 |
|
14020 |
-
this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14021 |
}
|
14022 |
|
14023 |
-
|
14024 |
-
|
14025 |
-
|
14026 |
-
|
14027 |
-
|
14028 |
-
|
14029 |
-
|
14030 |
-
}
|
14031 |
|
14032 |
-
|
14033 |
-
* Sets the min zoom of the map
|
14034 |
-
* @return void
|
14035 |
-
*/
|
14036 |
-
WPGMZA.GoogleMap.prototype.setMinZoom = function(value)
|
14037 |
{
|
14038 |
-
this.
|
14039 |
-
minZoom: value,
|
14040 |
-
maxZoom: this.getMaxZoom()
|
14041 |
-
});
|
14042 |
}
|
14043 |
|
14044 |
/**
|
14045 |
-
*
|
14046 |
-
* @return
|
14047 |
*/
|
14048 |
-
WPGMZA.
|
14049 |
{
|
14050 |
-
return
|
14051 |
}
|
14052 |
|
14053 |
/**
|
14054 |
-
* Sets the
|
14055 |
* @return void
|
14056 |
*/
|
14057 |
-
WPGMZA.
|
14058 |
{
|
14059 |
-
this
|
14060 |
-
|
14061 |
-
|
14062 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14063 |
}
|
14064 |
|
14065 |
-
WPGMZA.
|
14066 |
{
|
14067 |
-
|
14068 |
-
var nativeLatLng = new google.maps.LatLng({
|
14069 |
-
lat: parseFloat(latLng.lat),
|
14070 |
-
lng: parseFloat(latLng.lng)
|
14071 |
-
});
|
14072 |
-
var topRight = map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast());
|
14073 |
-
var bottomLeft = map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest());
|
14074 |
-
var scale = Math.pow(2, map.getZoom());
|
14075 |
-
var worldPoint = map.getProjection().fromLatLngToPoint(nativeLatLng);
|
14076 |
-
return {
|
14077 |
-
x: (worldPoint.x - bottomLeft.x) * scale,
|
14078 |
-
y: (worldPoint.y - topRight.y) * scale
|
14079 |
-
};
|
14080 |
}
|
14081 |
|
14082 |
-
|
|
|
|
|
|
|
|
|
14083 |
{
|
14084 |
-
|
|
|
|
|
|
|
|
|
14085 |
{
|
14086 |
-
|
14087 |
-
{
|
14088 |
-
|
14089 |
-
|
14090 |
-
}
|
14091 |
-
else
|
14092 |
-
console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)");
|
14093 |
}
|
14094 |
|
14095 |
-
|
14096 |
-
var topRight = map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast());
|
14097 |
-
var bottomLeft = map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest());
|
14098 |
-
var scale = Math.pow(2, map.getZoom());
|
14099 |
-
var worldPoint = new google.maps.Point(x / scale + bottomLeft.x, y / scale + topRight.y);
|
14100 |
-
var latLng = map.getProjection().fromPointToLatLng(worldPoint);
|
14101 |
-
return {
|
14102 |
-
lat: latLng.lat(),
|
14103 |
-
lng: latLng.lng()
|
14104 |
-
};
|
14105 |
}
|
14106 |
|
14107 |
-
|
14108 |
-
|
14109 |
-
|
14110 |
-
|
14111 |
-
|
14112 |
-
|
14113 |
-
|
14114 |
-
|
14115 |
-
|
14116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14117 |
|
14118 |
-
WPGMZA.GoogleMap.prototype.enableAllInteractions = function()
|
14119 |
-
{
|
14120 |
-
var options = {};
|
14121 |
|
14122 |
-
|
14123 |
-
|
14124 |
-
|
14125 |
-
|
14126 |
-
|
14127 |
-
|
14128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14129 |
});
|
14130 |
|
14131 |
-
// js/v8/
|
14132 |
/**
|
14133 |
* @namespace WPGMZA
|
14134 |
-
* @module
|
14135 |
-
* @requires WPGMZA.
|
14136 |
-
* @pro-requires WPGMZA.ProMarker
|
14137 |
*/
|
|
|
|
|
|
|
14138 |
jQuery(function($) {
|
14139 |
|
14140 |
-
|
|
|
14141 |
|
14142 |
-
WPGMZA.
|
14143 |
{
|
14144 |
var self = this;
|
|
|
14145 |
|
14146 |
-
|
14147 |
|
14148 |
-
|
14149 |
-
|
14150 |
-
|
14151 |
-
|
14152 |
-
|
14153 |
-
|
14154 |
-
|
14155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14156 |
}
|
14157 |
-
|
14158 |
-
|
14159 |
-
|
14160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14161 |
}
|
14162 |
-
else
|
14163 |
-
settings[name] = options[name];
|
14164 |
}
|
14165 |
-
}
|
14166 |
-
|
14167 |
-
|
14168 |
-
|
|
|
|
|
|
|
14169 |
|
14170 |
-
|
|
|
14171 |
|
14172 |
-
|
14173 |
-
|
14174 |
-
lng: parseFloat(this.lng)
|
14175 |
-
}));
|
14176 |
|
14177 |
-
|
14178 |
-
|
14179 |
-
|
14180 |
-
this.googleMarker.setAnimation(this.animation);
|
14181 |
-
|
14182 |
-
google.maps.event.addListener(this.googleMarker, "click", function() {
|
14183 |
-
self.dispatchEvent("click");
|
14184 |
-
self.dispatchEvent("select");
|
14185 |
});
|
14186 |
|
14187 |
-
|
14188 |
-
self.
|
14189 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14190 |
|
14191 |
-
|
14192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14193 |
|
14194 |
-
|
14195 |
-
|
14196 |
-
lng: googleMarkerPosition.lng()
|
14197 |
});
|
14198 |
|
14199 |
-
|
14200 |
-
|
14201 |
-
latLng: self.getPosition()
|
14202 |
});
|
14203 |
-
|
14204 |
-
self.trigger("change");
|
14205 |
-
});
|
14206 |
-
|
14207 |
-
this.setOptions(settings);
|
14208 |
-
this.trigger("init");
|
14209 |
-
}
|
14210 |
-
|
14211 |
-
if(WPGMZA.isProVersion())
|
14212 |
-
Parent = WPGMZA.ProMarker;
|
14213 |
-
else
|
14214 |
-
Parent = WPGMZA.Marker;
|
14215 |
-
WPGMZA.GoogleMarker.prototype = Object.create(Parent.prototype);
|
14216 |
-
WPGMZA.GoogleMarker.prototype.constructor = WPGMZA.GoogleMarker;
|
14217 |
-
|
14218 |
-
Object.defineProperty(WPGMZA.GoogleMarker.prototype, "opacity", {
|
14219 |
-
|
14220 |
-
"get": function() {
|
14221 |
-
return this._opacity;
|
14222 |
-
},
|
14223 |
-
|
14224 |
-
"set": function(value) {
|
14225 |
-
this._opacity = value;
|
14226 |
-
this.googleMarker.setOpacity(value);
|
14227 |
-
}
|
14228 |
-
|
14229 |
-
});
|
14230 |
-
|
14231 |
-
WPGMZA.GoogleMarker.prototype.setLabel = function(label)
|
14232 |
-
{
|
14233 |
-
if(!label)
|
14234 |
-
{
|
14235 |
-
this.googleMarker.setLabel(null);
|
14236 |
-
return;
|
14237 |
}
|
14238 |
|
14239 |
-
|
14240 |
-
|
14241 |
});
|
14242 |
|
14243 |
-
|
14244 |
-
|
14245 |
-
}
|
14246 |
-
|
14247 |
-
/**
|
14248 |
-
* Sets the position of the marker
|
14249 |
-
* @return void
|
14250 |
-
*/
|
14251 |
-
WPGMZA.GoogleMarker.prototype.setPosition = function(latLng)
|
14252 |
-
{
|
14253 |
-
Parent.prototype.setPosition.call(this, latLng);
|
14254 |
-
this.googleMarker.setPosition({
|
14255 |
-
lat: this.lat,
|
14256 |
-
lng: this.lng
|
14257 |
});
|
14258 |
-
}
|
14259 |
-
|
14260 |
-
/**
|
14261 |
-
* Sets the position offset of a marker
|
14262 |
-
* @return void
|
14263 |
-
*/
|
14264 |
-
WPGMZA.GoogleMarker.prototype.updateOffset = function()
|
14265 |
-
{
|
14266 |
-
var self = this;
|
14267 |
-
var icon = this.googleMarker.getIcon();
|
14268 |
-
var img = new Image();
|
14269 |
-
var params;
|
14270 |
-
var x = this._offset.x;
|
14271 |
-
var y = this._offset.y;
|
14272 |
-
|
14273 |
-
if(!icon)
|
14274 |
-
icon = WPGMZA.settings.default_marker_icon;
|
14275 |
|
14276 |
-
|
14277 |
-
|
14278 |
-
|
14279 |
-
};
|
14280 |
-
else
|
14281 |
-
params = icon;
|
14282 |
|
14283 |
-
|
14284 |
-
|
14285 |
-
|
14286 |
-
x: img.width / 2,
|
14287 |
-
y: img.height
|
14288 |
-
};
|
14289 |
-
|
14290 |
-
params.anchor = new google.maps.Point(defaultAnchor.x - x, defaultAnchor.y - y);
|
14291 |
-
|
14292 |
-
self.googleMarker.setIcon(params);
|
14293 |
-
}
|
14294 |
|
14295 |
-
|
14296 |
-
|
14297 |
-
|
14298 |
-
|
14299 |
-
|
14300 |
-
|
|
|
|
|
14301 |
}
|
14302 |
|
14303 |
-
|
14304 |
-
* Set the marker animation
|
14305 |
-
* @return void
|
14306 |
-
*/
|
14307 |
-
WPGMZA.GoogleMarker.prototype.setAnimation = function(animation)
|
14308 |
-
{
|
14309 |
-
Parent.prototype.setAnimation.call(this, animation);
|
14310 |
-
this.googleMarker.setAnimation(animation);
|
14311 |
-
}
|
14312 |
|
14313 |
-
|
14314 |
-
* Sets the visibility of the marker
|
14315 |
-
* @return void
|
14316 |
-
*/
|
14317 |
-
WPGMZA.GoogleMarker.prototype.setVisible = function(visible)
|
14318 |
{
|
14319 |
-
|
|
|
14320 |
|
14321 |
-
|
14322 |
}
|
14323 |
|
14324 |
-
WPGMZA.
|
14325 |
{
|
14326 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14327 |
}
|
14328 |
|
14329 |
-
WPGMZA.
|
14330 |
{
|
14331 |
-
this
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14332 |
}
|
14333 |
|
14334 |
-
WPGMZA.
|
14335 |
{
|
14336 |
-
this
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14337 |
}
|
14338 |
|
14339 |
-
|
14340 |
-
|
14341 |
-
// js/v8/google-maps/google-modern-store-locator-circle.js
|
14342 |
-
/**
|
14343 |
-
* @namespace WPGMZA
|
14344 |
-
* @module GoogleModernStoreLocatorCircle
|
14345 |
-
* @requires WPGMZA.ModernStoreLocatorCircle
|
14346 |
-
*/
|
14347 |
-
jQuery(function($) {
|
14348 |
-
|
14349 |
-
WPGMZA.GoogleModernStoreLocatorCircle = function(map, settings)
|
14350 |
{
|
14351 |
-
var
|
14352 |
-
|
14353 |
-
WPGMZA.ModernStoreLocatorCircle.call(this, map, settings);
|
14354 |
|
14355 |
-
this.
|
14356 |
-
|
14357 |
-
var
|
14358 |
-
|
14359 |
-
|
14360 |
-
|
|
|
14361 |
|
14362 |
-
|
14363 |
-
|
14364 |
|
14365 |
-
|
14366 |
-
|
14367 |
|
14368 |
-
self.mapSize = mapSize;
|
14369 |
|
14370 |
-
|
|
|
14371 |
|
14372 |
-
|
14373 |
-
|
14374 |
-
self.canvasLayer.resize_();
|
14375 |
-
self.canvasLayer.draw();
|
14376 |
-
|
14377 |
-
});
|
14378 |
}
|
14379 |
|
14380 |
-
WPGMZA.
|
14381 |
-
WPGMZA.GoogleModernStoreLocatorCircle.prototype.constructor = WPGMZA.GoogleModernStoreLocatorCircle;
|
14382 |
-
|
14383 |
-
WPGMZA.GoogleModernStoreLocatorCircle.prototype.initCanvasLayer = function()
|
14384 |
{
|
14385 |
-
|
|
|
14386 |
|
14387 |
-
|
|
|
|
|
14388 |
{
|
14389 |
-
|
14390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14391 |
}
|
14392 |
|
14393 |
-
this.
|
14394 |
-
|
14395 |
-
|
14396 |
-
self.onResize(event);
|
14397 |
-
},
|
14398 |
-
updateHandler: function(event) {
|
14399 |
-
self.onUpdate(event);
|
14400 |
-
},
|
14401 |
-
animate: true,
|
14402 |
-
resolutionScale: this.getResolutionScale()
|
14403 |
-
});
|
14404 |
}
|
14405 |
|
14406 |
-
WPGMZA.
|
14407 |
{
|
14408 |
-
|
14409 |
-
|
14410 |
-
this.canvasLayer.scheduleUpdate();
|
14411 |
}
|
14412 |
|
14413 |
-
WPGMZA.
|
|
|
|
|
|
|
|
|
14414 |
{
|
14415 |
-
|
14416 |
|
14417 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14418 |
}
|
14419 |
|
14420 |
-
WPGMZA.
|
14421 |
{
|
14422 |
-
|
14423 |
-
|
14424 |
-
this.canvasLayer.scheduleUpdate();
|
14425 |
}
|
14426 |
|
14427 |
-
WPGMZA.
|
14428 |
{
|
14429 |
-
var
|
14430 |
-
var
|
14431 |
|
14432 |
-
|
14433 |
-
|
14434 |
-
lat: 0.0,
|
14435 |
-
lng: 0.0
|
14436 |
-
});
|
14437 |
-
var latitude = new WPGMZA.LatLng({
|
14438 |
-
lat: center.lat,
|
14439 |
-
lng: 0.0
|
14440 |
-
});
|
14441 |
|
14442 |
-
|
14443 |
-
|
|
|
|
|
|
|
14444 |
|
14445 |
-
|
14446 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14447 |
|
14448 |
-
|
14449 |
-
throw new Error("here");
|
14450 |
|
14451 |
-
|
|
|
|
|
|
|
14452 |
}
|
14453 |
|
14454 |
-
WPGMZA.
|
14455 |
{
|
14456 |
-
|
14457 |
-
|
14458 |
-
|
|
|
|
|
|
|
14459 |
};
|
14460 |
-
}
|
14461 |
-
|
14462 |
-
WPGMZA.GoogleModernStoreLocatorCircle.prototype.getWorldOriginOffset = function()
|
14463 |
-
{
|
14464 |
-
var projection = this.map.googleMap.getProjection();
|
14465 |
-
var position = projection.fromLatLngToPoint(this.canvasLayer.getTopLeft());
|
14466 |
|
14467 |
-
|
14468 |
-
|
14469 |
-
|
14470 |
-
|
14471 |
-
|
14472 |
-
|
14473 |
-
|
14474 |
-
|
14475 |
-
var center = new WPGMZA.LatLng(this.settings.center);
|
14476 |
-
var projection = this.map.googleMap.getProjection();
|
14477 |
-
return projection.fromLatLngToPoint(center.toGoogleLatLng());
|
14478 |
-
}
|
14479 |
-
|
14480 |
-
WPGMZA.GoogleModernStoreLocatorCircle.prototype.getContext = function(type)
|
14481 |
-
{
|
14482 |
-
return this.canvasLayer.canvas.getContext("2d");
|
14483 |
}
|
14484 |
|
14485 |
-
WPGMZA.
|
14486 |
{
|
14487 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14488 |
}
|
14489 |
|
14490 |
-
WPGMZA.
|
14491 |
{
|
14492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14493 |
|
14494 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14495 |
}
|
14496 |
|
14497 |
-
WPGMZA.
|
14498 |
{
|
14499 |
-
this.
|
14500 |
-
this.canvasLayer = null;
|
14501 |
|
14502 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14503 |
}
|
14504 |
|
14505 |
-
|
14506 |
-
|
14507 |
-
|
14508 |
-
/**
|
14509 |
-
* @namespace WPGMZA
|
14510 |
-
* @module GoogleModernStoreLocator
|
14511 |
-
* @requires WPGMZA.ModernStoreLocator
|
14512 |
-
*/
|
14513 |
-
jQuery(function($) {
|
14514 |
-
|
14515 |
-
WPGMZA.GoogleModernStoreLocator = function(map_id) {
|
14516 |
-
var googleMap, self = this;
|
14517 |
-
|
14518 |
-
var map = this.map = WPGMZA.getMapByID(map_id);
|
14519 |
|
14520 |
-
|
14521 |
-
|
14522 |
-
|
14523 |
-
|
14524 |
-
|
14525 |
};
|
14526 |
-
var restrict = map.settings["wpgmza_store_locator_restrict"];
|
14527 |
-
|
14528 |
-
this.addressInput = $(this.element).find(".addressInput, #addressInput")[0];
|
14529 |
|
14530 |
-
|
14531 |
-
{
|
14532 |
-
if(restrict && restrict.length)
|
14533 |
-
options.componentRestrictions = {
|
14534 |
-
country: restrict
|
14535 |
-
};
|
14536 |
|
14537 |
-
|
14538 |
-
|
14539 |
-
|
14540 |
-
|
14541 |
-
|
14542 |
-
|
14543 |
-
|
14544 |
-
|
14545 |
-
|
14546 |
-
|
14547 |
-
|
14548 |
-
|
14549 |
-
|
14550 |
-
|
14551 |
-
|
14552 |
-
|
14553 |
-
|
14554 |
-
|
14555 |
-
|
14556 |
-
|
14557 |
-
* @pro-requires WPGMZA.ProPolygon
|
14558 |
-
*/
|
14559 |
-
jQuery(function($) {
|
14560 |
-
|
14561 |
-
var Parent;
|
14562 |
-
|
14563 |
-
WPGMZA.GooglePolygon = function(options, googlePolygon)
|
14564 |
-
{
|
14565 |
-
var self = this;
|
14566 |
-
|
14567 |
-
if(!options)
|
14568 |
-
options = {};
|
14569 |
-
|
14570 |
-
Parent.call(this, options, googlePolygon);
|
14571 |
-
|
14572 |
-
if(googlePolygon)
|
14573 |
-
{
|
14574 |
-
this.googlePolygon = googlePolygon;
|
14575 |
-
}
|
14576 |
-
else
|
14577 |
-
{
|
14578 |
-
this.googlePolygon = new google.maps.Polygon();
|
14579 |
-
}
|
14580 |
-
|
14581 |
-
this.googleFeature = this.googlePolygon;
|
14582 |
-
|
14583 |
-
if(options && options.polydata)
|
14584 |
-
this.googlePolygon.setOptions({
|
14585 |
-
paths: this.parseGeometry(options.polydata)
|
14586 |
-
});
|
14587 |
-
|
14588 |
-
this.googlePolygon.wpgmzaPolygon = this;
|
14589 |
-
|
14590 |
-
if(options)
|
14591 |
-
this.setOptions(options);
|
14592 |
-
|
14593 |
-
google.maps.event.addListener(this.googlePolygon, "click", function() {
|
14594 |
-
self.dispatchEvent({type: "click"});
|
14595 |
-
});
|
14596 |
-
}
|
14597 |
-
|
14598 |
-
if(WPGMZA.isProVersion())
|
14599 |
-
Parent = WPGMZA.ProPolygon;
|
14600 |
-
else
|
14601 |
-
Parent = WPGMZA.Polygon;
|
14602 |
-
|
14603 |
-
WPGMZA.GooglePolygon.prototype = Object.create(Parent.prototype);
|
14604 |
-
WPGMZA.GooglePolygon.prototype.constructor = WPGMZA.GooglePolygon;
|
14605 |
-
|
14606 |
-
WPGMZA.GooglePolygon.prototype.updateNativeFeature = function()
|
14607 |
-
{
|
14608 |
-
this.googlePolygon.setOptions(this.getScalarProperties());
|
14609 |
-
}
|
14610 |
-
|
14611 |
-
/**
|
14612 |
-
* Returns true if the polygon is editable
|
14613 |
-
* @return void
|
14614 |
-
*/
|
14615 |
-
WPGMZA.GooglePolygon.prototype.getEditable = function()
|
14616 |
-
{
|
14617 |
-
return this.googlePolygon.getOptions().editable;
|
14618 |
-
}
|
14619 |
-
|
14620 |
-
/**
|
14621 |
-
* Sets the editable state of the polygon
|
14622 |
-
* @return void
|
14623 |
-
*/
|
14624 |
-
WPGMZA.GooglePolygon.prototype.setEditable = function(value)
|
14625 |
-
{
|
14626 |
-
var self = this;
|
14627 |
-
|
14628 |
-
this.googlePolygon.setOptions({editable: value});
|
14629 |
-
|
14630 |
-
if(value)
|
14631 |
-
{
|
14632 |
-
// TODO: Unbind these when value is false
|
14633 |
-
this.googlePolygon.getPaths().forEach(function(path, index) {
|
14634 |
-
|
14635 |
-
var events = [
|
14636 |
-
"insert_at",
|
14637 |
-
"remove_at",
|
14638 |
-
"set_at"
|
14639 |
-
];
|
14640 |
-
|
14641 |
-
events.forEach(function(name) {
|
14642 |
-
google.maps.event.addListener(path, name, function() {
|
14643 |
-
self.trigger("change");
|
14644 |
-
})
|
14645 |
-
});
|
14646 |
-
|
14647 |
-
});
|
14648 |
-
|
14649 |
-
// TODO: Add dragging and listen for dragend
|
14650 |
-
google.maps.event.addListener(this.googlePolygon, "dragend", function(event) {
|
14651 |
-
self.trigger("change");
|
14652 |
-
});
|
14653 |
-
|
14654 |
-
google.maps.event.addListener(this.googlePolygon, "click", function(event) {
|
14655 |
-
|
14656 |
-
if(!WPGMZA.altKeyDown)
|
14657 |
-
return;
|
14658 |
-
|
14659 |
-
var path = this.getPath();
|
14660 |
-
path.removeAt(event.vertex);
|
14661 |
-
self.trigger("change");
|
14662 |
-
|
14663 |
-
});
|
14664 |
-
}
|
14665 |
-
}
|
14666 |
-
|
14667 |
-
WPGMZA.GooglePolygon.prototype.setDraggable = function(value)
|
14668 |
-
{
|
14669 |
-
this.googlePolygon.setDraggable(value);
|
14670 |
-
}
|
14671 |
-
|
14672 |
-
/**
|
14673 |
-
* Returns the polygon represented by a JSON object
|
14674 |
-
* @return object
|
14675 |
-
*/
|
14676 |
-
WPGMZA.GooglePolygon.prototype.getGeometry = function()
|
14677 |
-
{
|
14678 |
-
var result = [];
|
14679 |
-
|
14680 |
-
// TODO: Support holes using multiple paths
|
14681 |
-
var path = this.googlePolygon.getPath();
|
14682 |
-
for(var i = 0; i < path.getLength(); i++)
|
14683 |
-
{
|
14684 |
-
var latLng = path.getAt(i);
|
14685 |
-
result.push({
|
14686 |
-
lat: latLng.lat(),
|
14687 |
-
lng: latLng.lng()
|
14688 |
-
});
|
14689 |
-
}
|
14690 |
-
|
14691 |
-
return result;
|
14692 |
-
}
|
14693 |
-
|
14694 |
});
|
14695 |
|
14696 |
-
// js/v8/
|
14697 |
/**
|
14698 |
* @namespace WPGMZA
|
14699 |
-
* @module
|
14700 |
-
* @requires WPGMZA.
|
14701 |
*/
|
14702 |
jQuery(function($) {
|
14703 |
|
14704 |
-
WPGMZA.
|
14705 |
-
|
14706 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14707 |
|
14708 |
-
WPGMZA.
|
|
|
|
|
|
|
14709 |
|
14710 |
-
|
14711 |
-
|
14712 |
-
} else {
|
14713 |
-
this.googlePolyline = new google.maps.Polyline(this.settings);
|
14714 |
}
|
14715 |
|
14716 |
-
|
14717 |
-
|
14718 |
-
|
14719 |
-
|
14720 |
-
|
14721 |
-
|
14722 |
-
|
14723 |
-
|
14724 |
-
|
14725 |
-
|
14726 |
-
|
14727 |
-
|
14728 |
-
|
14729 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14730 |
|
14731 |
-
|
14732 |
-
self.dispatchEvent({type: "click"});
|
14733 |
-
});
|
14734 |
}
|
14735 |
|
14736 |
-
|
14737 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14738 |
|
14739 |
-
WPGMZA.
|
14740 |
-
|
|
|
14741 |
}
|
14742 |
|
14743 |
-
WPGMZA.
|
14744 |
-
|
|
|
|
|
|
|
|
|
14745 |
|
14746 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14747 |
|
|
|
14748 |
|
|
|
|
|
14749 |
|
14750 |
-
if
|
14751 |
-
|
14752 |
-
var
|
14753 |
-
var
|
14754 |
-
"insert_at",
|
14755 |
-
"remove_at",
|
14756 |
-
"set_at"
|
14757 |
-
];
|
14758 |
|
14759 |
-
|
14760 |
-
google.maps.event.addListener(path, name, function() {
|
14761 |
-
self.trigger("change");
|
14762 |
-
})
|
14763 |
-
});
|
14764 |
|
14765 |
-
|
14766 |
-
|
14767 |
-
|
14768 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14769 |
|
14770 |
-
|
14771 |
-
|
14772 |
-
|
14773 |
-
|
14774 |
-
|
14775 |
-
|
14776 |
-
|
14777 |
-
|
14778 |
-
|
|
|
|
|
|
|
14779 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14780 |
}
|
14781 |
-
|
14782 |
-
WPGMZA.
|
14783 |
-
|
|
|
14784 |
}
|
14785 |
|
14786 |
-
WPGMZA.
|
14787 |
-
|
14788 |
-
|
14789 |
|
14790 |
-
|
14791 |
-
|
14792 |
-
|
14793 |
-
|
14794 |
-
|
14795 |
-
|
14796 |
-
|
14797 |
-
|
14798 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14799 |
|
14800 |
-
|
|
|
14801 |
}
|
14802 |
|
14803 |
});
|
14804 |
|
14805 |
-
// js/v8/
|
14806 |
/**
|
14807 |
* @namespace WPGMZA
|
14808 |
-
* @module
|
14809 |
-
* @requires WPGMZA.
|
14810 |
*/
|
14811 |
jQuery(function($) {
|
14812 |
-
|
14813 |
-
/**
|
14814 |
-
* Subclass, used when Google is the maps engine. <strong>Please <em>do not</em> call this constructor directly. Always use createInstance rather than instantiating this class directly.</strong> Using createInstance allows this class to be externally extensible.
|
14815 |
-
* @class WPGMZA.GoogleRectangle
|
14816 |
-
* @constructor WPGMZA.GoogleRectangle
|
14817 |
-
* @memberof WPGMZA
|
14818 |
-
* @augments WPGMZA.Rectangle
|
14819 |
-
* @see WPGMZA.Rectangle.createInstance
|
14820 |
-
*/
|
14821 |
-
WPGMZA.GoogleRectangle = function(options, googleRectangle)
|
14822 |
{
|
14823 |
var self = this;
|
14824 |
|
14825 |
-
|
14826 |
-
options = {};
|
14827 |
-
|
14828 |
-
WPGMZA.Rectangle.call(this, options, googleRectangle);
|
14829 |
-
|
14830 |
-
if(googleRectangle)
|
14831 |
-
{
|
14832 |
-
this.googleRectangle = googleRectangle;
|
14833 |
-
|
14834 |
-
this.cornerA = options.cornerA = new WPGMZA.LatLng({
|
14835 |
-
lat: googleRectangle.getBounds().getNorthEast().lat(),
|
14836 |
-
lng: googleRectangle.getBounds().getSouthWest().lng(),
|
14837 |
-
});
|
14838 |
-
|
14839 |
-
this.cornerB = options.cornerB = new WPGMZA.LatLng({
|
14840 |
-
lat: googleRectangle.getBounds().getSouthWest().lat(),
|
14841 |
-
lng: googleRectangle.getBounds().getNorthEast().lng()
|
14842 |
-
});
|
14843 |
-
}
|
14844 |
-
else
|
14845 |
-
{
|
14846 |
-
this.googleRectangle = new google.maps.Rectangle();
|
14847 |
-
this.googleRectangle.wpgmzaRectangle = this;
|
14848 |
-
}
|
14849 |
-
|
14850 |
-
this.googleFeature = this.googleRectangle;
|
14851 |
|
14852 |
-
|
14853 |
-
this.setOptions(options);
|
14854 |
|
14855 |
-
|
14856 |
-
|
14857 |
});
|
|
|
|
|
|
|
|
|
14858 |
}
|
14859 |
|
14860 |
-
WPGMZA.
|
14861 |
-
WPGMZA.
|
14862 |
|
14863 |
-
WPGMZA.
|
14864 |
{
|
14865 |
-
|
14866 |
-
}
|
14867 |
|
14868 |
-
|
14869 |
-
|
14870 |
-
|
14871 |
-
|
|
|
|
|
|
|
|
|
|
|
14872 |
|
14873 |
-
|
14874 |
-
{
|
14875 |
-
this.googleRectangle.setDraggable(value ? true : false);
|
14876 |
}
|
14877 |
|
14878 |
-
WPGMZA.
|
14879 |
{
|
14880 |
var self = this;
|
|
|
14881 |
|
14882 |
-
|
14883 |
|
14884 |
-
if(
|
14885 |
{
|
14886 |
-
|
14887 |
-
|
14888 |
-
});
|
14889 |
}
|
14890 |
-
}
|
14891 |
-
|
14892 |
-
WPGMZA.GoogleRectangle.prototype.setOptions = function(options)
|
14893 |
-
{
|
14894 |
-
WPGMZA.Rectangle.prototype.setOptions.apply(this, arguments);
|
14895 |
|
14896 |
-
|
14897 |
{
|
14898 |
-
|
14899 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14900 |
}
|
14901 |
-
}
|
14902 |
-
|
14903 |
-
WPGMZA.GoogleRectangle.prototype.updateNativeFeature = function()
|
14904 |
-
{
|
14905 |
-
var googleOptions = this.getScalarProperties();
|
14906 |
-
|
14907 |
-
var north = parseFloat(this.cornerA.lat);
|
14908 |
-
var west = parseFloat(this.cornerA.lng);
|
14909 |
-
var south = parseFloat(this.cornerB.lat);
|
14910 |
-
var east = parseFloat(this.cornerB.lng);
|
14911 |
|
14912 |
-
if(
|
14913 |
-
|
14914 |
-
|
14915 |
-
west: west,
|
14916 |
-
south: south,
|
14917 |
-
east: east
|
14918 |
-
};
|
14919 |
-
|
14920 |
}
|
14921 |
|
14922 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14923 |
}
|
14924 |
|
14925 |
});
|
14926 |
|
14927 |
-
// js/v8/
|
14928 |
/**
|
14929 |
* @namespace WPGMZA
|
14930 |
-
* @module
|
14931 |
-
* @requires WPGMZA
|
14932 |
*/
|
14933 |
jQuery(function($) {
|
14934 |
|
14935 |
-
WPGMZA.
|
14936 |
{
|
14937 |
-
WPGMZA.
|
14938 |
|
14939 |
-
|
14940 |
}
|
14941 |
|
14942 |
-
WPGMZA.extend(WPGMZA.
|
14943 |
-
|
14944 |
-
});
|
14945 |
-
|
14946 |
-
// js/v8/google-maps/google-text-overlay.js
|
14947 |
-
/**
|
14948 |
-
* @namespace WPGMZA
|
14949 |
-
* @module GoogleTextOverlay
|
14950 |
-
* @requires WPGMZA.GoogleText
|
14951 |
-
*/
|
14952 |
-
jQuery(function($) {
|
14953 |
|
14954 |
-
WPGMZA.
|
14955 |
{
|
14956 |
-
|
14957 |
|
14958 |
if(!options)
|
14959 |
-
|
14960 |
|
14961 |
-
|
14962 |
-
this.position = options.position;
|
14963 |
|
14964 |
-
|
14965 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14966 |
|
14967 |
-
|
14968 |
-
|
14969 |
-
|
14970 |
-
|
14971 |
-
|
14972 |
-
WPGMZA.GoogleTextOverlay.prototype = new google.maps.OverlayView();
|
14973 |
-
|
14974 |
-
WPGMZA.GoogleTextOverlay.prototype.onAdd = function()
|
14975 |
-
{
|
14976 |
-
var overlayProjection = this.getProjection();
|
14977 |
-
var position = overlayProjection.fromLatLngToDivPixel(this.position.toGoogleLatLng());
|
14978 |
|
14979 |
-
|
14980 |
-
|
14981 |
-
|
14982 |
-
|
14983 |
-
|
14984 |
-
|
14985 |
-
|
14986 |
-
|
14987 |
-
|
14988 |
-
|
14989 |
-
|
14990 |
-
|
14991 |
-
|
14992 |
-
|
14993 |
-
|
|
|
|
|
14994 |
|
14995 |
-
|
14996 |
-
|
14997 |
-
|
14998 |
-
|
14999 |
-
|
15000 |
-
|
15001 |
-
|
15002 |
-
|
15003 |
-
|
15004 |
-
|
15005 |
-
|
15006 |
-
|
15007 |
-
|
15008 |
-
|
15009 |
-
|
15010 |
-
this.element.hide();
|
15011 |
-
}
|
15012 |
-
|
15013 |
-
WPGMZA.GoogleTextOverlay.prototype.show = function()
|
15014 |
-
{
|
15015 |
-
this.element.show();
|
15016 |
}
|
15017 |
|
15018 |
-
WPGMZA.
|
15019 |
{
|
15020 |
-
if(
|
15021 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15022 |
else
|
15023 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15024 |
}
|
15025 |
|
15026 |
});
|
15027 |
|
15028 |
-
// js/v8/
|
15029 |
/**
|
15030 |
* @namespace WPGMZA
|
15031 |
-
* @module
|
15032 |
-
* @requires
|
15033 |
*/
|
15034 |
jQuery(function($) {
|
15035 |
|
15036 |
-
|
15037 |
-
|
15038 |
-
|
15039 |
-
|
15040 |
-
|
15041 |
-
|
15042 |
-
WPGMZA.GoogleVertexContextMenu = function(mapEditPage)
|
15043 |
{
|
15044 |
-
var self = this;
|
15045 |
|
15046 |
-
this.mapEditPage = mapEditPage;
|
15047 |
-
|
15048 |
-
this.element = document.createElement("div");
|
15049 |
-
this.element.className = "wpgmza-vertex-context-menu";
|
15050 |
-
this.element.innerHTML = "Delete";
|
15051 |
-
|
15052 |
-
google.maps.event.addDomListener(this.element, "click", function(event) {
|
15053 |
-
self.removeVertex();
|
15054 |
-
event.preventDefault();
|
15055 |
-
event.stopPropagation();
|
15056 |
-
return false;
|
15057 |
-
});
|
15058 |
}
|
15059 |
|
15060 |
-
WPGMZA.
|
|
|
15061 |
|
15062 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15063 |
{
|
15064 |
-
|
15065 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15066 |
|
15067 |
-
|
15068 |
-
|
15069 |
-
|
15070 |
-
|
15071 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15072 |
}
|
15073 |
|
15074 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15075 |
{
|
15076 |
-
|
15077 |
-
|
|
|
|
|
15078 |
|
15079 |
-
|
15080 |
-
|
15081 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15082 |
}
|
15083 |
|
15084 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15085 |
{
|
15086 |
-
|
15087 |
-
|
15088 |
-
|
15089 |
-
|
15090 |
-
|
|
|
|
|
|
|
15091 |
}
|
15092 |
-
|
15093 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15094 |
{
|
15095 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15096 |
}
|
15097 |
|
15098 |
-
WPGMZA.
|
15099 |
{
|
15100 |
-
|
15101 |
-
var projection = this.getProjection();
|
15102 |
-
|
15103 |
-
if (!position || !projection)
|
15104 |
-
return;
|
15105 |
-
|
15106 |
-
var point = projection.fromLatLngToDivPixel(position);
|
15107 |
-
this.element.style.top = point.y + 'px';
|
15108 |
-
this.element.style.left = point.x + 'px';
|
15109 |
}
|
15110 |
|
15111 |
-
WPGMZA.
|
15112 |
{
|
15113 |
-
|
15114 |
-
var vertex = this.get('vertex');
|
15115 |
-
|
15116 |
-
if (!path || vertex == undefined) {
|
15117 |
-
this.close();
|
15118 |
-
return;
|
15119 |
-
}
|
15120 |
-
|
15121 |
-
path.removeAt(vertex);
|
15122 |
-
this.close();
|
15123 |
}
|
15124 |
|
15125 |
-
|
15126 |
-
|
15127 |
-
// js/v8/map-edit-page/feature-panel.js
|
15128 |
-
/**
|
15129 |
-
* @namespace WPGMZA
|
15130 |
-
* @module FeaturePanel
|
15131 |
-
* @requires WPGMZA.EventDispatcher
|
15132 |
-
*/
|
15133 |
-
jQuery(function($) {
|
15134 |
-
|
15135 |
-
WPGMZA.FeaturePanel = function(element, mapEditPage)
|
15136 |
{
|
15137 |
var self = this;
|
15138 |
|
15139 |
-
|
15140 |
-
|
15141 |
-
this.map = mapEditPage.map;
|
15142 |
-
this.drawingManager = mapEditPage.drawingManager;
|
15143 |
-
|
15144 |
-
this.feature = null;
|
15145 |
-
|
15146 |
-
this.element = element;
|
15147 |
-
|
15148 |
-
this.initDefaults();
|
15149 |
-
this.setMode(WPGMZA.FeaturePanel.MODE_ADD);
|
15150 |
-
|
15151 |
-
this.drawingInstructionsElement = $(this.element).find(".wpgmza-feature-drawing-instructions");
|
15152 |
-
this.drawingInstructionsElement.detach();
|
15153 |
-
|
15154 |
-
this.editingInstructionsElement = $(this.element).find(".wpgmza-feature-editing-instructions");
|
15155 |
-
this.editingInstructionsElement.detach();
|
15156 |
-
|
15157 |
-
$("#wpgmaps_tabs_markers").on("tabsactivate", function(event, ui) {
|
15158 |
-
if($.contains(ui.newPanel[0], self.element[0]))
|
15159 |
-
self.onTabActivated(event);
|
15160 |
-
});
|
15161 |
|
15162 |
-
|
15163 |
-
|
15164 |
-
|
15165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15166 |
|
15167 |
-
|
15168 |
-
|
15169 |
-
if(self.mode == "add")
|
15170 |
-
self.onAddFeature(event);
|
15171 |
-
});*/
|
15172 |
-
|
15173 |
-
$(document.body).on("click", "[data-edit-" + this.featureType + "-id]", function(event) {
|
15174 |
-
self.onEditFeature(event);
|
15175 |
-
});
|
15176 |
|
15177 |
-
|
15178 |
-
self.onDeleteFeature(event);
|
15179 |
-
});
|
15180 |
|
15181 |
-
|
15182 |
-
|
15183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15184 |
|
15185 |
-
|
15186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15187 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15188 |
|
15189 |
-
|
15190 |
-
self.onDrawingModeChanged(event);
|
15191 |
-
});
|
15192 |
|
15193 |
-
|
15194 |
-
|
|
|
|
|
15195 |
});
|
15196 |
}
|
15197 |
|
15198 |
-
WPGMZA.
|
15199 |
-
|
15200 |
-
|
15201 |
-
|
15202 |
|
15203 |
-
WPGMZA.
|
|
|
15204 |
|
15205 |
-
Object.defineProperty(WPGMZA.
|
15206 |
|
15207 |
-
"get": function()
|
15208 |
-
|
|
|
15209 |
}
|
15210 |
|
15211 |
});
|
15212 |
|
15213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15214 |
|
15215 |
-
|
15216 |
-
return
|
15217 |
-
}
|
15218 |
|
15219 |
-
|
15220 |
-
|
15221 |
-
Object.defineProperty(WPGMZA.FeaturePanel.prototype, "featureDataTable", {
|
15222 |
|
15223 |
-
|
15224 |
-
|
15225 |
-
|
|
|
|
|
|
|
|
|
|
|
15226 |
|
15227 |
-
|
15228 |
-
|
15229 |
-
|
|
|
|
|
15230 |
|
15231 |
-
|
15232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15233 |
}
|
15234 |
|
15235 |
-
|
|
|
|
|
15236 |
|
15237 |
-
|
|
|
|
|
|
|
15238 |
|
15239 |
-
|
15240 |
-
return
|
15241 |
-
}
|
15242 |
|
15243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15244 |
|
15245 |
-
|
|
|
|
|
15246 |
|
15247 |
-
|
15248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15249 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15250 |
|
15251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15252 |
|
15253 |
-
|
15254 |
-
{
|
15255 |
-
if(this.preloader)
|
15256 |
-
return;
|
15257 |
-
|
15258 |
-
this.preloader = $(WPGMZA.preloaderHTML);
|
15259 |
-
this.preloader.hide();
|
15260 |
-
|
15261 |
-
$(this.element).append(this.preloader);
|
15262 |
-
}
|
15263 |
|
15264 |
-
WPGMZA.
|
15265 |
{
|
15266 |
-
var
|
15267 |
|
15268 |
-
|
15269 |
-
}
|
15270 |
-
|
15271 |
-
WPGMZA.FeaturePanel.prototype.initDefaults = function()
|
15272 |
-
{
|
15273 |
-
$(this.element).find("[data-ajax-name]:not([type='radio'])").each(function(index, el) {
|
15274 |
-
|
15275 |
-
var val = $(el).val();
|
15276 |
-
|
15277 |
-
if(!val)
|
15278 |
-
return;
|
15279 |
-
|
15280 |
-
$(el).attr("data-default-value", val);
|
15281 |
-
|
15282 |
-
});
|
15283 |
-
}
|
15284 |
-
|
15285 |
-
WPGMZA.FeaturePanel.prototype.setCaptionType = function(type, id)
|
15286 |
-
{
|
15287 |
-
var args = arguments;
|
15288 |
-
var icons = {
|
15289 |
-
add: "fa-plus-circle",
|
15290 |
-
save: "fa-pencil-square-o"
|
15291 |
-
};
|
15292 |
|
15293 |
-
|
|
|
15294 |
{
|
15295 |
-
|
15296 |
-
|
15297 |
-
|
15298 |
-
|
15299 |
-
|
15300 |
-
|
15301 |
-
|
15302 |
-
|
15303 |
-
|
15304 |
-
|
15305 |
-
|
15306 |
-
|
15307 |
-
|
15308 |
-
if(icon.length)
|
15309 |
-
{
|
15310 |
-
// Need to recreate the icon as text() will have wiped it out
|
15311 |
-
icon = $("<i class='fa' aria-hidden='true'></i>");
|
15312 |
-
|
15313 |
-
icon.addClass(icons[type]);
|
15314 |
-
|
15315 |
-
$(el).prepend(" ");
|
15316 |
-
$(el).prepend(icon);
|
15317 |
-
}
|
15318 |
-
|
15319 |
-
});
|
15320 |
-
|
15321 |
-
break;
|
15322 |
-
|
15323 |
-
default:
|
15324 |
-
throw new Error("Invalid type");
|
15325 |
-
break;
|
15326 |
}
|
15327 |
-
}
|
15328 |
-
|
15329 |
-
WPGMZA.FeaturePanel.prototype.setMode = function(type, id)
|
15330 |
-
{
|
15331 |
-
this._mode = type;
|
15332 |
-
this.setCaptionType(type, id);
|
15333 |
-
}
|
15334 |
-
|
15335 |
-
WPGMZA.FeaturePanel.prototype.setTargetFeature = function(feature)
|
15336 |
-
{
|
15337 |
-
var self = this;
|
15338 |
|
15339 |
-
|
15340 |
-
|
15341 |
-
|
|
|
15342 |
|
15343 |
-
|
15344 |
-
|
15345 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
15346 |
|
15347 |
-
|
15348 |
-
|
15349 |
-
|
15350 |
-
|
15351 |
-
|
15352 |
-
|
15353 |
-
|
15354 |
-
feature.setDraggable(true);
|
15355 |
-
|
15356 |
-
feature.on("change", function(event) {
|
15357 |
-
self.onFeatureChanged(event);
|
15358 |
});
|
15359 |
-
this.setMode(WPGMZA.FeaturePanel.MODE_EDIT);
|
15360 |
-
this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE);
|
15361 |
|
15362 |
-
this.
|
15363 |
-
|
15364 |
-
|
15365 |
-
|
15366 |
-
|
15367 |
-
|
15368 |
-
|
15369 |
-
|
15370 |
-
WPGMZA.FeaturePanel.prototype.reset = function()
|
15371 |
-
{
|
15372 |
-
$(this.element).find("[data-ajax-name]:not([data-ajax-name='map_id']):not([type='color']):not([type='checkbox']):not([type='radio'])").val("");
|
15373 |
-
$(this.element).find("select[data-ajax-name]>option:first-child").prop("selected", true);
|
15374 |
-
$(this.element).find("[data-ajax-name='id']").val("-1");
|
15375 |
-
|
15376 |
-
$(this.element).find("input[type='checkbox']").prop("checked", false);
|
15377 |
-
|
15378 |
-
if(tinyMCE.get("wpgmza-description-editor"))
|
15379 |
-
tinyMCE.get("wpgmza-description-editor").setContent("");
|
15380 |
-
else
|
15381 |
-
$("#wpgmza-description-editor").val("");
|
15382 |
-
|
15383 |
-
$('#wpgmza-description-editor').val("");
|
15384 |
-
|
15385 |
-
this.showPreloader(false);
|
15386 |
-
this.setMode(WPGMZA.FeaturePanel.MODE_ADD);
|
15387 |
-
|
15388 |
-
$(this.element).find("[data-ajax-name][data-default-value]").each(function(index, el) {
|
15389 |
|
15390 |
-
|
|
|
|
|
|
|
15391 |
|
15392 |
-
|
15393 |
-
|
15394 |
-
|
15395 |
-
|
15396 |
-
|
15397 |
-
|
15398 |
-
this.reset();
|
15399 |
-
|
15400 |
-
if($.isNumeric(arg))
|
15401 |
-
id = arg;
|
15402 |
-
else
|
15403 |
-
{
|
15404 |
-
expectedBaseClass = WPGMZA[ WPGMZA.capitalizeWords(this.featureType) ];
|
15405 |
|
15406 |
-
|
15407 |
-
|
|
|
|
|
|
|
|
|
|
|
15408 |
|
15409 |
-
|
|
|
|
|
15410 |
}
|
|
|
|
|
15411 |
|
15412 |
-
this.
|
15413 |
-
|
15414 |
-
|
15415 |
-
|
15416 |
-
|
15417 |
-
|
15418 |
-
|
15419 |
-
|
15420 |
-
|
15421 |
-
|
15422 |
-
|
15423 |
-
|
15424 |
-
|
15425 |
-
|
15426 |
-
|
15427 |
-
|
15428 |
-
|
15429 |
-
|
15430 |
-
|
15431 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15432 |
});
|
|
|
|
|
15433 |
}
|
15434 |
|
15435 |
-
WPGMZA.
|
15436 |
{
|
15437 |
-
this.
|
|
|
15438 |
|
15439 |
-
|
15440 |
-
{
|
15441 |
-
this.preloader.fadeIn();
|
15442 |
-
this.element.addClass("wpgmza-loading");
|
15443 |
-
}
|
15444 |
-
else
|
15445 |
-
{
|
15446 |
-
this.preloader.fadeOut();
|
15447 |
-
this.element.removeClass("wpgmza-loading");
|
15448 |
-
}
|
15449 |
}
|
15450 |
|
15451 |
-
WPGMZA.
|
15452 |
{
|
15453 |
-
var
|
15454 |
|
15455 |
-
|
|
|
|
|
|
|
15456 |
{
|
15457 |
-
|
15458 |
-
|
15459 |
-
|
15460 |
-
switch((target.attr("type") || "").toLowerCase())
|
15461 |
-
{
|
15462 |
-
case "checkbox":
|
15463 |
-
case "radio":
|
15464 |
-
|
15465 |
-
target.prop("checked", data[name] == 1);
|
15466 |
-
|
15467 |
-
break;
|
15468 |
-
|
15469 |
-
case "color":
|
15470 |
-
|
15471 |
-
// NB: Account for legacy color format
|
15472 |
-
if(!value.match(/^#/))
|
15473 |
-
value = "#" + value;
|
15474 |
-
|
15475 |
-
default:
|
15476 |
-
|
15477 |
-
if(typeof value == "object")
|
15478 |
-
value = JSON.stringify(value);
|
15479 |
-
|
15480 |
-
$(this.element).find("[data-ajax-name='" + name + "']:not(select)").val(value);
|
15481 |
-
|
15482 |
-
$(this.element).find("select[data-ajax-name='" + name + "']").each(function(index, el) {
|
15483 |
-
|
15484 |
-
if(typeof value == "string" && data[name].length == 0)
|
15485 |
-
return;
|
15486 |
-
|
15487 |
-
$(el).val(value);
|
15488 |
-
|
15489 |
-
});
|
15490 |
-
|
15491 |
-
break;
|
15492 |
-
}
|
15493 |
}
|
|
|
|
|
15494 |
}
|
15495 |
|
15496 |
-
WPGMZA.
|
15497 |
{
|
15498 |
-
|
15499 |
-
var data = {};
|
15500 |
-
|
15501 |
-
fields.each(function(index, el) {
|
15502 |
-
|
15503 |
-
var type = "text";
|
15504 |
-
if($(el).attr("type"))
|
15505 |
-
type = $(el).attr("type").toLowerCase();
|
15506 |
-
|
15507 |
-
switch(type)
|
15508 |
-
{
|
15509 |
-
case "checkbox":
|
15510 |
-
data[$(el).attr("data-ajax-name")] = $(el).prop("checked") ? 1 : 0;
|
15511 |
-
break;
|
15512 |
-
|
15513 |
-
case "radio":
|
15514 |
-
if($(el).prop("checked"))
|
15515 |
-
data[$(el).attr("data-ajax-name")] = $(el).val();
|
15516 |
-
break;
|
15517 |
-
|
15518 |
-
default:
|
15519 |
-
data[$(el).attr("data-ajax-name")] = $(el).val()
|
15520 |
-
break;
|
15521 |
-
}
|
15522 |
-
|
15523 |
-
});
|
15524 |
-
|
15525 |
-
return data;
|
15526 |
}
|
15527 |
|
15528 |
-
WPGMZA.
|
15529 |
-
|
|
|
|
|
|
|
15530 |
return;
|
15531 |
-
|
15532 |
-
var feature = this.feature;
|
15533 |
-
|
15534 |
-
this.setTargetFeature(null);
|
15535 |
|
15536 |
-
if(
|
15537 |
{
|
15538 |
-
|
|
|
15539 |
|
15540 |
-
|
15541 |
-
this.updateFeatureByID(feature.id);
|
15542 |
}
|
15543 |
-
}
|
15544 |
-
|
15545 |
-
WPGMZA.FeaturePanel.prototype.updateFeatureByID = function(id)
|
15546 |
-
{
|
15547 |
-
var self = this;
|
15548 |
-
var feature;
|
15549 |
|
15550 |
-
|
15551 |
-
|
15552 |
-
|
15553 |
-
|
15554 |
-
|
15555 |
|
15556 |
-
|
15557 |
-
success: function(data, status, xhr) {
|
15558 |
-
|
15559 |
-
if(feature = self.map[getByIDFunction](id))
|
15560 |
-
self.map[removeFunction](feature);
|
15561 |
-
|
15562 |
-
feature = WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data);
|
15563 |
-
self.map[addFunction](feature);
|
15564 |
-
|
15565 |
-
}
|
15566 |
-
});
|
15567 |
}
|
15568 |
|
15569 |
-
WPGMZA.
|
15570 |
{
|
15571 |
-
|
15572 |
{
|
15573 |
-
case WPGMZA.FeaturePanel.MODE_ADD:
|
15574 |
-
$(this.map.element).append(this.drawingInstructionsElement);
|
15575 |
-
$(this.drawingInstructionsElement).hide().fadeIn();
|
15576 |
-
break;
|
15577 |
|
15578 |
-
default:
|
15579 |
-
$(this.map.element).append(this.editingInstructionsElement);
|
15580 |
-
$(this.editingInstructionsElement).hide().fadeIn();
|
15581 |
-
break;
|
15582 |
}
|
|
|
|
|
15583 |
}
|
15584 |
|
15585 |
-
WPGMZA.
|
15586 |
-
this.reset();
|
15587 |
-
this.drawingManager.setDrawingMode(this.featureType);
|
15588 |
-
this.onAddFeature(event);
|
15589 |
-
|
15590 |
-
$(".wpgmza-table-container-title").hide();
|
15591 |
-
$(".wpgmza-table-container").hide();
|
15592 |
-
|
15593 |
-
var featureString = this.featureType.charAt(0).toUpperCase() + this.featureType.slice(1);
|
15594 |
-
|
15595 |
-
$("#wpgmza-table-container-"+featureString).show();
|
15596 |
-
$("#wpgmza-table-container-title-"+featureString).show();
|
15597 |
-
|
15598 |
-
}
|
15599 |
-
|
15600 |
-
WPGMZA.FeaturePanel.prototype.onTabDeactivated = function()
|
15601 |
{
|
15602 |
-
|
15603 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15604 |
}
|
15605 |
|
15606 |
-
WPGMZA.
|
15607 |
{
|
15608 |
-
|
15609 |
|
15610 |
-
|
15611 |
-
|
15612 |
-
|
|
|
15613 |
|
15614 |
-
|
15615 |
-
|
15616 |
-
|
15617 |
-
|
15618 |
-
var id = $(event.currentTarget).attr(name);
|
15619 |
-
|
15620 |
-
this.discardChanges();
|
15621 |
-
|
15622 |
-
this.select(id);
|
15623 |
}
|
15624 |
|
15625 |
-
WPGMZA.
|
15626 |
{
|
15627 |
-
|
15628 |
-
|
15629 |
-
|
15630 |
-
|
15631 |
-
|
15632 |
|
15633 |
-
this.
|
|
|
15634 |
|
15635 |
-
|
15636 |
-
|
15637 |
-
|
15638 |
-
|
15639 |
-
self.map["remove" + WPGMZA.capitalizeWords(self.featureType)](feature);
|
15640 |
-
self.featureDataTable.reload();
|
15641 |
-
|
15642 |
-
}
|
15643 |
-
});
|
15644 |
}
|
15645 |
|
15646 |
-
WPGMZA.
|
15647 |
{
|
15648 |
-
|
15649 |
-
$(this.editingInstructionsElement).detach();
|
15650 |
-
|
15651 |
-
if(this.drawingManager.mode == this.featureType)
|
15652 |
{
|
15653 |
-
|
|
|
15654 |
}
|
15655 |
-
}
|
15656 |
-
|
15657 |
-
WPGMZA.FeaturePanel.prototype.onDrawingComplete = function(event)
|
15658 |
-
{
|
15659 |
-
var self = this;
|
15660 |
-
var property = "engine" + WPGMZA.capitalizeWords(this.featureType);
|
15661 |
-
var engineFeature = event[property];
|
15662 |
-
var formData = this.serializeFormData();
|
15663 |
-
var geometryField = $(self.element).find("textarea[data-ajax-name$='data']");
|
15664 |
-
|
15665 |
-
delete formData.polydata;
|
15666 |
-
|
15667 |
-
var nativeFeature = WPGMZA[WPGMZA.capitalizeWords(this.featureType)].createInstance(
|
15668 |
-
formData,
|
15669 |
-
engineFeature
|
15670 |
-
);
|
15671 |
-
|
15672 |
-
this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE);
|
15673 |
-
this.map["add" + WPGMZA.capitalizeWords(this.featureType)](nativeFeature);
|
15674 |
-
|
15675 |
-
this.setTargetFeature(nativeFeature);
|
15676 |
|
15677 |
-
|
15678 |
-
if(geometryField.length)
|
15679 |
-
geometryField.val(JSON.stringify(nativeFeature.getGeometry()));
|
15680 |
|
15681 |
-
|
15682 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15683 |
}
|
15684 |
}
|
15685 |
|
15686 |
-
WPGMZA.
|
15687 |
{
|
15688 |
var self = this;
|
15689 |
-
var feature = this.feature;
|
15690 |
|
15691 |
-
if(
|
15692 |
-
|
|
|
|
|
|
|
15693 |
|
15694 |
-
|
15695 |
-
|
15696 |
-
|
15697 |
-
|
15698 |
-
|
15699 |
-
|
15700 |
-
|
|
|
|
|
|
|
|
|
15701 |
|
15702 |
-
|
15703 |
-
|
15704 |
-
|
15705 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15706 |
}
|
15707 |
|
15708 |
-
WPGMZA.
|
15709 |
{
|
15710 |
-
|
15711 |
-
|
15712 |
-
|
15713 |
return;
|
|
|
15714 |
|
15715 |
-
|
15716 |
}
|
15717 |
|
15718 |
-
WPGMZA.
|
|
|
|
|
15719 |
|
15720 |
-
|
15721 |
-
|
15722 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15723 |
|
15724 |
-
|
15725 |
-
|
|
|
|
|
15726 |
|
15727 |
-
|
15728 |
-
|
15729 |
-
|
15730 |
-
|
15731 |
-
|
15732 |
-
}
|
15733 |
-
|
15734 |
-
if (!data.cornerA) {
|
15735 |
-
alert(WPGMZA.localized_strings.no_shape_rectangle);
|
15736 |
-
return;
|
15737 |
-
}
|
15738 |
-
}
|
15739 |
-
if (this.featureType == 'polygon') {
|
15740 |
-
if (!data.polydata) {
|
15741 |
-
alert(WPGMZA.localized_strings.no_shape_polygon);
|
15742 |
-
return;
|
15743 |
-
}
|
15744 |
-
}
|
15745 |
-
if (this.featureType == 'polyline') {
|
15746 |
-
if (!data.polydata) {
|
15747 |
-
alert(WPGMZA.localized_strings.no_shape_polyline);
|
15748 |
-
return;
|
15749 |
-
}
|
15750 |
-
}
|
15751 |
-
|
15752 |
-
if(!isNew)
|
15753 |
-
route += id;
|
15754 |
|
15755 |
-
|
15756 |
-
this.showPreloader(true);
|
15757 |
|
15758 |
-
|
15759 |
-
|
15760 |
-
|
15761 |
-
|
15762 |
-
|
15763 |
-
|
15764 |
-
|
15765 |
-
|
15766 |
-
var getByIDFunction = "get" + functionSuffix + "ByID";
|
15767 |
-
var removeFunction = "remove" + functionSuffix;
|
15768 |
-
var addFunction = "add" + functionSuffix;
|
15769 |
-
|
15770 |
-
self.reset();
|
15771 |
-
|
15772 |
-
if(feature = self.map[getByIDFunction](id))
|
15773 |
-
self.map[removeFunction](feature);
|
15774 |
-
|
15775 |
-
self.setTargetFeature(null);
|
15776 |
-
self.showPreloader(false);
|
15777 |
|
15778 |
-
|
15779 |
-
|
15780 |
|
15781 |
-
|
15782 |
-
self.onTabActivated(event);
|
15783 |
-
|
15784 |
-
}
|
15785 |
-
})
|
15786 |
}
|
15787 |
|
15788 |
-
|
15789 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15790 |
|
15791 |
-
// js/v8/
|
15792 |
/**
|
15793 |
* @namespace WPGMZA
|
15794 |
-
* @module
|
15795 |
-
* @requires WPGMZA.
|
15796 |
*/
|
15797 |
jQuery(function($) {
|
15798 |
|
15799 |
-
WPGMZA.
|
15800 |
{
|
15801 |
-
WPGMZA.
|
15802 |
}
|
15803 |
|
15804 |
-
WPGMZA.
|
|
|
15805 |
|
15806 |
-
WPGMZA.
|
15807 |
{
|
15808 |
-
if(WPGMZA.isProVersion())
|
15809 |
-
return new WPGMZA.ProMarkerPanel(element, mapEditPage);
|
15810 |
-
|
15811 |
-
return new WPGMZA.MarkerPanel(element, mapEditPage);
|
15812 |
-
}
|
15813 |
-
|
15814 |
-
WPGMZA.MarkerPanel.prototype.initDefaults = function(){
|
15815 |
var self = this;
|
|
|
|
|
15816 |
|
15817 |
-
|
15818 |
-
|
15819 |
-
this.
|
15820 |
-
|
15821 |
-
this.onTabActivated(null);
|
15822 |
-
|
15823 |
-
$(document.body).on("click", "[data-adjust-" + this.featureType + "-id]", function(event) {
|
15824 |
-
self.onAdjustFeature(event);
|
15825 |
-
});
|
15826 |
-
|
15827 |
-
$(document.body).on("click", ".wpgmza_approve_btn", function(event) {
|
15828 |
-
self.onApproveMarker(event);
|
15829 |
-
});
|
15830 |
-
|
15831 |
-
}
|
15832 |
-
|
15833 |
-
WPGMZA.MarkerPanel.prototype.onAdjustFeature = function(event){
|
15834 |
-
var self = this;
|
15835 |
-
var name = "data-adjust-" + this.featureType + "-id";
|
15836 |
-
var id = $(event.currentTarget).attr(name);
|
15837 |
-
|
15838 |
-
this.discardChanges();
|
15839 |
-
|
15840 |
-
this.adjustSubMode = true;
|
15841 |
-
|
15842 |
-
this.select(id);
|
15843 |
-
}
|
15844 |
-
|
15845 |
-
WPGMZA.MarkerPanel.prototype.onApproveMarker = function(event){
|
15846 |
-
var self = this;
|
15847 |
-
|
15848 |
-
var route = "/" + this.featureType + "s/" + $(event.currentTarget).attr('id');
|
15849 |
-
WPGMZA.restAPI.call(route, {
|
15850 |
-
method: "POST",
|
15851 |
-
data: {
|
15852 |
-
approved : "1"
|
15853 |
-
},
|
15854 |
-
success: function(data, status, xhr) {
|
15855 |
-
self.featureDataTable.reload();
|
15856 |
-
}
|
15857 |
-
});
|
15858 |
-
}
|
15859 |
-
|
15860 |
-
WPGMZA.MarkerPanel.prototype.onFeatureChanged = function(event){
|
15861 |
-
if(this.adjustSubMode){
|
15862 |
-
var aPos = this.feature.getPosition();
|
15863 |
-
|
15864 |
-
if(aPos){
|
15865 |
-
$(this.element).find("[data-ajax-name='lat']").val(aPos.lat);
|
15866 |
-
$(this.element).find("[data-ajax-name='lng']").val(aPos.lng);
|
15867 |
-
}
|
15868 |
-
// Exit early, we don't want to adjust the address
|
15869 |
-
return;
|
15870 |
-
}
|
15871 |
-
|
15872 |
-
var addressField = $(this.element).find("input[data-ajax-name$='address']");
|
15873 |
-
|
15874 |
-
if(!addressField.length)
|
15875 |
-
return;
|
15876 |
|
15877 |
-
|
15878 |
-
addressField.val(pos.lat + ',' + pos.lng);
|
15879 |
-
}
|
15880 |
-
|
15881 |
-
WPGMZA.MarkerPanel.prototype.setTargetFeature = function(feature){
|
15882 |
-
if(WPGMZA.FeaturePanel.prevEditableFeature){
|
15883 |
-
var prev = WPGMZA.FeaturePanel.prevEditableFeature;
|
15884 |
|
15885 |
-
if(
|
15886 |
-
|
15887 |
-
|
15888 |
-
|
15889 |
-
|
15890 |
-
|
15891 |
-
|
15892 |
-
|
15893 |
-
|
15894 |
-
* Temporary solution as it is causing trouble for clients
|
15895 |
-
*
|
15896 |
-
* Date: 2021-01-15
|
15897 |
-
*/
|
15898 |
-
$(this.element).find('[data-ajax-name]').removeAttr('disabled');
|
15899 |
-
$(this.element).find('fieldset').show();
|
15900 |
-
$(this.element).find('.wpgmza-adjust-mode-notice').addClass('wpgmza-hidden');
|
15901 |
-
|
15902 |
-
$(this.element).find('[data-ajax-name="lat"]').attr('type', 'hidden');
|
15903 |
-
$(this.element).find('[data-ajax-name="lng"]').attr('type', 'hidden');
|
15904 |
-
|
15905 |
-
$(this.element).find('.wpgmza-hide-in-adjust-mode').removeClass('wpgmza-hidden');
|
15906 |
-
$(this.element).find('.wpgmza-show-in-adjust-mode').addClass('wpgmza-hidden');
|
15907 |
-
|
15908 |
-
|
15909 |
-
if(feature){
|
15910 |
-
if(feature.setOpacity){
|
15911 |
-
feature.setOpacity(0.7);
|
15912 |
-
}
|
15913 |
-
|
15914 |
-
feature.getMap().panTo(feature.getPosition());
|
15915 |
-
|
15916 |
-
if(this.adjustSubMode){
|
15917 |
-
$(this.element).find('[data-ajax-name]').attr('disabled', 'disabled');
|
15918 |
-
$(this.element).find('fieldset:not(.wpgmza-always-on)').hide();
|
15919 |
-
$(this.element).find('.wpgmza-adjust-mode-notice').removeClass('wpgmza-hidden');
|
15920 |
-
|
15921 |
-
$(this.element).find('[data-ajax-name="lat"]').attr('type', 'text').removeAttr('disabled');
|
15922 |
-
$(this.element).find('[data-ajax-name="lng"]').attr('type', 'text').removeAttr('disabled');
|
15923 |
-
|
15924 |
-
$(this.element).find('.wpgmza-hide-in-adjust-mode').addClass('wpgmza-hidden');
|
15925 |
-
$(this.element).find('.wpgmza-show-in-adjust-mode').removeClass('wpgmza-hidden');
|
15926 |
}
|
15927 |
-
|
15928 |
-
|
15929 |
-
}
|
15930 |
-
|
15931 |
-
WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this, arguments);
|
15932 |
-
}
|
15933 |
-
|
15934 |
-
WPGMZA.MarkerPanel.prototype.onSave = function(event)
|
15935 |
-
{
|
15936 |
-
var self = this;
|
15937 |
-
var geocoder = WPGMZA.Geocoder.createInstance();
|
15938 |
-
var address = $(this.element).find("[data-ajax-name='address']").val();
|
15939 |
-
|
15940 |
-
var geocodingData = {
|
15941 |
-
address: address
|
15942 |
-
}
|
15943 |
-
|
15944 |
-
|
15945 |
-
WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE);
|
15946 |
-
this.showPreloader(true);
|
15947 |
|
15948 |
-
|
15949 |
-
var cloud_lat = false;
|
15950 |
-
var cloud_lng = false;
|
15951 |
-
|
15952 |
-
// is the lat and lng set from the WPGM Cloud Search?
|
15953 |
-
if (document.getElementsByName("lat").length > 0) { cloud_lat = document.getElementsByName("lat")[0].value; }
|
15954 |
-
if (document.getElementsByName("lng").length > 0) { cloud_lng = document.getElementsByName("lng")[0].value; }
|
15955 |
-
|
15956 |
-
if (cloud_lat && cloud_lng) {
|
15957 |
-
if(!WPGMZA_localized_data.settings.googleMapsApiKey || WPGMZA_localized_data.settings.googleMapsApiKey === ''){
|
15958 |
-
//Let's only do this if it's not their own key, this causes issues with repositioning a marker
|
15959 |
-
geocodingData.lat = parseFloat(cloud_lat);
|
15960 |
-
geocodingData.lng = parseFloat(cloud_lng);
|
15961 |
-
}
|
15962 |
-
}
|
15963 |
-
|
15964 |
-
if(this.adjustSubMode){
|
15965 |
-
// Trust the force!
|
15966 |
-
WPGMZA.FeaturePanel.prototype.onSave.apply(self, arguments);
|
15967 |
-
} else {
|
15968 |
-
geocoder.geocode(geocodingData, function(results, status) {
|
15969 |
-
|
15970 |
-
switch(status)
|
15971 |
-
{
|
15972 |
-
case WPGMZA.Geocoder.ZERO_RESULTS:
|
15973 |
-
alert(WPGMZA.localized_strings.zero_results);
|
15974 |
-
self.showPreloader(false);
|
15975 |
-
return;
|
15976 |
-
break;
|
15977 |
-
|
15978 |
-
case WPGMZA.Geocoder.SUCCESS:
|
15979 |
-
break;
|
15980 |
-
|
15981 |
-
case WPGMZA.Geocoder.NO_ADDRESS:
|
15982 |
-
alert(WPGMZA.localized_strings.no_address);
|
15983 |
-
self.showPreloader(false);
|
15984 |
-
return;
|
15985 |
-
break;
|
15986 |
-
|
15987 |
-
|
15988 |
-
case WPGMZA.Geocoder.FAIL:
|
15989 |
-
default:
|
15990 |
-
alert(WPGMZA.localized_strings.geocode_fail);
|
15991 |
-
self.showPreloader(false);
|
15992 |
-
return;
|
15993 |
-
break;
|
15994 |
-
}
|
15995 |
-
|
15996 |
-
var result = results[0];
|
15997 |
-
|
15998 |
-
$(self.element).find("[data-ajax-name='lat']").val(result.lat);
|
15999 |
-
$(self.element).find("[data-ajax-name='lng']").val(result.lng);
|
16000 |
-
WPGMZA.FeaturePanel.prototype.onSave.apply(self, arguments);
|
16001 |
-
|
16002 |
-
});
|
16003 |
-
}
|
16004 |
-
|
16005 |
-
WPGMZA.mapEditPage.map.resetBounds();
|
16006 |
}
|
16007 |
|
16008 |
-
|
16009 |
-
|
16010 |
-
// js/v8/map-edit-page/circle-panel.js
|
16011 |
-
/**
|
16012 |
-
* @namespace WPGMZA
|
16013 |
-
* @module CirclePanel
|
16014 |
-
* @requires WPGMZA.FeaturePanel
|
16015 |
-
*/
|
16016 |
-
jQuery(function($) {
|
16017 |
-
|
16018 |
-
WPGMZA.CirclePanel = function(element, mapEditPage)
|
16019 |
{
|
16020 |
-
|
16021 |
}
|
16022 |
|
16023 |
-
WPGMZA.
|
|
|
|
|
|
|
|
|
|
|
|
|
16024 |
|
16025 |
-
WPGMZA.
|
16026 |
{
|
16027 |
-
|
16028 |
-
return new WPGMZA.ProCirclePanel(element, mapEditPage);
|
16029 |
|
16030 |
-
return
|
16031 |
}
|
16032 |
-
|
16033 |
-
WPGMZA.
|
16034 |
{
|
16035 |
-
|
16036 |
-
|
|
|
|
|
16037 |
}
|
16038 |
|
16039 |
-
WPGMZA.
|
16040 |
{
|
16041 |
-
WPGMZA.
|
|
|
16042 |
|
16043 |
-
|
16044 |
-
|
16045 |
-
|
16046 |
-
|
16047 |
-
|
|
|
16048 |
|
16049 |
-
if(
|
16050 |
-
|
|
|
|
|
|
|
16051 |
}
|
|
|
|
|
16052 |
}
|
16053 |
|
16054 |
-
WPGMZA.
|
16055 |
{
|
16056 |
-
|
16057 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16058 |
}
|
16059 |
|
16060 |
});
|
16061 |
|
16062 |
-
// js/v8/
|
16063 |
/**
|
16064 |
* @namespace WPGMZA
|
16065 |
-
* @module
|
16066 |
-
* @requires WPGMZA.
|
16067 |
*/
|
16068 |
-
|
16069 |
-
var wpgmza_autoCompleteDisabled = false;
|
16070 |
-
|
16071 |
jQuery(function($) {
|
16072 |
|
16073 |
-
|
16074 |
-
return;
|
16075 |
-
|
16076 |
-
WPGMZA.MapEditPage = function()
|
16077 |
{
|
16078 |
-
var
|
16079 |
-
var element = document.body;
|
16080 |
-
|
16081 |
-
WPGMZA.EventDispatcher.call(this);
|
16082 |
|
16083 |
-
|
16084 |
|
16085 |
-
|
16086 |
-
|
|
|
|
|
16087 |
|
16088 |
-
this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16089 |
|
16090 |
-
|
16091 |
-
if(!WPGMZA.pro_version || WPGMZA.Version.compare(WPGMZA.pro_version, '8.1.0') >= WPGMZA.Version.EQUAL_TO)
|
16092 |
-
this.drawingManager = WPGMZA.DrawingManager.createInstance(this.map);
|
16093 |
|
16094 |
-
|
16095 |
-
|
16096 |
-
|
16097 |
-
this.initJQueryUIControls();
|
16098 |
-
|
16099 |
-
if(WPGMZA.locale !== 'en'){
|
16100 |
-
$('#datatable_no_result_message,#datatable_search_string').parent().parent().hide();
|
16101 |
}
|
16102 |
-
|
16103 |
-
|
16104 |
-
|
16105 |
-
el.addressInput = WPGMZA.AddressInput.createInstance(el, self.map);
|
16106 |
-
});
|
16107 |
-
|
16108 |
-
$('#wpgmza-map-edit-page input[type="color"]').each(function(){
|
16109 |
-
$("<div class='button-secondary wpgmza-paste-color-btn' title='Paste a HEX color code'><i class='fa fa-clipboard' aria-hidden='true'></i></div>").insertAfter(this);
|
16110 |
-
});
|
16111 |
-
|
16112 |
-
|
16113 |
-
jQuery('body').on('click','.wpgmza_ac_result', function(e) {
|
16114 |
-
var index = jQuery(this).data('id');
|
16115 |
-
var lat = jQuery(this).data('lat');
|
16116 |
-
var lng = jQuery(this).data('lng');
|
16117 |
-
var name = jQuery('#wpgmza_item_address_'+index).html();
|
16118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16119 |
|
16120 |
-
|
16121 |
-
|
16122 |
-
|
16123 |
-
|
|
|
|
|
|
|
|
|
|
|
16124 |
});
|
16125 |
-
|
16126 |
-
|
16127 |
-
|
16128 |
-
|
16129 |
-
if(!navigator || !navigator.clipboard || !navigator.clipboard.readText){
|
16130 |
-
return;
|
16131 |
-
}
|
16132 |
-
|
16133 |
-
navigator.clipboard.readText()
|
16134 |
-
.then(function(textcopy) {
|
16135 |
-
colorBtn.parent().find('input[type="color"]').val("#" + textcopy.replace("#","").trim());
|
16136 |
-
})
|
16137 |
-
.catch(function(err) {
|
16138 |
-
console.error("WP Google Maps: Could not access clipboard", err);
|
16139 |
-
});
|
16140 |
-
|
16141 |
-
} catch(c_ex){
|
16142 |
-
|
16143 |
-
}
|
16144 |
});
|
16145 |
-
|
16146 |
-
|
16147 |
-
|
16148 |
-
|
16149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16150 |
|
16151 |
-
|
16152 |
-
|
16153 |
-
|
16154 |
-
var wpgmzaAjaxTimeout = false;
|
16155 |
-
|
16156 |
-
var wpgmzaStartTyping = false;
|
16157 |
-
var wpgmzaKeyStrokeCount = 1;
|
16158 |
-
var wpgmzaAvgTimeBetweenStrokes = 300; //300 ms by default (equates to 40wpm which is the average typing speed of a person)
|
16159 |
-
var wpgmzaTotalTimeForKeyStrokes = 0;
|
16160 |
-
var wpgmzaTmp = '';
|
16161 |
-
var wpgmzaIdentifiedTypingSpeed = false;
|
16162 |
-
|
16163 |
-
$('body').on('keypress', '.wpgmza-address', function(e) {
|
16164 |
-
|
16165 |
-
if (this.id == 'wpgmza_add_address_map_editor') {
|
16166 |
-
if (wpgmza_autoCompleteDisabled) { return; }
|
16167 |
-
|
16168 |
-
|
16169 |
-
|
16170 |
-
// if user is using their own API key then use the normal Google AutoComplete
|
16171 |
-
var wpgmza_apikey = false;
|
16172 |
-
if (WPGMZA_localized_data.settings.googleMapsApiKey && WPGMZA_localized_data.settings.googleMapsApiKey !== '') {
|
16173 |
-
wpgmza_apikey = WPGMZA_localized_data.settings.googleMapsApiKey;
|
16174 |
-
return;
|
16175 |
-
} else {
|
16176 |
|
16177 |
-
|
16178 |
-
|
16179 |
-
|
16180 |
-
|
16181 |
-
|
16182 |
-
if (!wpgmzaIdentifiedTypingSpeed) {
|
16183 |
-
//determine duration between key strokes to determine when we should send the request to the autocomplete server
|
16184 |
-
//doing this avoids sending API calls for slow typers.
|
16185 |
-
var d = new Date();
|
16186 |
-
|
16187 |
-
|
16188 |
-
// set a timer to reset the delay counter
|
16189 |
-
clearTimeout(wpgmzaTmp);
|
16190 |
-
wpgmzaTmp = setTimeout(function(){
|
16191 |
-
wpgmzaStartTyping = false;
|
16192 |
-
wpgmzaAvgTimeBetweenStrokes = 300;
|
16193 |
-
wpgmzaTotalTimeForKeyStrokes = 0;
|
16194 |
-
},1500
|
16195 |
-
); // I'm pretty sure no one types one key stroke per 1.5 seconds. This should be safe.
|
16196 |
-
if (!wpgmzaStartTyping) {
|
16197 |
-
// first character press, set start time.
|
16198 |
-
|
16199 |
-
wpgmzaStartTyping = d.getTime();
|
16200 |
-
wpgmzaKeyStrokeCount++;
|
16201 |
-
} else {
|
16202 |
-
if (wpgmzaKeyStrokeCount == 1) {
|
16203 |
-
// do nothing because its the first key stroke
|
16204 |
-
} else {
|
16205 |
-
|
16206 |
-
|
16207 |
-
wpgmzaCurrentTimeBetweenStrokes = d.getTime() - wpgmzaStartTyping;
|
16208 |
-
wpgmzaTotalTimeForKeyStrokes = wpgmzaTotalTimeForKeyStrokes + wpgmzaCurrentTimeBetweenStrokes;
|
16209 |
-
|
16210 |
-
wpgmzaAvgTimeBetweenStrokes = (wpgmzaTotalTimeForKeyStrokes / (wpgmzaKeyStrokeCount-1)); // we cannot count the first key as that was the starting point
|
16211 |
-
wpgmzaStartTyping = d.getTime();
|
16212 |
-
|
16213 |
-
if (wpgmzaKeyStrokeCount >= 3) {
|
16214 |
-
// we only need 3 keys to know how fast they type
|
16215 |
-
wpgmzaIdentifiedTypingSpeed = (wpgmzaAvgTimeBetweenStrokes);
|
16216 |
-
|
16217 |
-
|
16218 |
-
}
|
16219 |
-
}
|
16220 |
-
wpgmzaKeyStrokeCount++;
|
16221 |
-
|
16222 |
-
|
16223 |
-
|
16224 |
-
}
|
16225 |
-
return;
|
16226 |
-
}
|
16227 |
-
|
16228 |
-
|
16229 |
-
// clear the previous timer
|
16230 |
-
clearTimeout(wpgmzaAjaxTimeout);
|
16231 |
-
|
16232 |
-
$('#wpgmza_autocomplete_search_results').html('Searching...');
|
16233 |
-
$('#wpgmza_autocomplete_search_results').show();
|
16234 |
-
|
16235 |
|
16236 |
-
|
16237 |
-
|
16238 |
-
|
16239 |
-
|
16240 |
-
|
16241 |
-
|
16242 |
-
|
16243 |
-
}
|
16244 |
-
var wpgmza_api_url = '';
|
16245 |
-
if (!wpgmza_apikey) {
|
16246 |
-
wpgmza_api_url = "https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+window.location.hostname+"&hash="+WPGMZA_localized_data.siteHash
|
16247 |
-
} else {
|
16248 |
-
wpgmza_api_url = "https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+window.location.hostname+"&hash="+WPGMZA_localized_data.siteHash+"&k="+wpgmza_apikey
|
16249 |
-
}
|
16250 |
-
|
16251 |
-
// set a timer of how fast the person types in seconds to only continue with this if it runs out
|
16252 |
-
wpgmzaAjaxTimeout = setTimeout(function() {
|
16253 |
-
ajaxRequest = $.ajax({
|
16254 |
-
url: wpgmza_api_url,
|
16255 |
-
type: 'GET',
|
16256 |
-
dataType: 'json', // added data type
|
16257 |
-
success: function(results) {
|
16258 |
-
|
16259 |
-
try {
|
16260 |
-
|
16261 |
-
if (typeof results.error !== 'undefined') {
|
16262 |
-
if (results.error == 'error1') {
|
16263 |
-
$('#wpgmza_autoc_disabled').html(WPGMZA.localized_strings.cloud_api_key_error_1);
|
16264 |
-
$('#wpgmza_autoc_disabled').fadeIn('slow');
|
16265 |
-
$('#wpgmza_autocomplete_search_results').hide();
|
16266 |
-
wpgmza_autoCompleteDisabled = true;
|
16267 |
-
} else {
|
16268 |
-
console.error(results.error);
|
16269 |
-
}
|
16270 |
-
|
16271 |
-
} else {
|
16272 |
-
$('#wpgmza_autocomplete_search_results').html('');
|
16273 |
-
var html = "";
|
16274 |
-
for(var i in results){ html += "<div class='wpgmza_ac_result " + (html === "" ? "" : "border-top") + "' data-id='" + i + "' data-lat='"+results[i]['lat']+"' data-lng='"+results[i]['lng']+"'><div class='wpgmza_ac_container'><div class='wpgmza_ac_icon'><img src='"+results[i]['icon']+"' /></div><div class='wpgmza_ac_item'><span id='wpgmza_item_name_"+i+"' class='wpgmza_item_name'>" + results[i]['place_name'] + "</span><span id='wpgmza_item_address_"+i+"' class='wpgmza_item_address'>" + results[i]['formatted_address'] + "</span></div></div></div>"; }
|
16275 |
-
if(html == ""){ html = "<div class='p-2 text-center'><small>No results found...</small></div>"; }
|
16276 |
-
$('#wpgmza_autocomplete_search_results').html(html);
|
16277 |
-
$('#wpgmza_autocomplete_search_results').show();
|
16278 |
-
|
16279 |
-
}
|
16280 |
-
} catch (exception) {
|
16281 |
-
console.error("WP Google Maps Plugin: There was an error returning the list of places for your search");
|
16282 |
-
}
|
16283 |
-
|
16284 |
-
|
16285 |
-
|
16286 |
-
}
|
16287 |
-
});
|
16288 |
-
},(wpgmzaIdentifiedTypingSpeed*2));
|
16289 |
-
|
16290 |
-
|
16291 |
-
|
16292 |
-
|
16293 |
-
} else {
|
16294 |
-
$('#wpgmza_autocomplete_search_results').hide();
|
16295 |
-
}
|
16296 |
}
|
16297 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16298 |
});
|
16299 |
-
|
16300 |
-
|
16301 |
-
|
16302 |
-
|
16303 |
-
self.onMapHeightTypeChange(event);
|
16304 |
});
|
16305 |
|
16306 |
-
|
16307 |
-
|
|
|
|
|
|
|
16308 |
|
16309 |
-
|
16310 |
-
|
|
|
|
|
|
|
|
|
|
|
16311 |
|
16312 |
-
|
16313 |
-
|
16314 |
-
|
16315 |
-
|
|
|
|
|
|
|
|
|
|
|
16316 |
|
16317 |
-
|
16318 |
-
|
16319 |
-
|
16320 |
-
|
16321 |
-
|
16322 |
-
|
16323 |
-
|
16324 |
-
|
16325 |
-
|
16326 |
-
|
16327 |
-
|
16328 |
-
|
16329 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16330 |
|
16331 |
-
|
16332 |
-
|
16333 |
-
|
16334 |
-
|
16335 |
-
// NB: Older version of Pro (< 7.0.0 - pre-WPGMZA.Map) will have this.map as undefined. Only run this code if we have a WPGMZA.Map to work with.
|
16336 |
-
if(this.map)
|
16337 |
{
|
16338 |
-
this.
|
16339 |
-
|
16340 |
-
|
|
|
|
|
16341 |
|
16342 |
-
|
16343 |
-
|
16344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16345 |
|
16346 |
-
this.
|
16347 |
-
|
16348 |
});
|
16349 |
}
|
16350 |
|
16351 |
-
|
16352 |
-
|
16353 |
-
|
16354 |
-
|
16355 |
-
|
16356 |
-
self.onDeletePolyline(event);
|
16357 |
-
});
|
16358 |
-
|
16359 |
-
$(element).on("click", ".wpgmza_dataset_del_btn", function(evevnt) {
|
16360 |
-
self.onDeleteHeatmap(event);
|
16361 |
});
|
16362 |
|
16363 |
-
|
16364 |
-
|
|
|
16365 |
});
|
16366 |
|
16367 |
-
|
16368 |
-
|
16369 |
-
});
|
16370 |
-
|
16371 |
-
$(element).on("click", "#wpgmza-open-advanced-theme-data", function(event){
|
16372 |
-
event.preventDefault();
|
16373 |
-
$('.wpgmza_theme_data_container').toggleClass('wpgmza_hidden');
|
16374 |
-
});
|
16375 |
}
|
16376 |
|
16377 |
-
WPGMZA.extend(WPGMZA.
|
16378 |
|
16379 |
-
|
|
|
16380 |
{
|
16381 |
-
|
16382 |
-
|
|
|
16383 |
|
16384 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16385 |
}
|
16386 |
|
16387 |
-
WPGMZA.
|
16388 |
{
|
16389 |
-
|
16390 |
|
16391 |
-
|
16392 |
-
|
16393 |
-
var featureType = $(el).attr("data-wpgmza-feature-type");
|
16394 |
-
|
16395 |
-
self[featureType + "AdminDataTable"] = new WPGMZA.AdminFeatureDataTable(el);
|
16396 |
-
|
16397 |
-
});
|
16398 |
}
|
16399 |
|
16400 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16401 |
{
|
16402 |
-
var self = this;
|
16403 |
|
16404 |
-
$(".wpgmza-feature-accordion[data-wpgmza-feature-type]").each(function(index, el) {
|
16405 |
-
|
16406 |
-
var featurePanelElement = $(el).find(".wpgmza-feature-panel-container > *");
|
16407 |
-
var featureType = $(el).attr("data-wpgmza-feature-type");
|
16408 |
-
var panelClassName = WPGMZA.capitalizeWords(featureType) + "Panel";
|
16409 |
-
var module = WPGMZA[panelClassName];
|
16410 |
-
var instance = module.createInstance(featurePanelElement, self);
|
16411 |
-
|
16412 |
-
self[featureType + "Panel"] = instance;
|
16413 |
-
|
16414 |
-
});
|
16415 |
}
|
16416 |
|
16417 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16418 |
{
|
16419 |
var self = this;
|
16420 |
-
|
16421 |
-
|
16422 |
-
// Now initialise tabs
|
16423 |
-
$("#wpgmaps_tabs").tabs();
|
16424 |
-
|
16425 |
-
// NB: If the map container has a <ul> then this will break the tabs (this happens in OpenLayers). Temporarily detach the map to avoid this.
|
16426 |
-
mapContainer = $("#wpgmza-map-container").detach();
|
16427 |
-
|
16428 |
-
$("#wpgmaps_tabs_markers").tabs();
|
16429 |
|
16430 |
-
|
16431 |
-
$(".map_wrapper").prepend(mapContainer);
|
16432 |
|
16433 |
-
|
16434 |
-
|
16435 |
-
range: "max",
|
16436 |
-
min: 1,
|
16437 |
-
max: 21,
|
16438 |
-
value: $("input[name='map_start_zoom']").val(),
|
16439 |
-
slide: function( event, ui ) {
|
16440 |
-
$("input[name='map_start_zoom']").val(ui.value);
|
16441 |
-
self.map.setZoom(ui.value);
|
16442 |
-
}
|
16443 |
});
|
16444 |
-
}
|
16445 |
-
|
16446 |
-
WPGMZA.MapEditPage.prototype.onShiftClick = function(event)
|
16447 |
-
{
|
16448 |
-
var checkbox = event.currentTarget;
|
16449 |
-
var row = jQuery(checkbox).closest("tr");
|
16450 |
-
|
16451 |
-
if(this.lastSelectedRow && event.shiftKey)
|
16452 |
-
{
|
16453 |
-
var prevIndex = this.lastSelectedRow.index();
|
16454 |
-
var currIndex = row.index();
|
16455 |
-
var startIndex = Math.min(prevIndex, currIndex);
|
16456 |
-
var endIndex = Math.max(prevIndex, currIndex);
|
16457 |
-
var rows = jQuery("[data-wpgmza-admin-marker-datatable] tbody>tr");
|
16458 |
-
|
16459 |
-
// Clear
|
16460 |
-
jQuery("[data-wpgmza-admin-marker-datatable] input[name='mark']").prop("checked", false);
|
16461 |
-
|
16462 |
-
for(var i = startIndex; i <= endIndex; i++)
|
16463 |
-
jQuery(rows[i]).find("input[name='mark']").prop("checked", true);
|
16464 |
-
|
16465 |
-
|
16466 |
|
16467 |
-
|
16468 |
-
|
16469 |
-
this.lastSelectedRow = row;
|
16470 |
-
}
|
16471 |
-
|
16472 |
-
WPGMZA.MapEditPage.prototype.onMapTypeChanged = function(event)
|
16473 |
-
{
|
16474 |
-
if(WPGMZA.settings.engine == "open-layers")
|
16475 |
-
return;
|
16476 |
-
|
16477 |
-
var mapTypeId;
|
16478 |
-
|
16479 |
-
switch(event.target.value)
|
16480 |
-
{
|
16481 |
-
case "2":
|
16482 |
-
mapTypeId = google.maps.MapTypeId.SATELLITE;
|
16483 |
-
break;
|
16484 |
-
|
16485 |
-
case "3":
|
16486 |
-
mapTypeId = google.maps.MapTypeId.HYBRID;
|
16487 |
-
break;
|
16488 |
-
|
16489 |
-
case "4":
|
16490 |
-
mapTypeId = google.maps.MapTypeId.TERRAIN;
|
16491 |
-
break;
|
16492 |
-
|
16493 |
-
default:
|
16494 |
-
mapTypeId = google.maps.MapTypeId.ROADMAP;
|
16495 |
-
break;
|
16496 |
-
}
|
16497 |
-
|
16498 |
-
this.map.setOptions({
|
16499 |
-
mapTypeId: mapTypeId
|
16500 |
});
|
16501 |
-
}
|
16502 |
-
|
16503 |
-
WPGMZA.MapEditPage.prototype.onMarkerUpdated = function(event)
|
16504 |
-
{
|
16505 |
-
this.markerDataTable.reload();
|
16506 |
-
}
|
16507 |
-
|
16508 |
-
WPGMZA.MapEditPage.prototype.onZoomChanged = function(event) {
|
16509 |
-
$(".map_start_zoom").val(this.map.getZoom());
|
16510 |
-
}
|
16511 |
-
|
16512 |
-
WPGMZA.MapEditPage.prototype.onBoundsChanged = function(event)
|
16513 |
-
{
|
16514 |
-
var location = this.map.getCenter();
|
16515 |
|
16516 |
-
|
16517 |
-
$("
|
16518 |
-
|
16519 |
-
|
16520 |
-
|
16521 |
-
|
16522 |
-
$("#wpgmaps_save_reminder").show();
|
16523 |
}
|
16524 |
|
16525 |
-
WPGMZA.
|
16526 |
-
{
|
16527 |
-
if(event.target.value == "%")
|
16528 |
-
$("#wpgmza_height_warning").show();
|
16529 |
-
}
|
16530 |
|
16531 |
-
WPGMZA.
|
16532 |
-
{
|
16533 |
-
var self = this;
|
16534 |
-
var marker;
|
16535 |
-
|
16536 |
-
if(this.drawingManager && this.drawingManager.mode != WPGMZA.DrawingManager.MODE_MARKER)
|
16537 |
-
return; // Do nothing, not in marker mode
|
16538 |
-
|
16539 |
-
if(!this.rightClickMarker)
|
16540 |
-
{
|
16541 |
-
this.rightClickMarker = WPGMZA.Marker.createInstance({
|
16542 |
-
draggable: true
|
16543 |
-
});
|
16544 |
|
16545 |
-
|
16546 |
-
|
16547 |
-
});
|
16548 |
-
|
16549 |
-
this.map.on("click", function(event) {
|
16550 |
-
self.rightClickMarker.setMap(null);
|
16551 |
-
});
|
16552 |
}
|
16553 |
|
16554 |
-
|
|
|
|
|
16555 |
|
16556 |
-
|
16557 |
-
|
|
|
16558 |
|
16559 |
-
|
16560 |
-
}
|
16561 |
|
16562 |
-
WPGMZA.
|
16563 |
{
|
16564 |
-
var
|
16565 |
-
var
|
16566 |
-
action: 'delete_poly',
|
16567 |
-
security: wpgmza_legacy_map_edit_page_vars.ajax_nonce,
|
16568 |
-
map_id: this.map.id,
|
16569 |
-
poly_id: cur_id
|
16570 |
-
};
|
16571 |
|
16572 |
-
|
16573 |
-
|
16574 |
-
|
16575 |
-
|
16576 |
-
|
16577 |
-
|
16578 |
-
|
16579 |
-
});
|
16580 |
}
|
16581 |
|
16582 |
-
WPGMZA.
|
16583 |
{
|
16584 |
-
var
|
16585 |
-
var
|
16586 |
-
|
16587 |
-
|
16588 |
-
map_id: this.map.id,
|
16589 |
-
poly_id: cur_id
|
16590 |
-
};
|
16591 |
|
16592 |
-
|
16593 |
-
|
16594 |
-
|
16595 |
-
|
16596 |
-
|
16597 |
-
|
|
|
16598 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16599 |
});
|
16600 |
}
|
16601 |
|
16602 |
-
|
|
|
16603 |
{
|
16604 |
-
var
|
16605 |
-
|
16606 |
-
|
16607 |
-
|
16608 |
-
|
16609 |
-
|
16610 |
-
}
|
|
|
|
|
|
|
|
|
|
|
16611 |
|
16612 |
-
|
16613 |
-
|
16614 |
-
|
16615 |
-
|
16616 |
-
|
16617 |
|
16618 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16619 |
}
|
16620 |
|
16621 |
-
|
16622 |
-
|
16623 |
-
|
16624 |
-
|
16625 |
-
|
16626 |
-
|
16627 |
-
|
16628 |
-
|
16629 |
-
|
16630 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16631 |
|
16632 |
-
|
16633 |
-
|
16634 |
-
|
16635 |
-
|
16636 |
-
circle_array.forEach(function (circle) {
|
16637 |
|
16638 |
-
|
16639 |
-
|
16640 |
-
|
16641 |
-
}
|
16642 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16643 |
});
|
16644 |
|
16645 |
-
});
|
16646 |
-
|
16647 |
-
|
16648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16649 |
{
|
16650 |
-
var
|
|
|
16651 |
|
16652 |
-
|
16653 |
-
|
16654 |
-
|
16655 |
-
|
16656 |
-
|
16657 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16658 |
|
16659 |
-
|
16660 |
-
|
16661 |
-
|
16662 |
-
|
16663 |
-
|
|
|
16664 |
|
16665 |
-
|
16666 |
-
|
16667 |
-
|
|
|
|
|
|
|
|
|
|
|
16668 |
}
|
|
|
|
|
|
|
16669 |
|
16670 |
-
|
16671 |
|
16672 |
-
|
16673 |
-
|
16674 |
-
|
16675 |
-
|
16676 |
-
|
16677 |
-
|
16678 |
-
|
16679 |
-
});
|
16680 |
-
|
16681 |
-
});
|
16682 |
|
16683 |
-
|
|
|
16684 |
/**
|
16685 |
* @namespace WPGMZA
|
16686 |
-
* @module
|
16687 |
-
* @requires WPGMZA.
|
16688 |
*/
|
16689 |
jQuery(function($) {
|
16690 |
|
16691 |
-
WPGMZA.
|
16692 |
{
|
16693 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16694 |
}
|
16695 |
|
16696 |
-
WPGMZA.
|
|
|
16697 |
|
16698 |
-
WPGMZA.
|
16699 |
{
|
16700 |
-
|
16701 |
-
return new WPGMZA.ProPolygonPanel(element, mapEditPage);
|
16702 |
-
|
16703 |
-
return new WPGMZA.PolygonPanel(element, mapEditPage);
|
16704 |
}
|
16705 |
|
16706 |
-
|
|
|
|
|
|
|
16707 |
|
16708 |
-
|
16709 |
-
|
|
|
|
|
16710 |
}
|
16711 |
|
16712 |
-
|
16713 |
-
|
16714 |
-
});
|
16715 |
-
|
16716 |
-
// js/v8/map-edit-page/polyline-panel.js
|
16717 |
-
/**
|
16718 |
-
* @namespace WPGMZA
|
16719 |
-
* @module PolylinePanel
|
16720 |
-
* @requires WPGMZA.FeaturePanel
|
16721 |
-
*/
|
16722 |
-
jQuery(function($) {
|
16723 |
|
16724 |
-
WPGMZA.
|
16725 |
{
|
16726 |
-
WPGMZA.
|
16727 |
}
|
16728 |
|
16729 |
-
WPGMZA.
|
16730 |
-
|
16731 |
-
WPGMZA.PolylinePanel.createInstance = function(element, mapEditPage)
|
16732 |
{
|
16733 |
-
|
16734 |
-
|
16735 |
|
16736 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16737 |
}
|
16738 |
|
16739 |
-
|
16740 |
-
|
16741 |
-
// js/v8/map-edit-page/rectangle-panel.js
|
16742 |
-
/**
|
16743 |
-
* @namespace WPGMZA
|
16744 |
-
* @module RectanglePanel
|
16745 |
-
* @requires WPGMZA.FeaturePanel
|
16746 |
-
*/
|
16747 |
-
jQuery(function($) {
|
16748 |
-
|
16749 |
-
WPGMZA.RectanglePanel = function(element, mapEditPage)
|
16750 |
{
|
16751 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16752 |
}
|
16753 |
|
16754 |
-
WPGMZA.
|
16755 |
-
|
16756 |
-
WPGMZA.RectanglePanel.createInstance = function(element, mapEditPage)
|
16757 |
{
|
16758 |
-
|
16759 |
-
return new WPGMZA.ProRectanglePanel(element, mapEditPage);
|
16760 |
-
|
16761 |
-
return new WPGMZA.RectanglePanel(element, mapEditPage);
|
16762 |
}
|
16763 |
|
16764 |
-
WPGMZA.
|
16765 |
{
|
16766 |
-
var
|
16767 |
-
|
16768 |
-
|
16769 |
-
|
16770 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16771 |
}
|
16772 |
|
16773 |
-
WPGMZA.
|
16774 |
-
|
|
|
16775 |
|
16776 |
-
if
|
16777 |
-
|
|
|
|
|
16778 |
}
|
16779 |
-
|
16780 |
-
|
16781 |
-
|
16782 |
-
|
16783 |
-
WPGMZA.
|
16784 |
|
16785 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16786 |
}
|
16787 |
|
16788 |
-
|
16789 |
-
|
16790 |
-
|
16791 |
-
|
16792 |
-
|
|
|
|
|
16793 |
|
16794 |
});
|
2686 |
});
|
2687 |
|
2688 |
// js/v8/info-window.js
|
2689 |
+
/**
|
2690 |
+
* @namespace WPGMZA
|
2691 |
+
* @module InfoWindow
|
2692 |
+
* @requires WPGMZA.EventDispatcher
|
2693 |
+
*/
|
2694 |
+
jQuery(function($) {
|
2695 |
+
|
2696 |
+
/**
|
2697 |
+
* Base class for infoWindows. This acts as an abstract class so that infoWindows for both Google and OpenLayers can be interacted with seamlessly by the overlying logic. <strong>Please <em>do not</em> call this constructor directly. Always use createInstance rather than instantiating this class directly.</strong> Using createInstance allows this class to be externally extensible.
|
2698 |
+
* @class WPGMZA.InfoWindow
|
2699 |
+
* @constructor WPGMZA.InfoWindow
|
2700 |
+
* @memberof WPGMZA
|
2701 |
+
* @see WPGMZA.InfoWindow.createInstance
|
2702 |
+
*/
|
2703 |
+
WPGMZA.InfoWindow = function(feature) {
|
2704 |
+
var self = this;
|
2705 |
+
|
2706 |
+
|
2707 |
+
|
2708 |
+
WPGMZA.EventDispatcher.call(this);
|
2709 |
+
|
2710 |
+
WPGMZA.assertInstanceOf(this, "InfoWindow");
|
2711 |
+
|
2712 |
+
this.on("infowindowopen", function(event) {
|
2713 |
+
self.onOpen(event);
|
2714 |
+
});
|
2715 |
+
|
2716 |
+
if(!feature)
|
2717 |
+
return;
|
2718 |
+
|
2719 |
+
this.feature = feature;
|
2720 |
+
this.state = WPGMZA.InfoWindow.STATE_CLOSED;
|
2721 |
+
|
2722 |
+
if(feature.map)
|
2723 |
+
{
|
2724 |
+
// This has to be slightly delayed so the map initialization won't overwrite the infowindow element
|
2725 |
+
setTimeout(function() {
|
2726 |
+
self.onFeatureAdded(event);
|
2727 |
+
}, 100);
|
2728 |
+
}
|
2729 |
+
else
|
2730 |
+
feature.addEventListener("added", function(event) {
|
2731 |
+
self.onFeatureAdded(event);
|
2732 |
+
});
|
2733 |
+
}
|
2734 |
+
|
2735 |
+
|
2736 |
+
|
2737 |
+
WPGMZA.InfoWindow.prototype = Object.create(WPGMZA.EventDispatcher.prototype);
|
2738 |
+
WPGMZA.InfoWindow.prototype.constructor = WPGMZA.InfoWindow;
|
2739 |
+
|
2740 |
+
WPGMZA.InfoWindow.OPEN_BY_CLICK = 1;
|
2741 |
+
WPGMZA.InfoWindow.OPEN_BY_HOVER = 2;
|
2742 |
+
|
2743 |
+
WPGMZA.InfoWindow.STATE_OPEN = "open";
|
2744 |
+
WPGMZA.InfoWindow.STATE_CLOSED = "closed";
|
2745 |
+
|
2746 |
+
/**
|
2747 |
+
* Fetches the constructor to be used by createInstance, based on the selected maps engine
|
2748 |
+
* @method
|
2749 |
+
* @memberof WPGMZA.InfoWindow
|
2750 |
+
* @return {function} The appropriate constructor
|
2751 |
+
*/
|
2752 |
+
WPGMZA.InfoWindow.getConstructor = function()
|
2753 |
+
{
|
2754 |
+
switch(WPGMZA.settings.engine)
|
2755 |
+
{
|
2756 |
+
case "open-layers":
|
2757 |
+
if(WPGMZA.isProVersion())
|
2758 |
+
return WPGMZA.OLProInfoWindow;
|
2759 |
+
return WPGMZA.OLInfoWindow;
|
2760 |
+
break;
|
2761 |
+
|
2762 |
+
default:
|
2763 |
+
if(WPGMZA.isProVersion())
|
2764 |
+
return WPGMZA.GoogleProInfoWindow;
|
2765 |
+
return WPGMZA.GoogleInfoWindow;
|
2766 |
+
break;
|
2767 |
+
}
|
2768 |
+
}
|
2769 |
+
|
2770 |
+
/**
|
2771 |
+
* Creates an instance of an InfoWindow, <strong>please <em>always</em> use this function rather than calling the constructor directly</strong>
|
2772 |
+
* @method
|
2773 |
+
* @memberof WPGMZA.InfoWindow
|
2774 |
+
* @param {object} options Options for the object (optional)
|
2775 |
+
*/
|
2776 |
+
WPGMZA.InfoWindow.createInstance = function(feature)
|
2777 |
+
{
|
2778 |
+
var constructor = this.getConstructor();
|
2779 |
+
return new constructor(feature);
|
2780 |
+
}
|
2781 |
+
|
2782 |
+
Object.defineProperty(WPGMZA.InfoWindow.prototype, "content", {
|
2783 |
+
|
2784 |
+
"get": function()
|
2785 |
+
{
|
2786 |
+
return this.getContent();
|
2787 |
+
},
|
2788 |
+
|
2789 |
+
"set": function(value)
|
2790 |
+
{
|
2791 |
+
this.contentHtml = value;
|
2792 |
+
}
|
2793 |
+
});
|
2794 |
+
|
2795 |
+
|
2796 |
+
WPGMZA.InfoWindow.prototype.addEditButton = function() {
|
2797 |
+
if (WPGMZA.currentPage == "map-edit") {
|
2798 |
+
if(this.feature instanceof WPGMZA.Marker){
|
2799 |
+
return ' <a title="Edit this marker" style="width:15px;" class="wpgmza_edit_btn" data-edit-marker-id="'+this.feature.id+'"><i class="fa fa-edit"></i></a>';
|
2800 |
+
}
|
2801 |
+
}
|
2802 |
+
return '';
|
2803 |
+
|
2804 |
+
}
|
2805 |
+
|
2806 |
+
WPGMZA.InfoWindow.prototype.workOutDistanceBetweenTwoMarkers = function(location1, location2) {
|
2807 |
+
if(!location1 || !location2)
|
2808 |
+
return; // No location (no search performed, user location unavailable)
|
2809 |
+
|
2810 |
+
var distanceInKM = WPGMZA.Distance.between(location1, location2);
|
2811 |
+
var distanceToDisplay = distanceInKM;
|
2812 |
+
|
2813 |
+
if(this.distanceUnits == WPGMZA.Distance.MILES)
|
2814 |
+
distanceToDisplay /= WPGMZA.Distance.KILOMETERS_PER_MILE;
|
2815 |
+
|
2816 |
+
var text = Math.round(distanceToDisplay, 2);
|
2817 |
+
|
2818 |
+
return text;
|
2819 |
+
}
|
2820 |
+
|
2821 |
+
|
2822 |
+
/**
|
2823 |
+
* Gets the content for the info window and passes it to the specified callback - this allows for delayed loading (eg AJAX) as well as instant content
|
2824 |
+
* @method
|
2825 |
+
* @memberof WPGMZA.InfoWindow
|
2826 |
+
* @return void
|
2827 |
+
*/
|
2828 |
+
WPGMZA.InfoWindow.prototype.getContent = function(callback) {
|
2829 |
+
var html = "";
|
2830 |
+
var extra_html = "";
|
2831 |
+
|
2832 |
+
if (this.feature instanceof WPGMZA.Marker) {
|
2833 |
+
// Store locator distance away
|
2834 |
+
// added by Nick 2020-01-12
|
2835 |
+
if (this.feature.map.settings.store_locator_show_distance && this.feature.map.storeLocator && (this.feature.map.storeLocator.state == WPGMZA.StoreLocator.STATE_APPLIED)) {
|
2836 |
+
var currentLatLng = this.feature.getPosition();
|
2837 |
+
var distance = this.workOutDistanceBetweenTwoMarkers(this.feature.map.storeLocator.center, currentLatLng);
|
2838 |
+
|
2839 |
+
extra_html += "<p>"+(this.feature.map.settings.store_locator_distance == WPGMZA.Distance.KILOMETERS ? distance + WPGMZA.localized_strings.kilometers_away : distance + " " + WPGMZA.localized_strings.miles_away)+"</p>";
|
2840 |
+
}
|
2841 |
+
|
2842 |
+
html = this.feature.address+extra_html;
|
2843 |
+
}
|
2844 |
+
|
2845 |
+
if (this.contentHtml){
|
2846 |
+
html = this.contentHtml;
|
2847 |
+
}
|
2848 |
+
|
2849 |
+
|
2850 |
+
if(callback)
|
2851 |
+
callback(html);
|
2852 |
+
|
2853 |
+
return html;
|
2854 |
+
}
|
2855 |
+
|
2856 |
+
/**
|
2857 |
+
* Opens the info window on the specified map, with the specified map object as the subject.
|
2858 |
+
* @method
|
2859 |
+
* @memberof WPGMZA.InfoWindow
|
2860 |
+
* @param {WPGMZA.Map} map The map to open this InfoWindow on.
|
2861 |
+
* @param {WPGMZA.Feature} feature The map object (eg marker, polygon) to open this InfoWindow on.
|
2862 |
+
* @return boolean FALSE if the info window should not and will not open, TRUE if it will. This can be used by subclasses to establish whether or not the subclassed open should bail or open the window.
|
2863 |
+
*/
|
2864 |
+
WPGMZA.InfoWindow.prototype.open = function(map, feature) {
|
2865 |
+
var self = this;
|
2866 |
+
|
2867 |
+
this.feature = feature;
|
2868 |
+
|
2869 |
+
if(WPGMZA.settings.disable_infowindows || WPGMZA.settings.wpgmza_settings_disable_infowindows == "1")
|
2870 |
+
return false;
|
2871 |
+
|
2872 |
+
if(this.feature.disableInfoWindow)
|
2873 |
+
return false;
|
2874 |
+
|
2875 |
+
this.state = WPGMZA.InfoWindow.STATE_OPEN;
|
2876 |
+
|
2877 |
+
return true;
|
2878 |
+
}
|
2879 |
+
|
2880 |
+
/**
|
2881 |
+
* Abstract function, closes this InfoWindow
|
2882 |
+
* @method
|
2883 |
+
* @memberof WPGMZA.InfoWindow
|
2884 |
+
*/
|
2885 |
+
WPGMZA.InfoWindow.prototype.close = function()
|
2886 |
+
{
|
2887 |
+
if(this.state == WPGMZA.InfoWindow.STATE_CLOSED)
|
2888 |
+
return;
|
2889 |
+
|
2890 |
+
this.state = WPGMZA.InfoWindow.STATE_CLOSED;
|
2891 |
+
this.trigger("infowindowclose");
|
2892 |
+
}
|
2893 |
+
|
2894 |
+
/**
|
2895 |
+
* Abstract function, sets the content in this InfoWindow
|
2896 |
+
* @method
|
2897 |
+
* @memberof WPGMZA.InfoWindow
|
2898 |
+
*/
|
2899 |
+
WPGMZA.InfoWindow.prototype.setContent = function(options)
|
2900 |
+
{
|
2901 |
+
|
2902 |
+
}
|
2903 |
+
|
2904 |
+
/**
|
2905 |
+
* Abstract function, sets options on this InfoWindow
|
2906 |
+
* @method
|
2907 |
+
* @memberof WPGMZA.InfoWindow
|
2908 |
+
*/
|
2909 |
+
WPGMZA.InfoWindow.prototype.setOptions = function(options)
|
2910 |
+
{
|
2911 |
+
|
2912 |
+
}
|
2913 |
+
|
2914 |
+
/**
|
2915 |
+
* Event listener for when the map object is added. This will cause the info window to open if the map object has infoopen set
|
2916 |
+
* @method
|
2917 |
+
* @memberof WPGMZA.InfoWindow
|
2918 |
+
* @return void
|
2919 |
+
*/
|
2920 |
+
WPGMZA.InfoWindow.prototype.onFeatureAdded = function()
|
2921 |
+
{
|
2922 |
+
if(this.feature.settings.infoopen == 1)
|
2923 |
+
this.open();
|
2924 |
+
}
|
2925 |
+
|
2926 |
+
WPGMZA.InfoWindow.prototype.onOpen = function()
|
2927 |
+
{
|
2928 |
+
|
2929 |
+
}
|
2930 |
+
|
2931 |
+
});
|
2932 |
+
|
2933 |
+
// js/v8/latlng.js
|
2934 |
/**
|
2935 |
* @namespace WPGMZA
|
2936 |
+
* @module LatLng
|
2937 |
+
* @requires WPGMZA
|
2938 |
*/
|
2939 |
jQuery(function($) {
|
2940 |
+
|
2941 |
/**
|
2942 |
+
* This class represents a latitude and longitude coordinate pair, and provides utilities to work with coordinates, parsing and conversion.
|
2943 |
+
* @class WPGMZA.LatLng
|
2944 |
+
* @constructor WPGMZA.LatLng
|
2945 |
* @memberof WPGMZA
|
2946 |
+
* @param {number|object} arg A latLng literal, or latitude
|
2947 |
+
* @param {number} [lng] The latitude, where arg is a longitude
|
2948 |
*/
|
2949 |
+
WPGMZA.LatLng = function(arg, lng)
|
2950 |
+
{
|
2951 |
+
this._lat = 0;
|
2952 |
+
this._lng = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2953 |
|
2954 |
+
if(arguments.length == 0)
|
2955 |
return;
|
2956 |
|
2957 |
+
if(arguments.length == 1)
|
|
|
|
|
|
|
2958 |
{
|
2959 |
+
// TODO: Support latlng string
|
2960 |
+
|
2961 |
+
if(typeof arg == "string")
|
2962 |
+
{
|
2963 |
+
var m;
|
2964 |
+
|
2965 |
+
if(!(m = arg.match(WPGMZA.LatLng.REGEXP)))
|
2966 |
+
throw new Error("Invalid LatLng string");
|
2967 |
+
|
2968 |
+
arg = {
|
2969 |
+
lat: m[1],
|
2970 |
+
lng: m[3]
|
2971 |
+
};
|
2972 |
+
}
|
2973 |
+
|
2974 |
+
if(typeof arg != "object" || !("lat" in arg && "lng" in arg))
|
2975 |
+
throw new Error("Argument must be a LatLng literal");
|
2976 |
+
|
2977 |
+
this.lat = arg.lat;
|
2978 |
+
this.lng = arg.lng;
|
2979 |
}
|
2980 |
else
|
2981 |
+
{
|
2982 |
+
this.lat = arg;
|
2983 |
+
this.lng = lng;
|
2984 |
+
}
|
2985 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2986 |
|
2987 |
/**
|
2988 |
+
* A regular expression which matches latitude and longitude coordinate pairs from a string. Matches 1 and 3 correspond to latitude and longitude, respectively,
|
2989 |
+
* @constant {RegExp}
|
2990 |
+
* @memberof WPGMZA.LatLng
|
|
|
2991 |
*/
|
2992 |
+
WPGMZA.LatLng.REGEXP = /^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2993 |
|
2994 |
/**
|
2995 |
+
* Returns true if the supplied object is a LatLng literal, also returns true for instances of WPGMZA.LatLng
|
2996 |
* @method
|
2997 |
+
* @static
|
2998 |
+
* @memberof WPGMZA.LatLng
|
2999 |
+
* @param {object} obj A LatLng literal, or an instance of WPGMZA.LatLng
|
3000 |
+
* @return {bool} True if this object is a valid LatLng literal or instance of WPGMZA.LatLng
|
3001 |
*/
|
3002 |
+
WPGMZA.LatLng.isValid = function(obj)
|
3003 |
{
|
3004 |
+
if(typeof obj != "object")
|
3005 |
+
return false;
|
3006 |
+
|
3007 |
+
if(!("lat" in obj && "lng" in obj))
|
3008 |
+
return false;
|
3009 |
+
|
3010 |
+
return true;
|
3011 |
}
|
3012 |
|
3013 |
+
WPGMZA.LatLng.isLatLngString = function(str)
|
3014 |
+
{
|
3015 |
+
if(typeof str != "string")
|
3016 |
+
return false;
|
3017 |
|
3018 |
+
return str.match(WPGMZA.LatLng.REGEXP) ? true : false;
|
3019 |
+
}
|
3020 |
+
|
3021 |
+
/**
|
3022 |
+
* The latitude, guaranteed to be a number
|
3023 |
+
* @property lat
|
3024 |
+
* @memberof WPGMZA.LatLng
|
3025 |
+
*/
|
3026 |
+
Object.defineProperty(WPGMZA.LatLng.prototype, "lat", {
|
3027 |
+
get: function() {
|
3028 |
+
return this._lat;
|
3029 |
},
|
3030 |
+
set: function(val) {
|
3031 |
+
if(!$.isNumeric(val))
|
3032 |
+
throw new Error("Latitude must be numeric");
|
3033 |
+
this._lat = parseFloat( val );
|
3034 |
}
|
3035 |
});
|
3036 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3037 |
/**
|
3038 |
+
* The longitude, guaranteed to be a number
|
3039 |
+
* @property lng
|
3040 |
+
* @memberof WPGMZA.LatLng
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3041 |
*/
|
3042 |
Object.defineProperty(WPGMZA.LatLng.prototype, "lng", {
|
3043 |
get: function() {
|
3849 |
});
|
3850 |
|
3851 |
// js/v8/map-settings.js
|
3852 |
+
/**
|
3853 |
+
* @namespace WPGMZA
|
3854 |
+
* @module MapSettings
|
3855 |
+
* @requires WPGMZA
|
3856 |
+
*/
|
3857 |
+
jQuery(function($) {
|
3858 |
+
|
3859 |
+
/**
|
3860 |
+
* Handles map settings, parsing them from the data-settings attribute on the maps HTML element.
|
3861 |
+
* NB: This will be split into GoogleMapSettings and OLMapSettings in the future.
|
3862 |
+
* @class WPGMZA.MapSettings
|
3863 |
+
* @constructor WPGMZA.MapSettings
|
3864 |
+
*/
|
3865 |
+
WPGMZA.MapSettings = function(element)
|
3866 |
+
{
|
3867 |
+
var self = this;
|
3868 |
+
var str = element.getAttribute("data-settings");
|
3869 |
+
var json;
|
3870 |
+
|
3871 |
+
try{
|
3872 |
+
json = JSON.parse(str);
|
3873 |
+
}catch(e) {
|
3874 |
+
|
3875 |
+
str = str.replace(/\\%/g, "%");
|
3876 |
+
str = str.replace(/\\\\"/g, '\\"');
|
3877 |
+
|
3878 |
+
try{
|
3879 |
+
json = JSON.parse(str);
|
3880 |
+
}catch(e) {
|
3881 |
+
json = {};
|
3882 |
+
console.warn("Failed to parse map settings JSON");
|
3883 |
+
}
|
3884 |
+
|
3885 |
+
}
|
3886 |
+
|
3887 |
+
WPGMZA.assertInstanceOf(this, "MapSettings");
|
3888 |
+
|
3889 |
+
|
3890 |
+
|
3891 |
+
function addSettings(input) {
|
3892 |
+
if(!input)
|
3893 |
+
return;
|
3894 |
+
|
3895 |
+
for(var key in input) {
|
3896 |
+
if(key == "other_settings")
|
3897 |
+
continue; // Ignore other_settings
|
3898 |
+
|
3899 |
+
var value = input[key];
|
3900 |
+
|
3901 |
+
if(String(value).match(/^-?\d+$/))
|
3902 |
+
value = parseInt(value);
|
3903 |
+
|
3904 |
+
self[key] = value;
|
3905 |
+
}
|
3906 |
+
}
|
3907 |
+
|
3908 |
+
addSettings(WPGMZA.settings);
|
3909 |
+
|
3910 |
+
addSettings(json);
|
3911 |
+
|
3912 |
+
if(json && json.other_settings)
|
3913 |
+
addSettings(json.other_settings);
|
3914 |
+
|
3915 |
+
}
|
3916 |
+
|
3917 |
+
/**
|
3918 |
+
* Returns settings on this object converted to OpenLayers view options
|
3919 |
+
* @method
|
3920 |
+
* @memberof WPGMZA.MapSettings
|
3921 |
+
* @return {object} The map settings, in a format understood by OpenLayers
|
3922 |
+
*/
|
3923 |
+
WPGMZA.MapSettings.prototype.toOLViewOptions = function()
|
3924 |
+
{
|
3925 |
+
var self = this;
|
3926 |
+
var options = {
|
3927 |
+
center: ol.proj.fromLonLat([-119.4179, 36.7783]),
|
3928 |
+
zoom: 4
|
3929 |
+
};
|
3930 |
+
|
3931 |
+
function empty(name)
|
3932 |
+
{
|
3933 |
+
if(typeof self[name] == "object")
|
3934 |
+
return false;
|
3935 |
+
|
3936 |
+
return !self[name] || !self[name].length;
|
3937 |
+
}
|
3938 |
+
|
3939 |
+
// Start location
|
3940 |
+
if(typeof this.start_location == "string")
|
3941 |
+
{
|
3942 |
+
var coords = this.start_location.replace(/^\(|\)$/g, "").split(",");
|
3943 |
+
if(WPGMZA.isLatLngString(this.start_location))
|
3944 |
+
options.center = ol.proj.fromLonLat([
|
3945 |
+
parseFloat(coords[1]),
|
3946 |
+
parseFloat(coords[0])
|
3947 |
+
]);
|
3948 |
+
else
|
3949 |
+
console.warn("Invalid start location");
|
3950 |
+
}
|
3951 |
+
|
3952 |
+
if(this.center)
|
3953 |
+
{
|
3954 |
+
options.center = ol.proj.fromLonLat([
|
3955 |
+
parseFloat(this.center.lng),
|
3956 |
+
parseFloat(this.center.lat)
|
3957 |
+
]);
|
3958 |
+
}
|
3959 |
+
|
3960 |
+
if(!empty("map_start_lat") && !empty("map_start_lng"))
|
3961 |
+
{
|
3962 |
+
options.center = ol.proj.fromLonLat([
|
3963 |
+
parseFloat(this.map_start_lng),
|
3964 |
+
parseFloat(this.map_start_lat)
|
3965 |
+
]);
|
3966 |
+
}
|
3967 |
+
|
3968 |
+
// Start zoom
|
3969 |
+
if(this.zoom){
|
3970 |
+
options.zoom = parseInt(this.zoom);
|
3971 |
+
}
|
3972 |
+
|
3973 |
+
if(this.start_zoom){
|
3974 |
+
options.zoom = parseInt(this.start_zoom);
|
3975 |
+
}
|
3976 |
+
|
3977 |
+
if(this.map_start_zoom){
|
3978 |
+
options.zoom = parseInt(this.map_start_zoom);
|
3979 |
+
}
|
3980 |
+
|
3981 |
+
// Zoom limits
|
3982 |
+
// TODO: This matches the Google code, so some of these could be potentially put on a parent class
|
3983 |
+
if(this.map_min_zoom && this.map_max_zoom)
|
3984 |
+
{
|
3985 |
+
options.minZoom = Math.min(this.map_min_zoom, this.map_max_zoom);
|
3986 |
+
options.maxZoom = Math.max(this.map_min_zoom, this.map_max_zoom);
|
3987 |
+
}
|
3988 |
+
|
3989 |
+
return options;
|
3990 |
+
}
|
3991 |
+
|
3992 |
+
/**
|
3993 |
+
* Returns settings on this object converted to Google's MapOptions spec.
|
3994 |
+
* @method
|
3995 |
+
* @memberof WPGMZA.MapSettings
|
3996 |
+
* @return {object} The map settings, in the format specified by google.maps.MapOptions
|
3997 |
+
*/
|
3998 |
+
WPGMZA.MapSettings.prototype.toGoogleMapsOptions = function()
|
3999 |
+
{
|
4000 |
+
var self = this;
|
4001 |
+
var latLngCoords = (this.start_location && this.start_location.length ? this.start_location.split(",") : [36.7783, -119.4179]);
|
4002 |
+
|
4003 |
+
function empty(name)
|
4004 |
+
{
|
4005 |
+
if(typeof self[name] == "object")
|
4006 |
+
return false;
|
4007 |
+
|
4008 |
+
return !self[name] || !self[name].length;
|
4009 |
+
}
|
4010 |
+
|
4011 |
+
function formatCoord(coord)
|
4012 |
+
{
|
4013 |
+
if($.isNumeric(coord))
|
4014 |
+
return coord;
|
4015 |
+
return parseFloat( String(coord).replace(/[\(\)\s]/, "") );
|
4016 |
+
}
|
4017 |
+
|
4018 |
+
var latLng = new google.maps.LatLng(
|
4019 |
+
formatCoord(latLngCoords[0]),
|
4020 |
+
formatCoord(latLngCoords[1])
|
4021 |
+
);
|
4022 |
+
|
4023 |
+
var zoom = (this.start_zoom ? parseInt(this.start_zoom) : 4);
|
4024 |
+
|
4025 |
+
if(!this.start_zoom && this.zoom){
|
4026 |
+
zoom = parseInt( this.zoom );
|
4027 |
+
}
|
4028 |
+
|
4029 |
+
if(this.map_start_zoom){
|
4030 |
+
zoom = parseInt(this.map_start_zoom);
|
4031 |
+
}
|
4032 |
+
|
4033 |
+
var options = {
|
4034 |
+
zoom: zoom,
|
4035 |
+
center: latLng
|
4036 |
+
};
|
4037 |
+
|
4038 |
+
if(!empty("center"))
|
4039 |
+
options.center = new google.maps.LatLng({
|
4040 |
+
lat: parseFloat(this.center.lat),
|
4041 |
+
lng: parseFloat(this.center.lng)
|
4042 |
+
});
|
4043 |
+
|
4044 |
+
if(!empty("map_start_lat") && !empty("map_start_lng"))
|
4045 |
+
{
|
4046 |
+
// NB: map_start_lat and map_start_lng are the "real" values. Not sure where start_location comes from
|
4047 |
+
options.center = new google.maps.LatLng({
|
4048 |
+
lat: parseFloat(this.map_start_lat),
|
4049 |
+
lng: parseFloat(this.map_start_lng)
|
4050 |
+
});
|
4051 |
+
}
|
4052 |
+
|
4053 |
+
if(this.map_min_zoom && this.map_max_zoom)
|
4054 |
+
{
|
4055 |
+
options.minZoom = Math.min(this.map_min_zoom, this.map_max_zoom);
|
4056 |
+
options.maxZoom = Math.max(this.map_min_zoom, this.map_max_zoom);
|
4057 |
+
}
|
4058 |
+
|
4059 |
+
// NB: Handles legacy checkboxes as well as new, standard controls
|
4060 |
+
function isSettingDisabled(value)
|
4061 |
+
{
|
4062 |
+
if(value === "yes")
|
4063 |
+
return true;
|
4064 |
+
|
4065 |
+
return (value ? true : false);
|
4066 |
+
}
|
4067 |
+
|
4068 |
+
// These settings are all inverted because the checkbox being set means "disabled"
|
4069 |
+
options.zoomControl = !isSettingDisabled(this.wpgmza_settings_map_zoom);
|
4070 |
+
options.panControl = !isSettingDisabled(this.wpgmza_settings_map_pan);
|
4071 |
+
options.mapTypeControl = !isSettingDisabled(this.wpgmza_settings_map_type);
|
4072 |
+
options.streetViewControl = !isSettingDisabled(this.wpgmza_settings_map_streetview);
|
4073 |
+
options.fullscreenControl = !isSettingDisabled(this.wpgmza_settings_map_full_screen_control);
|
4074 |
+
|
4075 |
+
options.draggable = !isSettingDisabled(this.wpgmza_settings_map_draggable);
|
4076 |
+
options.disableDoubleClickZoom = isSettingDisabled(this.wpgmza_settings_map_clickzoom);
|
4077 |
+
|
4078 |
+
if(isSettingDisabled(this.wpgmza_settings_map_tilt_controls)){
|
4079 |
+
options.rotateControl = false;
|
4080 |
+
options.tilt = 0;
|
4081 |
+
}
|
4082 |
+
|
4083 |
+
// NB: This setting is handled differently as setting scrollwheel to true breaks gestureHandling
|
4084 |
+
if(this.wpgmza_settings_map_scroll)
|
4085 |
+
options.scrollwheel = false;
|
4086 |
+
|
4087 |
+
if(this.wpgmza_force_greedy_gestures == "greedy"
|
4088 |
+
|| this.wpgmza_force_greedy_gestures == "yes"
|
4089 |
+
|| this.wpgmza_force_greedy_gestures == true)
|
4090 |
+
{
|
4091 |
+
options.gestureHandling = "greedy";
|
4092 |
+
|
4093 |
+
// Setting this at all will break gesture handling. Make sure we delete it when using greedy gesture handling
|
4094 |
+
if(!this.wpgmza_settings_map_scroll && "scrollwheel" in options)
|
4095 |
+
delete options.scrollwheel;
|
4096 |
+
}
|
4097 |
+
else
|
4098 |
+
options.gestureHandling = "cooperative";
|
4099 |
+
|
4100 |
+
switch(parseInt(this.type))
|
4101 |
+
{
|
4102 |
+
case 2:
|
4103 |
+
options.mapTypeId = google.maps.MapTypeId.SATELLITE;
|
4104 |
+
break;
|
4105 |
+
|
4106 |
+
case 3:
|
4107 |
+
options.mapTypeId = google.maps.MapTypeId.HYBRID;
|
4108 |
+
break;
|
4109 |
+
|
4110 |
+
case 4:
|
4111 |
+
options.mapTypeId = google.maps.MapTypeId.TERRAIN;
|
4112 |
+
break;
|
4113 |
+
|
4114 |
+
default:
|
4115 |
+
options.mapTypeId = google.maps.MapTypeId.ROADMAP;
|
4116 |
+
break;
|
4117 |
+
}
|
4118 |
+
|
4119 |
+
if(this.wpgmza_theme_data && this.wpgmza_theme_data.length)
|
4120 |
+
options.styles = WPGMZA.GoogleMap.parseThemeData(this.wpgmza_theme_data);
|
4121 |
+
|
4122 |
+
return options;
|
4123 |
+
}
|
4124 |
});
|
4125 |
|
4126 |
// js/v8/map.js
|
8153 |
});
|
8154 |
|
8155 |
// js/v8/store-locator.js
|
8156 |
+
/**
|
8157 |
+
* @namespace WPGMZA
|
8158 |
+
* @module StoreLocator
|
8159 |
+
* @requires WPGMZA.EventDispatcher
|
8160 |
+
*/
|
8161 |
+
jQuery(function($) {
|
8162 |
+
|
8163 |
+
WPGMZA.StoreLocator = function(map, element)
|
8164 |
+
{
|
8165 |
+
var self = this;
|
8166 |
+
|
8167 |
+
WPGMZA.EventDispatcher.call(this);
|
8168 |
+
|
8169 |
+
this._center = null;
|
8170 |
+
|
8171 |
+
this.map = map;
|
8172 |
+
this.element = element;
|
8173 |
+
this.state = WPGMZA.StoreLocator.STATE_INITIAL;
|
8174 |
+
|
8175 |
+
this.distanceUnits = this.map.settings.store_locator_distance;
|
8176 |
+
|
8177 |
+
this.addressInput = WPGMZA.AddressInput.createInstance(this.addressElement, this.map);
|
8178 |
+
|
8179 |
+
$(element).find(".wpgmza-not-found-msg").hide();
|
8180 |
+
|
8181 |
+
// Default radius
|
8182 |
+
if(this.radiusElement && this.map.settings.wpgmza_store_locator_default_radius){
|
8183 |
+
if(this.radiusElement.find("option[value='" + this.map.settings.wpgmza_store_locator_default_radius + "']").length > 0){
|
8184 |
+
this.radiusElement.val(this.map.settings.wpgmza_store_locator_default_radius);
|
8185 |
+
}
|
8186 |
+
}
|
8187 |
+
|
8188 |
+
// TODO: This will be moved into this module instead of listening to the map event
|
8189 |
+
this.map.on("storelocatorgeocodecomplete", function(event) {
|
8190 |
+
self.onGeocodeComplete(event);
|
8191 |
+
});
|
8192 |
+
|
8193 |
+
this.map.on("init", function(event) {
|
8194 |
+
|
8195 |
+
self.map.markerFilter.on("filteringcomplete", function(event) {
|
8196 |
+
self.onFilteringComplete(event);
|
8197 |
+
});
|
8198 |
+
|
8199 |
+
// Workaround for improper inheritance. Because ModernStoreLocator was written in v7, before this StoreLocator module, the ModernStoreLocator effectively re-arranges the store locators HTML. At some point, ModernStoreLocator should properly inherit from StoreLocator. For now, we'll just initialise this here to get the right look and feel. This is not ideal but it will work.
|
8200 |
+
if(typeof self.map.settings.store_locator_style === 'undefined' || self.map.settings.store_locator_style == "modern" || WPGMZA.settings.user_interface_style === 'modern'){
|
8201 |
+
if(WPGMZA.settings.user_interface_style === 'default' || WPGMZA.settings.user_interface_style == 'modern' || WPGMZA.settings.user_interface_style == 'legacy'){
|
8202 |
+
self.legacyModernAdapter = WPGMZA.ModernStoreLocator.createInstance(map.id);
|
8203 |
+
}
|
8204 |
+
}
|
8205 |
+
|
8206 |
+
});
|
8207 |
+
|
8208 |
+
// Legacy store locator buttons
|
8209 |
+
$(document.body).on("click", ".wpgmza_sl_search_button_" + map.id + ", [data-map-id='" + map.id + "'] .wpgmza_sl_search_button", function(event) {
|
8210 |
+
self.onSearch(event);
|
8211 |
+
});
|
8212 |
+
|
8213 |
+
$(document.body).on("click", ".wpgmza_sl_reset_button_" + map.id + ", [data-map-id='" + map.id + "'] .wpgmza_sl_reset_button_div", function(event) {
|
8214 |
+
self.onReset(event);
|
8215 |
+
});
|
8216 |
+
|
8217 |
+
// Enter listener
|
8218 |
+
$(this.addressElement).on("keypress", function(event) {
|
8219 |
+
|
8220 |
+
if(event.which == 13)
|
8221 |
+
self.onSearch(event);
|
8222 |
+
|
8223 |
+
});
|
8224 |
+
}
|
8225 |
+
|
8226 |
+
WPGMZA.StoreLocator.prototype = Object.create(WPGMZA.EventDispatcher.prototype);
|
8227 |
+
WPGMZA.StoreLocator.prototype.constructor = WPGMZA.StoreLocator;
|
8228 |
+
|
8229 |
+
WPGMZA.StoreLocator.STATE_INITIAL = "initial";
|
8230 |
+
WPGMZA.StoreLocator.STATE_APPLIED = "applied";
|
8231 |
+
|
8232 |
+
WPGMZA.StoreLocator.createInstance = function(map, element)
|
8233 |
+
{
|
8234 |
+
return new WPGMZA.StoreLocator(map, element);
|
8235 |
+
}
|
8236 |
+
|
8237 |
+
Object.defineProperty(WPGMZA.StoreLocator.prototype, "address", {
|
8238 |
+
"get": function() {
|
8239 |
+
return $(this.addressElement).val();
|
8240 |
+
}
|
8241 |
+
});
|
8242 |
+
|
8243 |
+
Object.defineProperty(WPGMZA.StoreLocator.prototype, "addressElement", {
|
8244 |
+
"get": function() {
|
8245 |
+
|
8246 |
+
if(this.legacyModernAdapter)
|
8247 |
+
return $(this.legacyModernAdapter.element).find("input.wpgmza-address")[0];
|
8248 |
+
|
8249 |
+
return $(this.element).find("input.wpgmza-address")[0];
|
8250 |
+
|
8251 |
+
}
|
8252 |
+
});
|
8253 |
+
|
8254 |
+
Object.defineProperty(WPGMZA.StoreLocator.prototype, "countryRestriction", {
|
8255 |
+
"get": function() {
|
8256 |
+
return this.map.settings.wpgmza_store_locator_restrict;
|
8257 |
+
}
|
8258 |
+
});
|
8259 |
+
|
8260 |
+
Object.defineProperty(WPGMZA.StoreLocator.prototype, "radiusElement", {
|
8261 |
+
"get": function() {
|
8262 |
+
return $("#radiusSelect, #radiusSelect_" + this.map.id);
|
8263 |
+
}
|
8264 |
+
});
|
8265 |
+
|
8266 |
+
Object.defineProperty(WPGMZA.StoreLocator.prototype, "radius", {
|
8267 |
+
"get": function() {
|
8268 |
+
return parseFloat(this.radiusElement.val());
|
8269 |
+
}
|
8270 |
+
});
|
8271 |
+
|
8272 |
+
Object.defineProperty(WPGMZA.StoreLocator.prototype, "center", {
|
8273 |
+
"get": function() {
|
8274 |
+
return this._center;
|
8275 |
+
}
|
8276 |
+
});
|
8277 |
+
|
8278 |
+
Object.defineProperty(WPGMZA.StoreLocator.prototype, "bounds", {
|
8279 |
+
"get": function() {
|
8280 |
+
return this._bounds;
|
8281 |
+
}
|
8282 |
+
});
|
8283 |
+
|
8284 |
+
Object.defineProperty(WPGMZA.StoreLocator.prototype, "marker", {
|
8285 |
+
|
8286 |
+
"get": function() {
|
8287 |
+
|
8288 |
+
|
8289 |
+
|
8290 |
+
if(this.map.settings.store_locator_bounce != 1)
|
8291 |
+
return null;
|
8292 |
+
|
8293 |
+
if(this._marker)
|
8294 |
+
return this._marker;
|
8295 |
+
|
8296 |
+
var options = {
|
8297 |
+
visible: false
|
8298 |
+
};
|
8299 |
+
|
8300 |
+
this._marker = WPGMZA.Marker.createInstance(options);
|
8301 |
+
this._marker.disableInfoWindow = true;
|
8302 |
+
this._marker.isFilterable = false;
|
8303 |
+
|
8304 |
+
this._marker.setAnimation(WPGMZA.Marker.ANIMATION_BOUNCE);
|
8305 |
+
|
8306 |
+
return this._marker;
|
8307 |
+
|
8308 |
+
}
|
8309 |
+
|
8310 |
+
});
|
8311 |
+
|
8312 |
+
Object.defineProperty(WPGMZA.StoreLocator.prototype, "circle", {
|
8313 |
+
|
8314 |
+
"get": function() {
|
8315 |
+
|
8316 |
+
if(this._circle)
|
8317 |
+
return this._circle;
|
8318 |
+
|
8319 |
+
if(this.map.settings.wpgmza_store_locator_radius_style == "modern" && !WPGMZA.isDeviceiOS())
|
8320 |
+
{
|
8321 |
+
this._circle = WPGMZA.ModernStoreLocatorCircle.createInstance(this.map.id);
|
8322 |
+
this._circle.settings.color = this.circleStrokeColor;
|
8323 |
+
}
|
8324 |
+
else
|
8325 |
+
{
|
8326 |
+
this._circle = WPGMZA.Circle.createInstance({
|
8327 |
+
strokeColor: "#ff0000",
|
8328 |
+
strokeOpacity: "0.25",
|
8329 |
+
strokeWeight: 2,
|
8330 |
+
fillColor: "#ff0000",
|
8331 |
+
fillOpacity: "0.15",
|
8332 |
+
visible: false,
|
8333 |
+
clickable: false,
|
8334 |
+
center: new WPGMZA.LatLng()
|
8335 |
+
});
|
8336 |
+
}
|
8337 |
+
|
8338 |
+
return this._circle;
|
8339 |
+
|
8340 |
+
}
|
8341 |
+
|
8342 |
+
});
|
8343 |
+
|
8344 |
+
WPGMZA.StoreLocator.prototype.onGeocodeComplete = function(event)
|
8345 |
+
{
|
8346 |
+
if(!event.results || !event.results.length)
|
8347 |
+
{
|
8348 |
+
this._center = null;
|
8349 |
+
this._bounds = null;
|
8350 |
+
|
8351 |
+
return;
|
8352 |
+
}
|
8353 |
+
else
|
8354 |
+
{
|
8355 |
+
this._center = new WPGMZA.LatLng( event.results[0].latLng );
|
8356 |
+
this._bounds = new WPGMZA.LatLngBounds( event.results[0].bounds );
|
8357 |
+
}
|
8358 |
+
|
8359 |
+
this.map.markerFilter.update({}, this);
|
8360 |
+
}
|
8361 |
+
|
8362 |
+
WPGMZA.StoreLocator.prototype.onSearch = function(event)
|
8363 |
+
{
|
8364 |
+
var self = this;
|
8365 |
+
|
8366 |
+
this.state = WPGMZA.StoreLocator.STATE_APPLIED;
|
8367 |
+
|
8368 |
+
// NB: Moved in from legacy searchLocations
|
8369 |
+
if(!this.address || !this.address.length)
|
8370 |
+
{
|
8371 |
+
this.addressElement.focus();
|
8372 |
+
return false;
|
8373 |
+
}
|
8374 |
+
|
8375 |
+
if((typeof this.map.settings.store_locator_style !== 'undefined' && this.map.settings.store_locator_style !== "modern") && WPGMZA.settings.user_interface_style !== 'modern' && WPGMZA.settings.user_interface_style === 'default'){
|
8376 |
+
WPGMZA.animateScroll(this.map.element);
|
8377 |
+
}
|
8378 |
+
|
8379 |
+
$(this.element).find(".wpgmza-not-found-msg").hide();
|
8380 |
+
|
8381 |
+
function callback(results, status)
|
8382 |
+
{
|
8383 |
+
self.map.trigger({
|
8384 |
+
type: "storelocatorgeocodecomplete",
|
8385 |
+
results: results,
|
8386 |
+
status: status
|
8387 |
+
});
|
8388 |
+
}
|
8389 |
+
|
8390 |
+
if(!WPGMZA.LatLng.isLatLngString(this.address))
|
8391 |
+
{
|
8392 |
+
var geocoder = WPGMZA.Geocoder.createInstance();
|
8393 |
+
var options = {
|
8394 |
+
address: this.address
|
8395 |
+
};
|
8396 |
+
|
8397 |
+
if(this.countryRestriction)
|
8398 |
+
options.country = this.countryRestriction;
|
8399 |
+
|
8400 |
+
geocoder.geocode(options, function(results, status) {
|
8401 |
+
|
8402 |
+
if(status == WPGMZA.Geocoder.SUCCESS)
|
8403 |
+
callback(results, status);
|
8404 |
+
else{
|
8405 |
+
|
8406 |
+
alert(WPGMZA.localized_strings.address_not_found);
|
8407 |
+
}
|
8408 |
+
|
8409 |
+
});
|
8410 |
+
}
|
8411 |
+
else
|
8412 |
+
callback([WPGMZA.LatLng.fromString(this.address)], WPGMZA.Geocoder.SUCCESS);
|
8413 |
+
|
8414 |
+
return true;
|
8415 |
+
}
|
8416 |
+
|
8417 |
+
WPGMZA.StoreLocator.prototype.onReset = function(event)
|
8418 |
+
{
|
8419 |
+
this.state = WPGMZA.StoreLocator.STATE_INITIAL;
|
8420 |
+
|
8421 |
+
this._center = null;
|
8422 |
+
this._bounds = null;
|
8423 |
+
|
8424 |
+
// NB: Moved in from legacy resetLocations
|
8425 |
+
this.map.setZoom(this.map.settings.map_start_zoom);
|
8426 |
+
|
8427 |
+
$(this.element).find(".wpgmza-not-found-msg").hide();
|
8428 |
+
|
8429 |
+
if(this.circle)
|
8430 |
+
this.circle.setVisible(false);
|
8431 |
+
|
8432 |
+
if(this.marker && this.marker.map)
|
8433 |
+
this.map.removeMarker(this.marker);
|
8434 |
+
|
8435 |
+
this.map.markerFilter.update({}, this);
|
8436 |
+
}
|
8437 |
+
|
8438 |
+
WPGMZA.StoreLocator.prototype.getFilteringParameters = function()
|
8439 |
+
{
|
8440 |
+
if(!this.center)
|
8441 |
+
return {};
|
8442 |
+
|
8443 |
+
return {
|
8444 |
+
center: this.center,
|
8445 |
+
radius: this.radius
|
8446 |
+
};
|
8447 |
+
}
|
8448 |
+
|
8449 |
+
WPGMZA.StoreLocator.prototype.getZoomFromRadius = function(radius){
|
8450 |
+
if(this.distanceUnits == WPGMZA.Distance.MILES)
|
8451 |
+
radius *= WPGMZA.Distance.KILOMETERS_PER_MILE;
|
8452 |
+
|
8453 |
+
return Math.round(14 - Math.log(radius) / Math.LN2);
|
8454 |
+
}
|
8455 |
+
|
8456 |
+
WPGMZA.StoreLocator.prototype.onFilteringComplete = function(event)
|
8457 |
+
{
|
8458 |
+
var params = event.filteringParams;
|
8459 |
+
var marker = this.marker;
|
8460 |
+
|
8461 |
+
if(marker)
|
8462 |
+
marker.setVisible(false);
|
8463 |
+
|
8464 |
+
|
8465 |
+
// Center point marker
|
8466 |
+
if(params.center)
|
8467 |
+
{
|
8468 |
+
this.map.setCenter(params.center);
|
8469 |
+
|
8470 |
+
if(marker)
|
8471 |
+
{
|
8472 |
+
marker.setPosition(params.center);
|
8473 |
+
marker.setVisible(true);
|
8474 |
+
|
8475 |
+
if(marker.map != this.map)
|
8476 |
+
this.map.addMarker(marker);
|
8477 |
+
}
|
8478 |
+
}
|
8479 |
+
|
8480 |
+
// Set zoom level
|
8481 |
+
if(params.radius){
|
8482 |
+
this.map.setZoom(this.getZoomFromRadius(params.radius));
|
8483 |
+
}
|
8484 |
+
|
8485 |
+
// Display circle
|
8486 |
+
var circle = this.circle;
|
8487 |
+
|
8488 |
+
if(circle)
|
8489 |
+
{
|
8490 |
+
circle.setVisible(false);
|
8491 |
+
|
8492 |
+
var factor = (this.distanceUnits == WPGMZA.Distance.MILES ? WPGMZA.Distance.KILOMETERS_PER_MILE : 1.0);
|
8493 |
+
|
8494 |
+
if(params.center && params.radius)
|
8495 |
+
{
|
8496 |
+
circle.setRadius(params.radius * factor);
|
8497 |
+
circle.setCenter(params.center);
|
8498 |
+
circle.setVisible(true);
|
8499 |
+
|
8500 |
+
if(!(circle instanceof WPGMZA.ModernStoreLocatorCircle) && circle.map != this.map)
|
8501 |
+
this.map.addCircle(circle);
|
8502 |
+
}
|
8503 |
+
|
8504 |
+
if(circle instanceof WPGMZA.ModernStoreLocatorCircle)
|
8505 |
+
circle.settings.radiusString = this.radius;
|
8506 |
+
}
|
8507 |
+
|
8508 |
+
if(event.filteredMarkers.length == 0 && this.state === WPGMZA.StoreLocator.STATE_APPLIED){
|
8509 |
+
if($(this.element).find('.wpgmza-no-results').length > 0 && WPGMZA.settings.user_interface_style === 'legacy'){
|
8510 |
+
$(this.element).find('.wpgmza-no-results').show();
|
8511 |
+
} else {
|
8512 |
+
alert(this.map.settings.store_locator_not_found_message ? this.map.settings.store_locator_not_found_message : WPGMZA.localized_strings.zero_results);
|
8513 |
+
}
|
8514 |
+
}
|
8515 |
+
}
|
8516 |
+
|
8517 |
+
});
|
8518 |
+
|
8519 |
+
// js/v8/text.js
|
8520 |
+
/**
|
8521 |
+
* @namespace WPGMZA
|
8522 |
+
* @module Text
|
8523 |
+
* @requires WPGMZA
|
8524 |
+
*/
|
8525 |
+
jQuery(function($) {
|
8526 |
|
8527 |
+
WPGMZA.Text = function(options)
|
8528 |
+
{
|
8529 |
+
if(options)
|
8530 |
+
for(var name in options)
|
8531 |
+
this[name] = options[name];
|
8532 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8533 |
|
8534 |
+
WPGMZA.Text.createInstance = function(options)
|
8535 |
{
|
8536 |
+
switch(WPGMZA.settings.engine)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8537 |
{
|
8538 |
+
case "open-layers":
|
8539 |
+
return new WPGMZA.OLText(options);
|
8540 |
+
break;
|
8541 |
+
|
8542 |
+
default:
|
8543 |
+
return new WPGMZA.GoogleText(options);
|
8544 |
+
break;
|
8545 |
}
|
|
|
|
|
8546 |
}
|
8547 |
|
8548 |
+
});
|
8549 |
+
|
8550 |
+
// js/v8/theme-editor.js
|
8551 |
+
/**
|
8552 |
+
* @namespace WPGMZA
|
8553 |
+
* @module ThemeEditor
|
8554 |
+
* @requires WPGMZA.EventDispatcher
|
8555 |
+
*/
|
8556 |
+
jQuery(function($) {
|
8557 |
+
|
8558 |
+
WPGMZA.ThemeEditor = function()
|
8559 |
{
|
8560 |
var self = this;
|
8561 |
|
8562 |
+
WPGMZA.EventDispatcher.call(this);
|
8563 |
+
|
8564 |
+
this.element = $("#wpgmza-theme-editor");
|
8565 |
|
8566 |
+
if(WPGMZA.settings.engine == "open-layers")
|
|
|
8567 |
{
|
8568 |
+
this.element.remove();
|
8569 |
+
return;
|
8570 |
}
|
8571 |
|
8572 |
+
if(!this.element.length)
|
|
|
|
|
|
|
|
|
|
|
|
|
8573 |
{
|
8574 |
+
console.warn("No element to initialise theme editor on");
|
8575 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8576 |
}
|
8577 |
|
8578 |
this.json = [{}];
|
9275 |
|
9276 |
});
|
9277 |
|
9278 |
+
// js/v8/3rd-party-integration/integration.js
|
9279 |
/**
|
9280 |
* @namespace WPGMZA
|
9281 |
+
* @module Integration
|
9282 |
* @requires WPGMZA
|
|
|
9283 |
*/
|
9284 |
jQuery(function($) {
|
9285 |
|
9286 |
+
WPGMZA.Integration = {};
|
9287 |
+
WPGMZA.integrationModules = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9288 |
|
9289 |
});
|
9290 |
|
9291 |
+
// js/v8/3rd-party-integration/gutenberg/dist/gutenberg.js
|
9292 |
+
"use strict";
|
9293 |
+
|
9294 |
/**
|
9295 |
+
* @namespace WPGMZA.Integration
|
9296 |
+
* @module Gutenberg
|
9297 |
+
* @requires WPGMZA.Integration
|
9298 |
+
* @requires wp-i18n
|
9299 |
+
* @requires wp-blocks
|
9300 |
+
* @requires wp-editor
|
9301 |
+
* @requires wp-components
|
9302 |
+
*/
|
9303 |
+
|
9304 |
+
/**
|
9305 |
+
* Internal block libraries
|
9306 |
+
*/
|
9307 |
+
jQuery(function ($) {
|
9308 |
+
|
9309 |
+
if (!window.wp || !wp.i18n || !wp.blocks || !wp.editor || !wp.components) return;
|
9310 |
+
|
9311 |
+
var __ = wp.i18n.__;
|
9312 |
+
var registerBlockType = wp.blocks.registerBlockType;
|
9313 |
+
var _wp$editor = wp.editor,
|
9314 |
+
InspectorControls = _wp$editor.InspectorControls,
|
9315 |
+
BlockControls = _wp$editor.BlockControls;
|
9316 |
+
var _wp$components = wp.components,
|
9317 |
+
Dashicon = _wp$components.Dashicon,
|
9318 |
+
Toolbar = _wp$components.Toolbar,
|
9319 |
+
Button = _wp$components.Button,
|
9320 |
+
Tooltip = _wp$components.Tooltip,
|
9321 |
+
PanelBody = _wp$components.PanelBody,
|
9322 |
+
TextareaControl = _wp$components.TextareaControl,
|
9323 |
+
CheckboxControl = _wp$components.CheckboxControl,
|
9324 |
+
TextControl = _wp$components.TextControl,
|
9325 |
+
SelectControl = _wp$components.SelectControl,
|
9326 |
+
RichText = _wp$components.RichText;
|
9327 |
+
|
9328 |
+
|
9329 |
+
WPGMZA.Integration.Gutenberg = function () {
|
9330 |
+
registerBlockType('gutenberg-wpgmza/block', this.getBlockDefinition());
|
9331 |
+
};
|
9332 |
+
|
9333 |
+
WPGMZA.Integration.Gutenberg.prototype.getBlockTitle = function () {
|
9334 |
+
return __("WP Google Maps");
|
9335 |
+
};
|
9336 |
+
|
9337 |
+
WPGMZA.Integration.Gutenberg.prototype.getBlockInspectorControls = function (props) {
|
9338 |
+
|
9339 |
+
/*
|
9340 |
+
<TextControl
|
9341 |
+
name="overrideWidthAmount"
|
9342 |
+
label={__("Override Width Amount")}
|
9343 |
+
checked={props.overrideWidthAmount}
|
9344 |
+
onChange={onPropertiesChanged}
|
9345 |
+
/>
|
9346 |
+
|
9347 |
+
<SelectControl
|
9348 |
+
name="overrideWidthUnits"
|
9349 |
+
label={__("Override Width Units")}
|
9350 |
+
options={[
|
9351 |
+
{value: "px", label: "px"},
|
9352 |
+
{value: "%", label: "%"},
|
9353 |
+
{value: "vw`", label: "vw"},
|
9354 |
+
{value: "vh", label: "vh"}
|
9355 |
+
]}
|
9356 |
+
onChange={onPropertiesChanged}
|
9357 |
+
/>
|
9358 |
+
|
9359 |
+
<CheckboxControl
|
9360 |
+
name="overrideHeight"
|
9361 |
+
label={__("Override Height")}
|
9362 |
+
checked={props.overrideWidth}
|
9363 |
+
onChange={onPropertiesChanged}
|
9364 |
+
/>
|
9365 |
+
|
9366 |
+
<TextControl
|
9367 |
+
name="overrideHeightAmount"
|
9368 |
+
label={__("Override Height Amount")}
|
9369 |
+
checked={props.overrideWidthAmount}
|
9370 |
+
onChange={onPropertiesChanged}
|
9371 |
+
/>
|
9372 |
+
|
9373 |
+
<SelectControl
|
9374 |
+
name="overrideHeightUnits"
|
9375 |
+
label={__("Override Height Units")}
|
9376 |
+
options={[
|
9377 |
+
{value: "px", label: "px"},
|
9378 |
+
{value: "%", label: "%"},
|
9379 |
+
{value: "vw`", label: "vw"},
|
9380 |
+
{value: "vh", label: "vh"}
|
9381 |
+
]}
|
9382 |
+
onChange={onPropertiesChanged}
|
9383 |
+
/>
|
9384 |
+
*/
|
9385 |
+
|
9386 |
+
var onOverrideWidthCheckboxChanged = function onOverrideWidthCheckboxChanged(value) {};
|
9387 |
+
|
9388 |
+
return React.createElement(
|
9389 |
+
InspectorControls,
|
9390 |
+
{ key: "inspector" },
|
9391 |
+
React.createElement(
|
9392 |
+
PanelBody,
|
9393 |
+
{ title: __('Map Settings') },
|
9394 |
+
React.createElement(
|
9395 |
+
"p",
|
9396 |
+
{ "class": "map-block-gutenberg-button-container" },
|
9397 |
+
React.createElement(
|
9398 |
+
"a",
|
9399 |
+
{ href: WPGMZA.adminurl + "admin.php?page=wp-google-maps-menu&action=edit&map_id=1",
|
9400 |
+
target: "_blank",
|
9401 |
+
"class": "button button-primary" },
|
9402 |
+
React.createElement("i", { "class": "fa fa-pencil-square-o", "aria-hidden": "true" }),
|
9403 |
+
__('Go to Map Editor')
|
9404 |
+
)
|
9405 |
+
),
|
9406 |
+
React.createElement(
|
9407 |
+
"p",
|
9408 |
+
{ "class": "map-block-gutenberg-button-container" },
|
9409 |
+
React.createElement(
|
9410 |
+
"a",
|
9411 |
+
{ href: "https://www.wpgmaps.com/documentation/creating-your-first-map/",
|
9412 |
+
target: "_blank",
|
9413 |
+
"class": "button button-primary" },
|
9414 |
+
React.createElement("i", { "class": "fa fa-book", "aria-hidden": "true" }),
|
9415 |
+
__('View Documentation')
|
9416 |
+
)
|
9417 |
+
)
|
9418 |
+
)
|
9419 |
+
);
|
9420 |
+
};
|
9421 |
+
|
9422 |
+
WPGMZA.Integration.Gutenberg.prototype.getBlockAttributes = function () {
|
9423 |
+
return {};
|
9424 |
+
};
|
9425 |
+
|
9426 |
+
WPGMZA.Integration.Gutenberg.prototype.getBlockDefinition = function (props) {
|
9427 |
+
var _this = this;
|
9428 |
+
|
9429 |
+
return {
|
9430 |
+
|
9431 |
+
title: __("WP Google Maps"),
|
9432 |
+
description: __('The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.'),
|
9433 |
+
category: 'common',
|
9434 |
+
icon: 'location-alt',
|
9435 |
+
keywords: [__('Map'), __('Maps'), __('Google')],
|
9436 |
+
attributes: this.getBlockAttributes(),
|
9437 |
+
|
9438 |
+
edit: function edit(props) {
|
9439 |
+
return [!!props.isSelected && _this.getBlockInspectorControls(props), React.createElement(
|
9440 |
+
"div",
|
9441 |
+
{ className: props.className + " wpgmza-gutenberg-block" },
|
9442 |
+
React.createElement(Dashicon, { icon: "location-alt" }),
|
9443 |
+
React.createElement(
|
9444 |
+
"span",
|
9445 |
+
{ "class": "wpgmza-gutenberg-block-title" },
|
9446 |
+
__("Your map will appear here on your websites front end")
|
9447 |
+
)
|
9448 |
+
)];
|
9449 |
+
},
|
9450 |
+
// Defining the front-end interface
|
9451 |
+
save: function save(props) {
|
9452 |
+
// Rendering in PHP
|
9453 |
+
return null;
|
9454 |
+
}
|
9455 |
+
|
9456 |
+
};
|
9457 |
+
};
|
9458 |
+
|
9459 |
+
WPGMZA.Integration.Gutenberg.getConstructor = function () {
|
9460 |
+
return WPGMZA.Integration.Gutenberg;
|
9461 |
+
};
|
9462 |
+
|
9463 |
+
WPGMZA.Integration.Gutenberg.createInstance = function () {
|
9464 |
+
var constructor = WPGMZA.Integration.Gutenberg.getConstructor();
|
9465 |
+
return new constructor();
|
9466 |
+
};
|
9467 |
+
|
9468 |
+
// Allow the Pro module to extend and create the module, only create here when Pro isn't loaded
|
9469 |
+
if(!WPGMZA.isProVersion() && !(/^6/.test(WPGMZA.pro_version))) WPGMZA.integrationModules.gutenberg = WPGMZA.Integration.Gutenberg.createInstance();
|
9470 |
+
});
|
9471 |
|
9472 |
+
// js/v8/compatibility/astra-theme-compatibility.js
|
9473 |
+
/**
|
9474 |
+
* @namespace WPGMZA
|
9475 |
+
* @module AstraThemeCompatiblity
|
9476 |
+
* @requires WPGMZA
|
9477 |
+
* @description Prevents the document.body.onclick handler firing for markers, which causes the Astra theme to throw an error, preventing the infowindow from opening
|
9478 |
+
*/
|
9479 |
+
jQuery(function($) {
|
9480 |
+
|
9481 |
+
$(document).ready(function(event) {
|
9482 |
+
|
9483 |
+
var parent = document.body.onclick;
|
9484 |
+
|
9485 |
+
if(!parent)
|
9486 |
+
return;
|
9487 |
+
|
9488 |
+
document.body.onclick = function(event)
|
9489 |
+
{
|
9490 |
+
if(event.target instanceof WPGMZA.Marker)
|
9491 |
+
return;
|
9492 |
+
|
9493 |
+
parent(event);
|
9494 |
+
}
|
9495 |
+
|
9496 |
+
});
|
9497 |
+
|
9498 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9499 |
|
9500 |
+
// js/v8/compatibility/google-ui-compatibility.js
|
9501 |
+
/**
|
9502 |
+
* @namespace WPGMZA
|
9503 |
+
* @module GoogleUICompatibility
|
9504 |
+
* @requires WPGMZA
|
9505 |
+
*/
|
9506 |
+
jQuery(function($) {
|
9507 |
+
|
9508 |
+
WPGMZA.GoogleUICompatibility = function()
|
9509 |
+
{
|
9510 |
+
var isSafari = navigator.vendor && navigator.vendor.indexOf('Apple') > -1 &&
|
9511 |
+
navigator.userAgent &&
|
9512 |
+
navigator.userAgent.indexOf('CriOS') == -1 &&
|
9513 |
+
navigator.userAgent.indexOf('FxiOS') == -1;
|
9514 |
+
|
9515 |
+
if(!isSafari)
|
9516 |
+
{
|
9517 |
+
var style = $("<style id='wpgmza-google-ui-compatiblity-fix'/>");
|
9518 |
+
style.html(".wpgmza_map img:not(button img) { padding:0 !important; }");
|
9519 |
+
$(document.head).append(style);
|
9520 |
+
}
|
9521 |
+
}
|
9522 |
+
|
9523 |
+
WPGMZA.googleUICompatibility = new WPGMZA.GoogleUICompatibility();
|
9524 |
+
|
9525 |
+
});
|
9526 |
|
9527 |
+
// js/v8/google-maps/google-circle.js
|
9528 |
+
/**
|
9529 |
+
* @namespace WPGMZA
|
9530 |
+
* @module GoogleCircle
|
9531 |
+
* @requires WPGMZA.Circle
|
9532 |
+
*/
|
9533 |
+
jQuery(function($) {
|
9534 |
+
|
9535 |
+
/**
|
9536 |
+
* Subclass, used when Google is the maps engine. <strong>Please <em>do not</em> call this constructor directly. Always use createInstance rather than instantiating this class directly.</strong> Using createInstance allows this class to be externally extensible.
|
9537 |
+
* @class WPGMZA.GoogleCircle
|
9538 |
+
* @constructor WPGMZA.GoogleCircle
|
9539 |
+
* @memberof WPGMZA
|
9540 |
+
* @augments WPGMZA.Circle
|
9541 |
+
* @see WPGMZA.Circle.createInstance
|
9542 |
+
*/
|
9543 |
+
WPGMZA.GoogleCircle = function(options, googleCircle)
|
9544 |
+
{
|
9545 |
+
var self = this;
|
9546 |
+
|
9547 |
+
WPGMZA.Circle.call(this, options, googleCircle);
|
9548 |
+
|
9549 |
+
if(googleCircle)
|
9550 |
+
{
|
9551 |
+
this.googleCircle = googleCircle;
|
9552 |
+
|
9553 |
+
if(options)
|
9554 |
+
{
|
9555 |
+
|
9556 |
+
options.center = WPGMZA.LatLng.fromGoogleLatLng( googleCircle.getCenter() );
|
9557 |
+
options.radius = googleCircle.getRadius() / 1000; // Meters to kilometers
|
9558 |
+
}
|
9559 |
+
}
|
9560 |
+
else
|
9561 |
+
{
|
9562 |
+
this.googleCircle = new google.maps.Circle();
|
9563 |
+
this.googleCircle.wpgmzaCircle = this;
|
9564 |
+
}
|
9565 |
+
|
9566 |
+
this.googleFeature = this.googleCircle;
|
9567 |
+
|
9568 |
+
if(options)
|
9569 |
+
this.setOptions(options);
|
9570 |
+
|
9571 |
+
google.maps.event.addListener(this.googleCircle, "click", function() {
|
9572 |
+
self.dispatchEvent({type: "click"});
|
9573 |
+
});
|
9574 |
+
}
|
9575 |
+
|
9576 |
+
WPGMZA.GoogleCircle.prototype = Object.create(WPGMZA.Circle.prototype);
|
9577 |
+
WPGMZA.GoogleCircle.prototype.constructor = WPGMZA.GoogleCircle;
|
9578 |
+
|
9579 |
+
WPGMZA.GoogleCircle.prototype.getCenter = function()
|
9580 |
+
{
|
9581 |
+
return WPGMZA.LatLng.fromGoogleLatLng( this.googleCircle.getCenter() );
|
9582 |
+
}
|
9583 |
+
|
9584 |
+
WPGMZA.GoogleCircle.prototype.setCenter = function(center)
|
9585 |
+
{
|
9586 |
+
WPGMZA.Circle.prototype.setCenter.apply(this, arguments);
|
9587 |
+
|
9588 |
+
this.googleCircle.setCenter(center);
|
9589 |
+
}
|
9590 |
+
|
9591 |
+
WPGMZA.GoogleCircle.prototype.getRadius = function()
|
9592 |
+
{
|
9593 |
+
return this.googleCircle.getRadius() / 1000; // Meters to kilometers
|
9594 |
+
}
|
9595 |
+
|
9596 |
+
WPGMZA.GoogleCircle.prototype.setRadius = function(radius)
|
9597 |
+
{
|
9598 |
+
WPGMZA.Circle.prototype.setRadius.apply(this, arguments);
|
9599 |
+
|
9600 |
+
this.googleCircle.setRadius(parseFloat(radius) * 1000); // Kilometers to meters
|
9601 |
+
}
|
9602 |
+
|
9603 |
+
WPGMZA.GoogleCircle.prototype.setVisible = function(visible)
|
9604 |
+
{
|
9605 |
+
this.googleCircle.setVisible(visible ? true : false);
|
9606 |
+
}
|
9607 |
+
|
9608 |
+
WPGMZA.GoogleCircle.prototype.setDraggable = function(value)
|
9609 |
+
{
|
9610 |
+
this.googleCircle.setDraggable(value ? true : false);
|
9611 |
+
}
|
9612 |
+
|
9613 |
+
WPGMZA.GoogleCircle.prototype.setEditable = function(value)
|
9614 |
+
{
|
9615 |
+
var self = this;
|
9616 |
+
|
9617 |
+
this.googleCircle.setOptions({editable: value});
|
9618 |
+
|
9619 |
+
if(value)
|
9620 |
+
{
|
9621 |
+
google.maps.event.addListener(this.googleCircle, "center_changed", function(event) {
|
9622 |
+
|
9623 |
+
self.center = WPGMZA.LatLng.fromGoogleLatLng(self.googleCircle.getCenter());
|
9624 |
+
self.trigger("change");
|
9625 |
+
|
9626 |
+
});
|
9627 |
+
|
9628 |
+
google.maps.event.addListener(this.googleCircle, "radius_changed", function(event) {
|
9629 |
+
|
9630 |
+
self.radius = self.googleCircle.getRadius() / 1000; // Meters to kilometers
|
9631 |
+
self.trigger("change");
|
9632 |
+
|
9633 |
+
});
|
9634 |
+
}
|
9635 |
+
}
|
9636 |
+
|
9637 |
+
WPGMZA.GoogleCircle.prototype.setOptions = function(options)
|
9638 |
+
{
|
9639 |
+
WPGMZA.Circle.prototype.setOptions.apply(this, arguments);
|
9640 |
+
|
9641 |
+
if(options.center)
|
9642 |
+
this.center = new WPGMZA.LatLng(options.center);
|
9643 |
+
}
|
9644 |
+
|
9645 |
+
WPGMZA.GoogleCircle.prototype.updateNativeFeature = function()
|
9646 |
+
{
|
9647 |
+
var googleOptions = this.getScalarProperties();
|
9648 |
+
var center = new WPGMZA.LatLng(this.center); // In case center is a lat lng literal, this should really happen though
|
9649 |
+
|
9650 |
+
googleOptions.radius *= 1000; // Kilometers to meters
|
9651 |
+
googleOptions.center = center.toGoogleLatLng();
|
9652 |
+
|
9653 |
+
this.googleCircle.setOptions(googleOptions);
|
9654 |
+
}
|
9655 |
+
|
9656 |
+
});
|
9657 |
|
9658 |
+
// js/v8/google-maps/google-drawing-manager.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9659 |
/**
|
9660 |
* @namespace WPGMZA
|
9661 |
+
* @module GoogleDrawingManager
|
9662 |
+
* @requires WPGMZA.DrawingManager
|
9663 |
*/
|
9664 |
jQuery(function($) {
|
9665 |
|
9666 |
+
WPGMZA.GoogleDrawingManager = function(map)
|
9667 |
{
|
9668 |
var self = this;
|
|
|
|
|
9669 |
|
9670 |
+
WPGMZA.DrawingManager.call(this, map);
|
9671 |
|
9672 |
+
this.mode = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
9673 |
|
9674 |
+
this.googleDrawingManager = new google.maps.drawing.DrawingManager({
|
9675 |
+
drawingControl: false,
|
9676 |
+
polygonOptions: {
|
9677 |
+
editable: true
|
9678 |
+
},
|
9679 |
+
polylineOptions: {
|
9680 |
+
editable: true
|
9681 |
+
},
|
9682 |
+
circleOptions: {
|
9683 |
+
editable: true
|
9684 |
+
},
|
9685 |
+
rectangleOptions: {
|
9686 |
+
editable: true
|
9687 |
+
}
|
9688 |
+
});
|
9689 |
|
9690 |
+
this.googleDrawingManager.setMap(map.googleMap);
|
|
|
|
|
9691 |
|
9692 |
+
google.maps.event.addListener(this.googleDrawingManager, "polygoncomplete", function(polygon) {
|
9693 |
+
self.onPolygonClosed(polygon);
|
9694 |
+
});
|
9695 |
|
9696 |
+
google.maps.event.addListener(this.googleDrawingManager, "polylinecomplete", function(polyline) {
|
9697 |
+
self.onPolylineComplete(polyline);
|
9698 |
+
});
|
9699 |
|
9700 |
+
google.maps.event.addListener(this.googleDrawingManager, "circlecomplete", function(circle) {
|
9701 |
+
self.onCircleComplete(circle);
|
9702 |
+
});
|
9703 |
+
|
9704 |
+
google.maps.event.addListener(this.googleDrawingManager, "rectanglecomplete", function(rectangle) {
|
9705 |
+
self.onRectangleComplete(rectangle);
|
9706 |
+
});
|
9707 |
+
}
|
9708 |
|
9709 |
+
WPGMZA.GoogleDrawingManager.prototype = Object.create(WPGMZA.DrawingManager.prototype);
|
9710 |
+
WPGMZA.GoogleDrawingManager.prototype.constructor = WPGMZA.GoogleDrawingManager;
|
9711 |
+
|
9712 |
+
WPGMZA.GoogleDrawingManager.prototype.setDrawingMode = function(mode)
|
9713 |
{
|
9714 |
+
var googleMode;
|
|
|
9715 |
|
9716 |
+
WPGMZA.DrawingManager.prototype.setDrawingMode.call(this, mode);
|
9717 |
+
|
9718 |
+
switch(mode)
|
9719 |
{
|
9720 |
+
case WPGMZA.DrawingManager.MODE_NONE:
|
9721 |
+
googleMode = null;
|
9722 |
+
break;
|
9723 |
+
|
9724 |
+
case WPGMZA.DrawingManager.MODE_MARKER:
|
9725 |
+
/* Set to null to allow only right click */
|
9726 |
+
/*
|
9727 |
+
googleMode = google.maps.drawing.OverlayType.MARKER;
|
9728 |
+
*/
|
9729 |
+
googleMode = null;
|
9730 |
+
break;
|
9731 |
+
|
9732 |
+
case WPGMZA.DrawingManager.MODE_POLYGON:
|
9733 |
+
googleMode = google.maps.drawing.OverlayType.POLYGON;
|
9734 |
+
break;
|
9735 |
+
|
9736 |
+
case WPGMZA.DrawingManager.MODE_POLYLINE:
|
9737 |
+
googleMode = google.maps.drawing.OverlayType.POLYLINE;
|
9738 |
+
break;
|
9739 |
+
|
9740 |
+
case WPGMZA.DrawingManager.MODE_CIRCLE:
|
9741 |
+
googleMode = google.maps.drawing.OverlayType.CIRCLE;
|
9742 |
+
break;
|
9743 |
+
|
9744 |
+
case WPGMZA.DrawingManager.MODE_RECTANGLE:
|
9745 |
+
googleMode = google.maps.drawing.OverlayType.RECTANGLE;
|
9746 |
+
break;
|
9747 |
+
|
9748 |
+
case WPGMZA.DrawingManager.MODE_HEATMAP:
|
9749 |
+
googleMode = null;
|
9750 |
+
break;
|
9751 |
+
|
9752 |
+
default:
|
9753 |
+
throw new Error("Invalid drawing mode");
|
9754 |
+
break;
|
9755 |
}
|
9756 |
|
9757 |
+
this.googleDrawingManager.setDrawingMode(googleMode);
|
9758 |
}
|
9759 |
|
9760 |
+
WPGMZA.GoogleDrawingManager.prototype.setOptions = function(options)
|
9761 |
{
|
9762 |
+
this.googleDrawingManager.setOptions({
|
9763 |
+
polygonOptions: options,
|
9764 |
+
polylineOptions: options
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9765 |
});
|
9766 |
+
}
|
9767 |
+
|
9768 |
+
WPGMZA.GoogleDrawingManager.prototype.onVertexClicked = function(event) {
|
9769 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9770 |
}
|
9771 |
+
|
9772 |
+
WPGMZA.GoogleDrawingManager.prototype.onPolygonClosed = function(googlePolygon)
|
9773 |
+
{
|
9774 |
+
var event = new WPGMZA.Event("polygonclosed");
|
9775 |
+
event.enginePolygon = googlePolygon;
|
9776 |
+
this.dispatchEvent(event);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9777 |
}
|
9778 |
|
9779 |
+
WPGMZA.GoogleDrawingManager.prototype.onPolylineComplete = function(googlePolyline)
|
|
|
9780 |
{
|
9781 |
+
var event = new WPGMZA.Event("polylinecomplete");
|
9782 |
+
event.enginePolyline = googlePolyline;
|
9783 |
+
this.dispatchEvent(event);
|
9784 |
+
}
|
9785 |
+
|
9786 |
+
WPGMZA.GoogleDrawingManager.prototype.onCircleComplete = function(googleCircle)
|
9787 |
+
{
|
9788 |
+
var event = new WPGMZA.Event("circlecomplete");
|
9789 |
+
event.engineCircle = googleCircle;
|
9790 |
+
this.dispatchEvent(event);
|
9791 |
+
}
|
9792 |
+
|
9793 |
+
WPGMZA.GoogleDrawingManager.prototype.onRectangleComplete = function(googleRectangle)
|
9794 |
+
{
|
9795 |
+
var event = new WPGMZA.Event("rectanglecomplete");
|
9796 |
+
event.engineRectangle = googleRectangle;
|
9797 |
+
this.dispatchEvent(event);
|
9798 |
+
}
|
9799 |
+
|
9800 |
+
WPGMZA.GoogleDrawingManager.prototype.onHeatmapPointAdded = function(googleMarker)
|
9801 |
+
{
|
9802 |
+
var position = WPGMZA.LatLng.fromGoogleLatLng(googleMarker.getPosition());
|
9803 |
+
googleMarker.setMap(null);
|
9804 |
|
9805 |
+
var marker = WPGMZA.Marker.createInstance();
|
9806 |
+
marker.setPosition(position);
|
9807 |
+
|
9808 |
+
var image = {
|
9809 |
+
url: WPGMZA.imageFolderURL + "heatmap-point.png",
|
9810 |
+
origin: new google.maps.Point(0, 0),
|
9811 |
+
anchor: new google.maps.Point(13, 13)
|
9812 |
+
};
|
9813 |
+
|
9814 |
+
marker.googleMarker.setIcon(image);
|
9815 |
+
|
9816 |
+
this.map.addMarker(marker);
|
9817 |
+
|
9818 |
+
var event = new WPGMZA.Event("heatmappointadded");
|
9819 |
+
event.position = position;
|
9820 |
+
this.trigger(event);
|
9821 |
}
|
9822 |
|
9823 |
});
|
9824 |
|
9825 |
+
// js/v8/google-maps/google-geocoder.js
|
9826 |
/**
|
9827 |
* @namespace WPGMZA
|
9828 |
+
* @module GoogleGeocoder
|
9829 |
+
* @requires WPGMZA.Geocoder
|
9830 |
*/
|
9831 |
+
jQuery(function($) {
|
9832 |
+
|
9833 |
+
/**
|
9834 |
+
* Subclass, used when Google is the maps engine. <strong>Please <em>do not</em> call this constructor directly. Always use createInstance rather than instantiating this class directly.</strong> Using createInstance allows this class to be externally extensible.
|
9835 |
+
* @class WPGMZA.GoogleGeocoder
|
9836 |
+
* @constructor WPGMZA.GoogleGeocoder
|
9837 |
+
* @memberof WPGMZA
|
9838 |
+
* @augments WPGMZA.Geocoder
|
9839 |
+
* @see WPGMZA.Geocoder.createInstance
|
9840 |
+
*/
|
9841 |
+
WPGMZA.GoogleGeocoder = function()
|
9842 |
+
{
|
9843 |
+
|
9844 |
+
}
|
9845 |
+
|
9846 |
+
WPGMZA.GoogleGeocoder.prototype = Object.create(WPGMZA.Geocoder.prototype);
|
9847 |
+
WPGMZA.GoogleGeocoder.prototype.constructor = WPGMZA.GoogleGeocoder;
|
9848 |
+
|
9849 |
+
WPGMZA.GoogleGeocoder.prototype.getLatLngFromAddress = function(options, callback) {
|
9850 |
|
9851 |
+
if(!options || !options.address) {
|
9852 |
+
|
9853 |
+
nativeStatus = WPGMZA.Geocoder.NO_ADDRESS;
|
9854 |
+
callback(null, nativeStatus);
|
9855 |
+
return;
|
9856 |
+
/*throw new Error("No address specified");*/
|
9857 |
|
9858 |
+
}
|
9859 |
|
9860 |
+
if (options.lat && options.lng) {
|
9861 |
+
var latLng = {
|
9862 |
+
lat: options.lat,
|
9863 |
+
lng: options.lng
|
9864 |
+
};
|
9865 |
+
var bounds = null;
|
9866 |
+
|
9867 |
+
var results = [
|
9868 |
+
{
|
9869 |
+
geometry: {
|
9870 |
+
location: latLng
|
9871 |
+
},
|
9872 |
+
latLng: latLng,
|
9873 |
+
lat: latLng.lat,
|
9874 |
+
lng: latLng.lng,
|
9875 |
+
bounds: bounds
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9876 |
}
|
9877 |
+
];
|
9878 |
+
|
9879 |
+
callback(results, WPGMZA.Geocoder.SUCCESS);
|
9880 |
+
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9881 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9882 |
}
|
9883 |
|
9884 |
+
if(WPGMZA.isLatLngString(options.address))
|
9885 |
+
return WPGMZA.Geocoder.prototype.getLatLngFromAddress.call(this, options, callback);
|
9886 |
+
|
9887 |
+
if(options.country)
|
9888 |
+
options.componentRestrictions = {
|
9889 |
+
country: options.country
|
9890 |
+
};
|
9891 |
+
|
9892 |
+
var geocoder = new google.maps.Geocoder();
|
9893 |
+
|
9894 |
+
geocoder.geocode(options, function(results, status) {
|
9895 |
+
if(status == google.maps.GeocoderStatus.OK)
|
9896 |
+
{
|
9897 |
+
var location = results[0].geometry.location;
|
9898 |
+
var latLng = {
|
9899 |
+
lat: location.lat(),
|
9900 |
+
lng: location.lng()
|
9901 |
+
};
|
9902 |
+
var bounds = null;
|
9903 |
+
|
9904 |
+
if(results[0].geometry.bounds)
|
9905 |
+
bounds = WPGMZA.LatLngBounds.fromGoogleLatLngBounds(results[0].geometry.bounds);
|
9906 |
+
|
9907 |
+
var results = [
|
9908 |
+
{
|
9909 |
+
geometry: {
|
9910 |
+
location: latLng
|
9911 |
+
},
|
9912 |
+
latLng: latLng,
|
9913 |
+
lat: latLng.lat,
|
9914 |
+
lng: latLng.lng,
|
9915 |
+
bounds: bounds
|
9916 |
+
}
|
9917 |
+
];
|
9918 |
+
|
9919 |
+
|
9920 |
+
|
9921 |
+
callback(results, WPGMZA.Geocoder.SUCCESS);
|
9922 |
+
}
|
9923 |
+
else
|
9924 |
+
{
|
9925 |
+
var nativeStatus = WPGMZA.Geocoder.FAIL;
|
9926 |
+
|
9927 |
+
if(status == google.maps.GeocoderStatus.ZERO_RESULTS)
|
9928 |
+
nativeStatus = WPGMZA.Geocoder.ZERO_RESULTS;
|
9929 |
+
|
9930 |
+
callback(null, nativeStatus);
|
9931 |
+
}
|
9932 |
+
});
|
9933 |
}
|
9934 |
+
|
9935 |
+
WPGMZA.GoogleGeocoder.prototype.getAddressFromLatLng = function(options, callback)
|
9936 |
{
|
9937 |
+
if(!options || !options.latLng)
|
9938 |
+
throw new Error("No latLng specified");
|
9939 |
|
9940 |
+
var latLng = new WPGMZA.LatLng(options.latLng);
|
9941 |
+
var geocoder = new google.maps.Geocoder();
|
9942 |
+
|
9943 |
+
var options = $.extend(options, {
|
9944 |
+
location: {
|
9945 |
+
lat: latLng.lat,
|
9946 |
+
lng: latLng.lng
|
9947 |
+
}
|
9948 |
});
|
9949 |
+
delete options.latLng;
|
9950 |
|
9951 |
+
geocoder.geocode(options, function(results, status) {
|
9952 |
+
|
9953 |
+
if(status !== "OK")
|
9954 |
+
callback(null, WPGMZA.Geocoder.FAIL);
|
9955 |
+
|
9956 |
+
if(!results || !results.length)
|
9957 |
+
callback([], WPGMZA.Geocoder.NO_RESULTS);
|
9958 |
+
|
9959 |
+
callback([results[0].formatted_address], WPGMZA.Geocoder.SUCCESS);
|
9960 |
+
|
9961 |
+
});
|
|
|
|
|
9962 |
}
|
9963 |
+
|
9964 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9965 |
|
9966 |
+
// js/v8/google-maps/google-html-overlay.js
|
9967 |
/**
|
9968 |
* @namespace WPGMZA
|
9969 |
+
* @module GoogleHTMLOverlay
|
9970 |
+
* @requires WPGMZA
|
9971 |
*/
|
9972 |
jQuery(function($) {
|
9973 |
|
9974 |
+
// https://developers.google.com/maps/documentation/javascript/customoverlays
|
9975 |
+
|
9976 |
+
if(WPGMZA.settings.engine && WPGMZA.settings.engine != "google-maps")
|
9977 |
+
return;
|
9978 |
+
|
9979 |
+
if(!window.google || !window.google.maps)
|
9980 |
+
return;
|
9981 |
+
|
9982 |
+
WPGMZA.GoogleHTMLOverlay = function(map)
|
9983 |
{
|
9984 |
+
this.element = $("<div class='wpgmza-google-html-overlay'></div>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9985 |
|
9986 |
+
this.visible = true;
|
9987 |
+
this.position = new WPGMZA.LatLng();
|
|
|
9988 |
|
9989 |
+
this.setMap(map.googleMap);
|
9990 |
+
this.wpgmzaMap = map;
|
|
|
|
|
|
|
|
|
|
|
9991 |
}
|
9992 |
|
9993 |
+
WPGMZA.GoogleHTMLOverlay.prototype = new google.maps.OverlayView();
|
|
|
9994 |
|
9995 |
+
WPGMZA.GoogleHTMLOverlay.prototype.onAdd = function()
|
9996 |
{
|
9997 |
+
var panes = this.getPanes();
|
9998 |
+
panes.overlayMouseTarget.appendChild(this.element[0]);
|
9999 |
+
|
10000 |
+
/*google.maps.event.addDomListener(this.element, "click", function() {
|
10001 |
+
|
10002 |
+
});*/
|
10003 |
}
|
10004 |
|
10005 |
+
WPGMZA.GoogleHTMLOverlay.prototype.onRemove = function()
|
10006 |
{
|
10007 |
+
if(this.element && $(this.element).parent().length)
|
|
|
|
|
|
|
10008 |
{
|
10009 |
+
$(this.element).remove();
|
10010 |
+
this.element = null;
|
10011 |
}
|
|
|
|
|
10012 |
}
|
10013 |
|
10014 |
+
WPGMZA.GoogleHTMLOverlay.prototype.draw = function()
|
10015 |
{
|
10016 |
+
this.updateElementPosition();
|
10017 |
}
|
10018 |
|
10019 |
+
/*WPGMZA.GoogleHTMLOverlay.prototype.setMap = function(map)
|
10020 |
{
|
10021 |
+
if(!(map instanceof WPGMZA.Map))
|
10022 |
+
throw new Error("Map must be an instance of WPGMZA.Map");
|
10023 |
|
10024 |
+
google.maps.OverlayView.prototype.setMap.call(this, map.googleMap);
|
|
|
|
|
|
|
|
|
|
|
10025 |
|
10026 |
+
this.wpgmzaMap = map;
|
10027 |
+
}*/
|
10028 |
+
|
10029 |
+
/*WPGMZA.GoogleHTMLOverlay.prototype.getVisible = function()
|
10030 |
+
{
|
10031 |
+
return $(this.element).css("display") != "none";
|
10032 |
+
}
|
10033 |
+
|
10034 |
+
WPGMZA.GoogleHTMLOverlay.prototype.setVisible = function(visible)
|
10035 |
+
{
|
10036 |
+
$(this.element).css({
|
10037 |
+
"display": (visible ? "block" : "none")
|
10038 |
});
|
10039 |
+
}*/
|
10040 |
+
|
10041 |
+
/*WPGMZA.GoogleHTMLOverlay.prototype.getPosition = function()
|
10042 |
+
{
|
10043 |
+
return new WPGMZA.LatLng(this.position);
|
10044 |
}
|
10045 |
|
10046 |
+
WPGMZA.GoogleHTMLOverlay.prototype.setPosition = function(position)
|
|
|
10047 |
{
|
10048 |
+
if(!(position instanceof WPGMZA.LatLng))
|
10049 |
+
throw new Error("Argument must be an instance of WPGMZA.LatLng");
|
10050 |
|
10051 |
+
this.position = position;
|
10052 |
+
this.updateElementPosition();
|
10053 |
+
}*/
|
10054 |
+
|
10055 |
+
WPGMZA.GoogleHTMLOverlay.prototype.updateElementPosition = function()
|
10056 |
+
{
|
10057 |
+
//var pixels = this.wpgmzaMap.latLngToPixels(this.position);
|
10058 |
+
|
10059 |
+
var projection = this.getProjection();
|
10060 |
+
|
10061 |
+
if(!projection)
|
10062 |
+
return;
|
10063 |
+
|
10064 |
+
var pixels = projection.fromLatLngToDivPixel(this.position.toGoogleLatLng());
|
10065 |
+
|
10066 |
+
$(this.element).css({
|
10067 |
+
"left": pixels.x,
|
10068 |
+
"top": pixels.y
|
10069 |
});
|
10070 |
}
|
10071 |
+
});
|
10072 |
+
|
10073 |
+
// js/v8/google-maps/google-info-window.js
|
10074 |
+
/**
|
10075 |
+
* @namespace WPGMZA
|
10076 |
+
* @module GoogleInfoWindow
|
10077 |
+
* @requires WPGMZA.InfoWindow
|
10078 |
+
* @pro-requires WPGMZA.ProInfoWindow
|
10079 |
+
*/
|
10080 |
+
jQuery(function($) {
|
10081 |
|
10082 |
+
var Parent;
|
10083 |
+
|
10084 |
+
WPGMZA.GoogleInfoWindow = function(feature)
|
10085 |
{
|
10086 |
+
Parent.call(this, feature);
|
10087 |
+
|
10088 |
+
this.setFeature(feature);
|
10089 |
}
|
10090 |
|
10091 |
+
WPGMZA.GoogleInfoWindow.Z_INDEX = 99;
|
10092 |
+
|
10093 |
+
if(WPGMZA.isProVersion())
|
10094 |
+
Parent = WPGMZA.ProInfoWindow;
|
10095 |
+
else
|
10096 |
+
Parent = WPGMZA.InfoWindow;
|
10097 |
+
|
10098 |
+
WPGMZA.GoogleInfoWindow.prototype = Object.create(Parent.prototype);
|
10099 |
+
WPGMZA.GoogleInfoWindow.prototype.constructor = WPGMZA.GoogleInfoWindow;
|
10100 |
+
|
10101 |
+
WPGMZA.GoogleInfoWindow.prototype.setFeature = function(feature)
|
10102 |
+
{
|
10103 |
+
this.feature = feature;
|
10104 |
+
|
10105 |
+
if(feature instanceof WPGMZA.Marker)
|
10106 |
+
this.googleObject = feature.googleMarker;
|
10107 |
+
else if(feature instanceof WPGMZA.Polygon)
|
10108 |
+
this.googleObject = feature.googlePolygon;
|
10109 |
+
else if(feature instanceof WPGMZA.Polyline)
|
10110 |
+
this.googleObject = feature.googlePolyline;
|
10111 |
+
}
|
10112 |
+
|
10113 |
+
WPGMZA.GoogleInfoWindow.prototype.createGoogleInfoWindow = function()
|
10114 |
{
|
10115 |
var self = this;
|
|
|
|
|
10116 |
|
10117 |
+
if(this.googleInfoWindow)
|
10118 |
+
return;
|
|
|
|
|
10119 |
|
10120 |
+
this.googleInfoWindow = new google.maps.InfoWindow();
|
10121 |
+
|
10122 |
+
this.googleInfoWindow.setZIndex(WPGMZA.GoogleInfoWindow.Z_INDEX);
|
10123 |
+
|
10124 |
+
google.maps.event.addListener(this.googleInfoWindow, "domready", function(event) {
|
10125 |
+
self.trigger("domready");
|
10126 |
});
|
10127 |
|
10128 |
+
google.maps.event.addListener(this.googleInfoWindow, "closeclick", function(event) {
|
10129 |
+
|
10130 |
+
if(self.state == WPGMZA.InfoWindow.STATE_CLOSED)
|
10131 |
+
return;
|
10132 |
+
|
10133 |
+
self.state = WPGMZA.InfoWindow.STATE_CLOSED;
|
10134 |
+
self.feature.map.trigger("infowindowclose");
|
10135 |
+
|
10136 |
});
|
10137 |
}
|
10138 |
+
|
10139 |
+
/**
|
10140 |
+
* Opens the info window
|
10141 |
+
* @return boolean FALSE if the info window should not & will not open, TRUE if it will
|
10142 |
+
*/
|
10143 |
+
WPGMZA.GoogleInfoWindow.prototype.open = function(map, feature) {
|
10144 |
+
var self = this;
|
10145 |
+
|
10146 |
+
if(!Parent.prototype.open.call(this, map, feature))
|
10147 |
+
return false;
|
10148 |
|
10149 |
+
|
10150 |
+
// Set parent for events to bubble up to
|
10151 |
+
this.parent = map;
|
10152 |
+
|
10153 |
+
this.createGoogleInfoWindow();
|
10154 |
+
this.setFeature(feature);
|
10155 |
+
|
10156 |
+
this.googleInfoWindow.open(
|
10157 |
+
this.feature.map.googleMap,
|
10158 |
+
this.googleObject
|
10159 |
+
);
|
10160 |
|
10161 |
+
var guid = WPGMZA.guid();
|
10162 |
+
var eaBtn = !WPGMZA.isProVersion() ? this.addEditButton() : '';
|
10163 |
+
var html = "<div id='" + guid + "'>" + eaBtn + ' ' + this.content + "</div>";
|
|
|
|
|
|
|
|
|
|
|
10164 |
|
10165 |
+
this.googleInfoWindow.setContent(html);
|
10166 |
|
10167 |
+
var intervalID;
|
10168 |
+
intervalID = setInterval(function(event) {
|
|
|
|
|
|
|
10169 |
|
10170 |
+
div = $("#" + guid);
|
10171 |
+
|
10172 |
+
if(div.length)
|
10173 |
+
{
|
10174 |
+
clearInterval(intervalID);
|
10175 |
+
|
10176 |
+
div[0].wpgmzaFeature = self.feature;
|
10177 |
+
div.addClass("wpgmza-infowindow");
|
10178 |
+
|
10179 |
+
self.element = div[0];
|
10180 |
+
self.trigger("infowindowopen");
|
10181 |
+
}
|
10182 |
+
|
10183 |
+
}, 50);
|
10184 |
+
|
10185 |
+
return true;
|
10186 |
+
}
|
10187 |
+
|
10188 |
+
WPGMZA.GoogleInfoWindow.prototype.close = function()
|
10189 |
+
{
|
10190 |
+
if(!this.googleInfoWindow)
|
10191 |
+
return;
|
10192 |
+
|
10193 |
+
WPGMZA.InfoWindow.prototype.close.call(this);
|
10194 |
+
|
10195 |
+
this.googleInfoWindow.close();
|
10196 |
+
}
|
10197 |
+
|
10198 |
+
WPGMZA.GoogleInfoWindow.prototype.setContent = function(html)
|
10199 |
+
{
|
10200 |
+
Parent.prototype.setContent.call(this, html);
|
10201 |
|
10202 |
+
this.content = html;
|
10203 |
|
10204 |
+
this.createGoogleInfoWindow();
|
10205 |
+
|
10206 |
+
this.googleInfoWindow.setContent(html);
|
10207 |
}
|
10208 |
|
10209 |
+
WPGMZA.GoogleInfoWindow.prototype.setOptions = function(options)
|
10210 |
+
{
|
10211 |
+
Parent.prototype.setOptions.call(this, options);
|
10212 |
|
10213 |
+
this.createGoogleInfoWindow();
|
|
|
|
|
10214 |
|
10215 |
+
this.googleInfoWindow.setOptions(options);
|
10216 |
+
}
|
10217 |
|
10218 |
});
|
10219 |
|
10220 |
+
// js/v8/google-maps/google-map.js
|
10221 |
+
/**
|
10222 |
+
* @namespace WPGMZA
|
10223 |
+
* @module GoogleMap
|
10224 |
+
* @requires WPGMZA.Map
|
10225 |
+
* @pro-requires WPGMZA.ProMap
|
10226 |
+
*/
|
10227 |
+
jQuery(function($) {
|
10228 |
+
var Parent;
|
10229 |
+
|
10230 |
+
/**
|
10231 |
+
* Constructor
|
10232 |
+
* @param element to contain the map
|
10233 |
+
*/
|
10234 |
+
WPGMZA.GoogleMap = function(element, options)
|
10235 |
+
{
|
10236 |
+
var self = this;
|
10237 |
+
|
10238 |
+
Parent.call(this, element, options);
|
10239 |
+
|
10240 |
+
this.loadGoogleMap();
|
10241 |
+
|
10242 |
+
if(options){
|
10243 |
+
this.setOptions(options, true);
|
10244 |
+
} else {
|
10245 |
+
this.setOptions({}, true);
|
10246 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10247 |
|
10248 |
+
google.maps.event.addListener(this.googleMap, "click", function(event) {
|
10249 |
+
var wpgmzaEvent = new WPGMZA.Event("click");
|
10250 |
+
wpgmzaEvent.latLng = {
|
10251 |
+
lat: event.latLng.lat(),
|
10252 |
+
lng: event.latLng.lng()
|
10253 |
+
};
|
10254 |
+
self.dispatchEvent(wpgmzaEvent);
|
10255 |
+
});
|
10256 |
+
|
10257 |
+
google.maps.event.addListener(this.googleMap, "rightclick", function(event) {
|
10258 |
+
var wpgmzaEvent = new WPGMZA.Event("rightclick");
|
10259 |
+
wpgmzaEvent.latLng = {
|
10260 |
+
lat: event.latLng.lat(),
|
10261 |
+
lng: event.latLng.lng()
|
10262 |
+
};
|
10263 |
+
self.dispatchEvent(wpgmzaEvent);
|
10264 |
+
});
|
10265 |
+
|
10266 |
+
google.maps.event.addListener(this.googleMap, "dragend", function(event) {
|
10267 |
+
self.dispatchEvent("dragend");
|
10268 |
+
});
|
10269 |
+
|
10270 |
+
google.maps.event.addListener(this.googleMap, "zoom_changed", function(event) {
|
10271 |
+
self.dispatchEvent("zoom_changed");
|
10272 |
+
self.dispatchEvent("zoomchanged");
|
10273 |
+
});
|
10274 |
+
|
10275 |
+
// Idle event
|
10276 |
+
google.maps.event.addListener(this.googleMap, "idle", function(event) {
|
10277 |
+
self.onIdle(event);
|
10278 |
+
});
|
10279 |
+
|
10280 |
+
// Dispatch event
|
10281 |
+
if(!WPGMZA.isProVersion())
|
10282 |
+
{
|
10283 |
+
this.trigger("init");
|
10284 |
+
|
10285 |
+
this.dispatchEvent("created");
|
10286 |
+
WPGMZA.events.dispatchEvent({type: "mapcreated", map: this});
|
10287 |
+
|
10288 |
+
// Legacy event
|
10289 |
+
$(this.element).trigger("wpgooglemaps_loaded");
|
10290 |
+
}
|
10291 |
+
}
|
10292 |
+
|
10293 |
+
// If we're running the Pro version, inherit from ProMap, otherwise, inherit from Map
|
10294 |
+
if(WPGMZA.isProVersion())
|
10295 |
+
{
|
10296 |
+
Parent = WPGMZA.ProMap;
|
10297 |
+
WPGMZA.GoogleMap.prototype = Object.create(WPGMZA.ProMap.prototype);
|
10298 |
+
}
|
10299 |
+
else
|
10300 |
+
{
|
10301 |
+
Parent = WPGMZA.Map;
|
10302 |
+
WPGMZA.GoogleMap.prototype = Object.create(WPGMZA.Map.prototype);
|
10303 |
+
}
|
10304 |
+
WPGMZA.GoogleMap.prototype.constructor = WPGMZA.GoogleMap;
|
10305 |
+
|
10306 |
+
WPGMZA.GoogleMap.parseThemeData = function(raw)
|
10307 |
+
{
|
10308 |
+
var json;
|
10309 |
+
|
10310 |
+
try{
|
10311 |
+
json = JSON.parse(raw); // Try to parse strict JSON
|
10312 |
+
}catch(e) {
|
10313 |
+
|
10314 |
+
try{
|
10315 |
+
|
10316 |
+
json = eval(raw); // Try to parse JS object
|
10317 |
+
|
10318 |
+
}catch(e) {
|
10319 |
+
|
10320 |
+
var str = raw;
|
10321 |
+
|
10322 |
+
str = str.replace(/\\'/g, '\'');
|
10323 |
+
str = str.replace(/\\"/g, '"');
|
10324 |
+
str = str.replace(/\\0/g, '\0');
|
10325 |
+
str = str.replace(/\\\\/g, '\\');
|
10326 |
+
|
10327 |
+
try{
|
10328 |
+
|
10329 |
+
json = eval(str);
|
10330 |
+
|
10331 |
+
}catch(e) {
|
10332 |
+
|
10333 |
+
console.warn("Couldn't parse theme data");
|
10334 |
+
|
10335 |
+
return [];
|
10336 |
+
|
10337 |
+
}
|
10338 |
+
|
10339 |
+
}
|
10340 |
+
|
10341 |
+
}
|
10342 |
+
|
10343 |
+
return json;
|
10344 |
+
}
|
10345 |
+
|
10346 |
+
/**
|
10347 |
+
* Creates the Google Maps map
|
10348 |
+
* @return void
|
10349 |
+
*/
|
10350 |
+
WPGMZA.GoogleMap.prototype.loadGoogleMap = function()
|
10351 |
+
{
|
10352 |
+
var self = this;
|
10353 |
+
var options = this.settings.toGoogleMapsOptions();
|
10354 |
+
|
10355 |
+
this.googleMap = new google.maps.Map(this.engineElement, options);
|
10356 |
+
|
10357 |
+
google.maps.event.addListener(this.googleMap, "bounds_changed", function() {
|
10358 |
+
self.onBoundsChanged();
|
10359 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10360 |
|
10361 |
+
if(this.settings.bicycle == 1)
|
10362 |
+
this.enableBicycleLayer(true);
|
10363 |
+
if(this.settings.traffic == 1)
|
10364 |
+
this.enableTrafficLayer(true);
|
10365 |
+
if(this.settings.transport_layer)
|
10366 |
+
this.enablePublicTransportLayer(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10367 |
|
10368 |
this.showPointsOfInterest(this.settings.wpgmza_show_point_of_interest);
|
10369 |
|
10636 |
}
|
10637 |
|
10638 |
/**
|
10639 |
+
* Fit the map boundaries to visible markers
|
10640 |
+
* @return void
|
10641 |
+
*/
|
10642 |
+
WPGMZA.GoogleMap.prototype.fitBoundsToVisibleMarkers = function()
|
10643 |
+
{
|
10644 |
+
var bounds = new google.maps.LatLngBounds();
|
10645 |
+
for(var i = 0; i < this.markers.length; i++)
|
10646 |
+
{
|
10647 |
+
if(markers[i].getVisible())
|
10648 |
+
bounds.extend(markers[i].getPosition());
|
10649 |
+
}
|
10650 |
+
this.googleMap.fitBounds(bounds);
|
10651 |
+
}
|
10652 |
+
|
10653 |
+
/**
|
10654 |
+
* Enables / disables the bicycle layer
|
10655 |
+
* @param enable boolean, enable or not
|
10656 |
+
* @return void
|
10657 |
+
*/
|
10658 |
+
WPGMZA.GoogleMap.prototype.enableBicycleLayer = function(enable)
|
10659 |
+
{
|
10660 |
+
if(!this.bicycleLayer)
|
10661 |
+
this.bicycleLayer = new google.maps.BicyclingLayer();
|
10662 |
+
|
10663 |
+
this.bicycleLayer.setMap(
|
10664 |
+
enable ? this.googleMap : null
|
10665 |
+
);
|
10666 |
+
}
|
10667 |
+
|
10668 |
+
/**
|
10669 |
+
* Enables / disables the bicycle layer
|
10670 |
+
* @param enable boolean, enable or not
|
10671 |
+
* @return void
|
10672 |
+
*/
|
10673 |
+
WPGMZA.GoogleMap.prototype.enableTrafficLayer = function(enable)
|
10674 |
+
{
|
10675 |
+
if(!this.trafficLayer)
|
10676 |
+
this.trafficLayer = new google.maps.TrafficLayer();
|
10677 |
+
|
10678 |
+
this.trafficLayer.setMap(
|
10679 |
+
enable ? this.googleMap : null
|
10680 |
+
);
|
10681 |
+
}
|
10682 |
+
|
10683 |
+
/**
|
10684 |
+
* Enables / disables the bicycle layer
|
10685 |
+
* @param enable boolean, enable or not
|
10686 |
+
* @return void
|
10687 |
+
*/
|
10688 |
+
WPGMZA.GoogleMap.prototype.enablePublicTransportLayer = function(enable)
|
10689 |
+
{
|
10690 |
+
if(!this.publicTransportLayer)
|
10691 |
+
this.publicTransportLayer = new google.maps.TransitLayer();
|
10692 |
+
|
10693 |
+
this.publicTransportLayer.setMap(
|
10694 |
+
enable ? this.googleMap : null
|
10695 |
+
);
|
10696 |
+
}
|
10697 |
+
|
10698 |
+
/**
|
10699 |
+
* Shows / hides points of interest
|
10700 |
+
* @param show boolean, enable or not
|
10701 |
+
* @return void
|
10702 |
+
*/
|
10703 |
+
WPGMZA.GoogleMap.prototype.showPointsOfInterest = function(show)
|
10704 |
+
{
|
10705 |
+
// TODO: This will bug the front end because there is no textarea with theme data
|
10706 |
+
var text = $("textarea[name='theme_data']").val();
|
10707 |
+
|
10708 |
+
if(!text)
|
10709 |
+
return;
|
10710 |
+
|
10711 |
+
var styles = JSON.parse(text);
|
10712 |
+
|
10713 |
+
styles.push({
|
10714 |
+
featureType: "poi",
|
10715 |
+
stylers: [
|
10716 |
+
{
|
10717 |
+
visibility: (show ? "on" : "off")
|
10718 |
+
}
|
10719 |
+
]
|
10720 |
+
});
|
10721 |
+
|
10722 |
+
this.googleMap.setOptions({styles: styles});
|
10723 |
+
}
|
10724 |
+
|
10725 |
+
/**
|
10726 |
+
* Gets the min zoom of the map
|
10727 |
+
* @return int
|
10728 |
+
*/
|
10729 |
+
WPGMZA.GoogleMap.prototype.getMinZoom = function()
|
10730 |
+
{
|
10731 |
+
return parseInt(this.settings.min_zoom);
|
10732 |
+
}
|
10733 |
+
|
10734 |
+
/**
|
10735 |
+
* Sets the min zoom of the map
|
10736 |
+
* @return void
|
10737 |
+
*/
|
10738 |
+
WPGMZA.GoogleMap.prototype.setMinZoom = function(value)
|
10739 |
+
{
|
10740 |
+
this.googleMap.setOptions({
|
10741 |
+
minZoom: value,
|
10742 |
+
maxZoom: this.getMaxZoom()
|
10743 |
+
});
|
10744 |
+
}
|
10745 |
+
|
10746 |
+
/**
|
10747 |
+
* Gets the min zoom of the map
|
10748 |
+
* @return int
|
10749 |
*/
|
10750 |
+
WPGMZA.GoogleMap.prototype.getMaxZoom = function()
|
10751 |
{
|
10752 |
+
return parseInt(this.settings.max_zoom);
|
|
|
|
|
|
|
|
|
|
|
|
|
10753 |
}
|
10754 |
|
10755 |
/**
|
10756 |
+
* Sets the min zoom of the map
|
|
|
10757 |
* @return void
|
10758 |
*/
|
10759 |
+
WPGMZA.GoogleMap.prototype.setMaxZoom = function(value)
|
10760 |
{
|
10761 |
+
this.googleMap.setOptions({
|
10762 |
+
minZoom: this.getMinZoom(),
|
10763 |
+
maxZoom: value
|
10764 |
+
});
|
10765 |
+
}
|
10766 |
+
|
10767 |
+
WPGMZA.GoogleMap.prototype.latLngToPixels = function(latLng)
|
10768 |
+
{
|
10769 |
+
var map = this.googleMap;
|
10770 |
+
var nativeLatLng = new google.maps.LatLng({
|
10771 |
+
lat: parseFloat(latLng.lat),
|
10772 |
+
lng: parseFloat(latLng.lng)
|
10773 |
+
});
|
10774 |
+
var topRight = map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast());
|
10775 |
+
var bottomLeft = map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest());
|
10776 |
+
var scale = Math.pow(2, map.getZoom());
|
10777 |
+
var worldPoint = map.getProjection().fromLatLngToPoint(nativeLatLng);
|
10778 |
+
return {
|
10779 |
+
x: (worldPoint.x - bottomLeft.x) * scale,
|
10780 |
+
y: (worldPoint.y - topRight.y) * scale
|
10781 |
+
};
|
10782 |
+
}
|
10783 |
+
|
10784 |
+
WPGMZA.GoogleMap.prototype.pixelsToLatLng = function(x, y)
|
10785 |
+
{
|
10786 |
+
if(y == undefined)
|
10787 |
+
{
|
10788 |
+
if("x" in x && "y" in x)
|
10789 |
+
{
|
10790 |
+
y = x.y;
|
10791 |
+
x = x.x;
|
10792 |
+
}
|
10793 |
+
else
|
10794 |
+
console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)");
|
10795 |
+
}
|
10796 |
|
10797 |
+
var map = this.googleMap;
|
10798 |
+
var topRight = map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast());
|
10799 |
+
var bottomLeft = map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest());
|
10800 |
+
var scale = Math.pow(2, map.getZoom());
|
10801 |
+
var worldPoint = new google.maps.Point(x / scale + bottomLeft.x, y / scale + topRight.y);
|
10802 |
+
var latLng = map.getProjection().fromPointToLatLng(worldPoint);
|
10803 |
+
return {
|
10804 |
+
lat: latLng.lat(),
|
10805 |
+
lng: latLng.lng()
|
10806 |
+
};
|
10807 |
}
|
10808 |
|
10809 |
/**
|
10810 |
+
* Handle the map element resizing
|
|
|
10811 |
* @return void
|
10812 |
*/
|
10813 |
+
WPGMZA.GoogleMap.prototype.onElementResized = function(event)
|
10814 |
{
|
10815 |
+
if(!this.googleMap)
|
10816 |
+
return;
|
10817 |
+
google.maps.event.trigger(this.googleMap, "resize");
|
10818 |
+
}
|
10819 |
+
|
10820 |
+
WPGMZA.GoogleMap.prototype.enableAllInteractions = function()
|
10821 |
+
{
|
10822 |
+
var options = {};
|
10823 |
+
|
10824 |
+
options.scrollwheel = true;
|
10825 |
+
options.draggable = true;
|
10826 |
+
options.disableDoubleClickZoom = false;
|
10827 |
|
10828 |
+
this.googleMap.setOptions(options);
|
|
|
|
|
10829 |
}
|
10830 |
|
10831 |
+
});
|
10832 |
+
|
10833 |
+
// js/v8/google-maps/google-marker.js
|
10834 |
+
/**
|
10835 |
+
* @namespace WPGMZA
|
10836 |
+
* @module GoogleMarker
|
10837 |
+
* @requires WPGMZA.Marker
|
10838 |
+
* @pro-requires WPGMZA.ProMarker
|
10839 |
+
*/
|
10840 |
+
jQuery(function($) {
|
10841 |
+
|
10842 |
+
var Parent;
|
10843 |
+
|
10844 |
+
WPGMZA.GoogleMarker = function(options)
|
10845 |
+
{
|
10846 |
+
var self = this;
|
10847 |
+
|
10848 |
+
Parent.call(this, options);
|
10849 |
+
|
10850 |
+
var settings = {};
|
10851 |
+
if(options)
|
10852 |
+
{
|
10853 |
+
for(var name in options)
|
10854 |
+
{
|
10855 |
+
if(options[name] instanceof WPGMZA.LatLng)
|
10856 |
+
{
|
10857 |
+
settings[name] = options[name].toGoogleLatLng();
|
10858 |
+
}
|
10859 |
+
else if(options[name] instanceof WPGMZA.Map || name == "icon")
|
10860 |
+
{
|
10861 |
+
// NB: Ignore map here, it's not a google.maps.Map, Google would throw an exception
|
10862 |
+
// NB: Ignore icon here, it conflicts with updateIcon in Pro
|
10863 |
+
}
|
10864 |
+
else
|
10865 |
+
settings[name] = options[name];
|
10866 |
+
}
|
10867 |
+
}
|
10868 |
+
|
10869 |
+
this.googleMarker = new google.maps.Marker(settings);
|
10870 |
+
this.googleMarker.wpgmzaMarker = this;
|
10871 |
+
|
10872 |
+
this.googleFeature = this.googleMarker;
|
10873 |
+
|
10874 |
+
this.googleMarker.setPosition(new google.maps.LatLng({
|
10875 |
+
lat: parseFloat(this.lat),
|
10876 |
+
lng: parseFloat(this.lng)
|
10877 |
+
}));
|
10878 |
+
|
10879 |
+
if(this.anim)
|
10880 |
+
this.googleMarker.setAnimation(this.anim);
|
10881 |
+
if(this.animation)
|
10882 |
+
this.googleMarker.setAnimation(this.animation);
|
10883 |
+
|
10884 |
+
google.maps.event.addListener(this.googleMarker, "click", function() {
|
10885 |
+
self.dispatchEvent("click");
|
10886 |
+
self.dispatchEvent("select");
|
10887 |
+
});
|
10888 |
+
|
10889 |
+
google.maps.event.addListener(this.googleMarker, "mouseover", function() {
|
10890 |
+
self.dispatchEvent("mouseover");
|
10891 |
+
});
|
10892 |
+
|
10893 |
+
google.maps.event.addListener(this.googleMarker, "dragend", function() {
|
10894 |
+
var googleMarkerPosition = self.googleMarker.getPosition();
|
10895 |
+
|
10896 |
+
self.setPosition({
|
10897 |
+
lat: googleMarkerPosition.lat(),
|
10898 |
+
lng: googleMarkerPosition.lng()
|
10899 |
+
});
|
10900 |
+
|
10901 |
+
self.dispatchEvent({
|
10902 |
+
type: "dragend",
|
10903 |
+
latLng: self.getPosition()
|
10904 |
+
});
|
10905 |
+
|
10906 |
+
self.trigger("change");
|
10907 |
+
});
|
10908 |
+
|
10909 |
+
this.setOptions(settings);
|
10910 |
+
this.trigger("init");
|
10911 |
+
}
|
10912 |
+
|
10913 |
+
if(WPGMZA.isProVersion())
|
10914 |
+
Parent = WPGMZA.ProMarker;
|
10915 |
+
else
|
10916 |
+
Parent = WPGMZA.Marker;
|
10917 |
+
WPGMZA.GoogleMarker.prototype = Object.create(Parent.prototype);
|
10918 |
+
WPGMZA.GoogleMarker.prototype.constructor = WPGMZA.GoogleMarker;
|
10919 |
+
|
10920 |
+
Object.defineProperty(WPGMZA.GoogleMarker.prototype, "opacity", {
|
10921 |
+
|
10922 |
+
"get": function() {
|
10923 |
+
return this._opacity;
|
10924 |
+
},
|
10925 |
+
|
10926 |
+
"set": function(value) {
|
10927 |
+
this._opacity = value;
|
10928 |
+
this.googleMarker.setOpacity(value);
|
10929 |
+
}
|
10930 |
+
|
10931 |
+
});
|
10932 |
+
|
10933 |
+
WPGMZA.GoogleMarker.prototype.setLabel = function(label)
|
10934 |
+
{
|
10935 |
+
if(!label)
|
10936 |
+
{
|
10937 |
+
this.googleMarker.setLabel(null);
|
10938 |
+
return;
|
10939 |
+
}
|
10940 |
+
|
10941 |
+
this.googleMarker.setLabel({
|
10942 |
+
text: label
|
10943 |
+
});
|
10944 |
+
|
10945 |
+
if(!this.googleMarker.getIcon())
|
10946 |
+
this.googleMarker.setIcon(WPGMZA.settings.default_marker_icon);
|
10947 |
+
}
|
10948 |
+
|
10949 |
+
/**
|
10950 |
+
* Sets the position of the marker
|
10951 |
+
* @return void
|
10952 |
+
*/
|
10953 |
+
WPGMZA.GoogleMarker.prototype.setPosition = function(latLng)
|
10954 |
+
{
|
10955 |
+
Parent.prototype.setPosition.call(this, latLng);
|
10956 |
+
this.googleMarker.setPosition({
|
10957 |
+
lat: this.lat,
|
10958 |
+
lng: this.lng
|
10959 |
+
});
|
10960 |
+
}
|
10961 |
+
|
10962 |
+
/**
|
10963 |
+
* Sets the position offset of a marker
|
10964 |
+
* @return void
|
10965 |
+
*/
|
10966 |
+
WPGMZA.GoogleMarker.prototype.updateOffset = function()
|
10967 |
+
{
|
10968 |
+
var self = this;
|
10969 |
+
var icon = this.googleMarker.getIcon();
|
10970 |
+
var img = new Image();
|
10971 |
+
var params;
|
10972 |
+
var x = this._offset.x;
|
10973 |
+
var y = this._offset.y;
|
10974 |
+
|
10975 |
+
if(!icon)
|
10976 |
+
icon = WPGMZA.settings.default_marker_icon;
|
10977 |
+
|
10978 |
+
if(typeof icon == "string")
|
10979 |
+
params = {
|
10980 |
+
url: icon
|
10981 |
+
};
|
10982 |
+
else
|
10983 |
+
params = icon;
|
10984 |
+
|
10985 |
+
img.onload = function()
|
10986 |
+
{
|
10987 |
+
var defaultAnchor = {
|
10988 |
+
x: img.width / 2,
|
10989 |
+
y: img.height
|
10990 |
+
};
|
10991 |
+
|
10992 |
+
params.anchor = new google.maps.Point(defaultAnchor.x - x, defaultAnchor.y - y);
|
10993 |
+
|
10994 |
+
self.googleMarker.setIcon(params);
|
10995 |
+
}
|
10996 |
+
|
10997 |
+
img.src = params.url;
|
10998 |
+
}
|
10999 |
+
|
11000 |
+
WPGMZA.GoogleMarker.prototype.setOptions = function(options)
|
11001 |
+
{
|
11002 |
+
this.googleMarker.setOptions(options);
|
11003 |
+
}
|
11004 |
+
|
11005 |
+
/**
|
11006 |
+
* Set the marker animation
|
11007 |
+
* @return void
|
11008 |
+
*/
|
11009 |
+
WPGMZA.GoogleMarker.prototype.setAnimation = function(animation)
|
11010 |
+
{
|
11011 |
+
Parent.prototype.setAnimation.call(this, animation);
|
11012 |
+
this.googleMarker.setAnimation(animation);
|
11013 |
+
}
|
11014 |
+
|
11015 |
+
/**
|
11016 |
+
* Sets the visibility of the marker
|
11017 |
+
* @return void
|
11018 |
+
*/
|
11019 |
+
WPGMZA.GoogleMarker.prototype.setVisible = function(visible)
|
11020 |
+
{
|
11021 |
+
Parent.prototype.setVisible.call(this, visible);
|
11022 |
+
|
11023 |
+
this.googleMarker.setVisible(visible ? true : false);
|
11024 |
+
}
|
11025 |
+
|
11026 |
+
WPGMZA.GoogleMarker.prototype.getVisible = function(visible)
|
11027 |
+
{
|
11028 |
+
return this.googleMarker.getVisible();
|
11029 |
+
}
|
11030 |
+
|
11031 |
+
WPGMZA.GoogleMarker.prototype.setDraggable = function(draggable)
|
11032 |
+
{
|
11033 |
+
this.googleMarker.setDraggable(draggable);
|
11034 |
+
}
|
11035 |
+
|
11036 |
+
WPGMZA.GoogleMarker.prototype.setOpacity = function(opacity)
|
11037 |
+
{
|
11038 |
+
this.googleMarker.setOpacity(opacity);
|
11039 |
+
}
|
11040 |
+
|
11041 |
+
});
|
11042 |
+
|
11043 |
+
// js/v8/google-maps/google-modern-store-locator-circle.js
|
11044 |
+
/**
|
11045 |
+
* @namespace WPGMZA
|
11046 |
+
* @module GoogleModernStoreLocatorCircle
|
11047 |
+
* @requires WPGMZA.ModernStoreLocatorCircle
|
11048 |
+
*/
|
11049 |
+
jQuery(function($) {
|
11050 |
+
|
11051 |
+
WPGMZA.GoogleModernStoreLocatorCircle = function(map, settings)
|
11052 |
+
{
|
11053 |
+
var self = this;
|
11054 |
+
|
11055 |
+
WPGMZA.ModernStoreLocatorCircle.call(this, map, settings);
|
11056 |
+
|
11057 |
+
this.intervalID = setInterval(function() {
|
11058 |
+
|
11059 |
+
var mapSize = {
|
11060 |
+
width: $(self.mapElement).width(),
|
11061 |
+
height: $(self.mapElement).height()
|
11062 |
+
};
|
11063 |
+
|
11064 |
+
if(mapSize.width == self.mapSize.width && mapSize.height == self.mapSize.height)
|
11065 |
+
return;
|
11066 |
+
|
11067 |
+
self.canvasLayer.resize_();
|
11068 |
+
self.canvasLayer.draw();
|
11069 |
+
|
11070 |
+
self.mapSize = mapSize;
|
11071 |
+
|
11072 |
+
}, 1000);
|
11073 |
+
|
11074 |
+
$(document).bind('webkitfullscreenchange mozfullscreenchange fullscreenchange', function() {
|
11075 |
+
|
11076 |
+
self.canvasLayer.resize_();
|
11077 |
+
self.canvasLayer.draw();
|
11078 |
+
|
11079 |
+
});
|
11080 |
+
}
|
11081 |
+
|
11082 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype = Object.create(WPGMZA.ModernStoreLocatorCircle.prototype);
|
11083 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.constructor = WPGMZA.GoogleModernStoreLocatorCircle;
|
11084 |
+
|
11085 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.initCanvasLayer = function()
|
11086 |
+
{
|
11087 |
+
var self = this;
|
11088 |
+
|
11089 |
+
if(this.canvasLayer)
|
11090 |
+
{
|
11091 |
+
this.canvasLayer.setMap(null);
|
11092 |
+
this.canvasLayer.setAnimate(false);
|
11093 |
+
}
|
11094 |
+
|
11095 |
+
this.canvasLayer = new CanvasLayer({
|
11096 |
+
map: this.map.googleMap,
|
11097 |
+
resizeHandler: function(event) {
|
11098 |
+
self.onResize(event);
|
11099 |
+
},
|
11100 |
+
updateHandler: function(event) {
|
11101 |
+
self.onUpdate(event);
|
11102 |
+
},
|
11103 |
+
animate: true,
|
11104 |
+
resolutionScale: this.getResolutionScale()
|
11105 |
+
});
|
11106 |
+
}
|
11107 |
+
|
11108 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.setOptions = function(options)
|
11109 |
+
{
|
11110 |
+
WPGMZA.ModernStoreLocatorCircle.prototype.setOptions.call(this, options);
|
11111 |
+
|
11112 |
+
this.canvasLayer.scheduleUpdate();
|
11113 |
+
}
|
11114 |
+
|
11115 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.setPosition = function(position)
|
11116 |
+
{
|
11117 |
+
WPGMZA.ModernStoreLocatorCircle.prototype.setPosition.call(this, position);
|
11118 |
+
|
11119 |
+
this.canvasLayer.scheduleUpdate();
|
11120 |
+
}
|
11121 |
+
|
11122 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.setRadius = function(radius)
|
11123 |
+
{
|
11124 |
+
WPGMZA.ModernStoreLocatorCircle.prototype.setRadius.call(this, radius);
|
11125 |
+
|
11126 |
+
this.canvasLayer.scheduleUpdate();
|
11127 |
+
}
|
11128 |
+
|
11129 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.getTransformedRadius = function(km)
|
11130 |
+
{
|
11131 |
+
var multiplierAtEquator = 0.006395;
|
11132 |
+
var spherical = google.maps.geometry.spherical;
|
11133 |
+
|
11134 |
+
var center = this.settings.center;
|
11135 |
+
var equator = new WPGMZA.LatLng({
|
11136 |
+
lat: 0.0,
|
11137 |
+
lng: 0.0
|
11138 |
+
});
|
11139 |
+
var latitude = new WPGMZA.LatLng({
|
11140 |
+
lat: center.lat,
|
11141 |
+
lng: 0.0
|
11142 |
+
});
|
11143 |
+
|
11144 |
+
var offsetAtEquator = spherical.computeOffset(equator.toGoogleLatLng(), km * 1000, 90);
|
11145 |
+
var offsetAtLatitude = spherical.computeOffset(latitude.toGoogleLatLng(), km * 1000, 90);
|
11146 |
+
|
11147 |
+
var factor = offsetAtLatitude.lng() / offsetAtEquator.lng();
|
11148 |
+
var result = km * multiplierAtEquator * factor;
|
11149 |
+
|
11150 |
+
if(isNaN(result))
|
11151 |
+
throw new Error("here");
|
11152 |
+
|
11153 |
+
return result;
|
11154 |
+
}
|
11155 |
+
|
11156 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.getCanvasDimensions = function()
|
11157 |
+
{
|
11158 |
+
return {
|
11159 |
+
width: this.canvasLayer.canvas.width,
|
11160 |
+
height: this.canvasLayer.canvas.height
|
11161 |
+
};
|
11162 |
+
}
|
11163 |
+
|
11164 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.getWorldOriginOffset = function()
|
11165 |
+
{
|
11166 |
+
var projection = this.map.googleMap.getProjection();
|
11167 |
+
var position = projection.fromLatLngToPoint(this.canvasLayer.getTopLeft());
|
11168 |
+
|
11169 |
+
return {
|
11170 |
+
x: -position.x,
|
11171 |
+
y: -position.y
|
11172 |
+
};
|
11173 |
+
}
|
11174 |
+
|
11175 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.getCenterPixels = function()
|
11176 |
+
{
|
11177 |
+
var center = new WPGMZA.LatLng(this.settings.center);
|
11178 |
+
var projection = this.map.googleMap.getProjection();
|
11179 |
+
return projection.fromLatLngToPoint(center.toGoogleLatLng());
|
11180 |
+
}
|
11181 |
+
|
11182 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.getContext = function(type)
|
11183 |
+
{
|
11184 |
+
return this.canvasLayer.canvas.getContext("2d");
|
11185 |
+
}
|
11186 |
+
|
11187 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.getScale = function()
|
11188 |
+
{
|
11189 |
+
return Math.pow(2, this.map.getZoom()) * this.getResolutionScale();
|
11190 |
+
}
|
11191 |
+
|
11192 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.setVisible = function(visible)
|
11193 |
+
{
|
11194 |
+
WPGMZA.ModernStoreLocatorCircle.prototype.setVisible.call(this, visible);
|
11195 |
+
|
11196 |
+
this.canvasLayer.scheduleUpdate();
|
11197 |
+
}
|
11198 |
+
|
11199 |
+
WPGMZA.GoogleModernStoreLocatorCircle.prototype.destroy = function()
|
11200 |
+
{
|
11201 |
+
this.canvasLayer.setMap(null);
|
11202 |
+
this.canvasLayer = null;
|
11203 |
+
|
11204 |
+
clearInterval(this.intervalID);
|
11205 |
+
}
|
11206 |
+
|
11207 |
+
});
|
11208 |
+
|
11209 |
+
// js/v8/google-maps/google-modern-store-locator.js
|
11210 |
+
/**
|
11211 |
+
* @namespace WPGMZA
|
11212 |
+
* @module GoogleModernStoreLocator
|
11213 |
+
* @requires WPGMZA.ModernStoreLocator
|
11214 |
+
*/
|
11215 |
+
jQuery(function($) {
|
11216 |
+
|
11217 |
+
WPGMZA.GoogleModernStoreLocator = function(map_id) {
|
11218 |
+
var googleMap, self = this;
|
11219 |
+
|
11220 |
+
var map = this.map = WPGMZA.getMapByID(map_id);
|
11221 |
+
|
11222 |
+
WPGMZA.ModernStoreLocator.call(this, map_id);
|
11223 |
+
|
11224 |
+
var options = {
|
11225 |
+
fields: ["name", "formatted_address"],
|
11226 |
+
types: ["geocode"]
|
11227 |
+
};
|
11228 |
+
var restrict = map.settings["wpgmza_store_locator_restrict"];
|
11229 |
+
|
11230 |
+
this.addressInput = $(this.element).find(".addressInput, #addressInput")[0];
|
11231 |
+
|
11232 |
+
if(this.addressInput)
|
11233 |
+
{
|
11234 |
+
if(restrict && restrict.length)
|
11235 |
+
options.componentRestrictions = {
|
11236 |
+
country: restrict
|
11237 |
+
};
|
11238 |
+
|
11239 |
+
/*this.autoComplete = new google.maps.places.Autocomplete(
|
11240 |
+
this.addressInput,
|
11241 |
+
options
|
11242 |
+
);*/
|
11243 |
+
}
|
11244 |
+
|
11245 |
+
// Positioning for Google
|
11246 |
+
this.map.googleMap.controls[google.maps.ControlPosition.TOP_CENTER].push(this.element);
|
11247 |
+
}
|
11248 |
+
|
11249 |
+
WPGMZA.GoogleModernStoreLocator.prototype = Object.create(WPGMZA.ModernStoreLocator.prototype);
|
11250 |
+
WPGMZA.GoogleModernStoreLocator.prototype.constructor = WPGMZA.GoogleModernStoreLocator;
|
11251 |
+
|
11252 |
+
});
|
11253 |
+
|
11254 |
+
// js/v8/google-maps/google-polygon.js
|
11255 |
+
/**
|
11256 |
+
* @namespace WPGMZA
|
11257 |
+
* @module GooglePolygon
|
11258 |
+
* @requires WPGMZA.Polygon
|
11259 |
+
* @pro-requires WPGMZA.ProPolygon
|
11260 |
+
*/
|
11261 |
+
jQuery(function($) {
|
11262 |
+
|
11263 |
+
var Parent;
|
11264 |
|
11265 |
+
WPGMZA.GooglePolygon = function(options, googlePolygon)
|
|
|
|
|
|
|
|
|
|
|
11266 |
{
|
11267 |
+
var self = this;
|
|
|
11268 |
|
11269 |
+
if(!options)
|
11270 |
+
options = {};
|
11271 |
|
11272 |
+
Parent.call(this, options, googlePolygon);
|
11273 |
|
11274 |
+
if(googlePolygon)
|
11275 |
+
{
|
11276 |
+
this.googlePolygon = googlePolygon;
|
11277 |
+
}
|
11278 |
+
else
|
11279 |
+
{
|
11280 |
+
this.googlePolygon = new google.maps.Polygon();
|
11281 |
+
}
|
11282 |
|
11283 |
+
this.googleFeature = this.googlePolygon;
|
11284 |
+
|
11285 |
+
if(options && options.polydata)
|
11286 |
+
this.googlePolygon.setOptions({
|
11287 |
+
paths: this.parseGeometry(options.polydata)
|
11288 |
+
});
|
11289 |
+
|
11290 |
+
this.googlePolygon.wpgmzaPolygon = this;
|
11291 |
+
|
11292 |
+
if(options)
|
11293 |
+
this.setOptions(options);
|
11294 |
+
|
11295 |
+
google.maps.event.addListener(this.googlePolygon, "click", function() {
|
11296 |
+
self.dispatchEvent({type: "click"});
|
11297 |
+
});
|
11298 |
}
|
11299 |
|
11300 |
+
if(WPGMZA.isProVersion())
|
11301 |
+
Parent = WPGMZA.ProPolygon;
|
11302 |
+
else
|
11303 |
+
Parent = WPGMZA.Polygon;
|
11304 |
+
|
11305 |
+
WPGMZA.GooglePolygon.prototype = Object.create(Parent.prototype);
|
11306 |
+
WPGMZA.GooglePolygon.prototype.constructor = WPGMZA.GooglePolygon;
|
|
|
11307 |
|
11308 |
+
WPGMZA.GooglePolygon.prototype.updateNativeFeature = function()
|
|
|
|
|
|
|
|
|
11309 |
{
|
11310 |
+
this.googlePolygon.setOptions(this.getScalarProperties());
|
|
|
|
|
|
|
11311 |
}
|
11312 |
|
11313 |
/**
|
11314 |
+
* Returns true if the polygon is editable
|
11315 |
+
* @return void
|
11316 |
*/
|
11317 |
+
WPGMZA.GooglePolygon.prototype.getEditable = function()
|
11318 |
{
|
11319 |
+
return this.googlePolygon.getOptions().editable;
|
11320 |
}
|
11321 |
|
11322 |
/**
|
11323 |
+
* Sets the editable state of the polygon
|
11324 |
* @return void
|
11325 |
*/
|
11326 |
+
WPGMZA.GooglePolygon.prototype.setEditable = function(value)
|
11327 |
{
|
11328 |
+
var self = this;
|
11329 |
+
|
11330 |
+
this.googlePolygon.setOptions({editable: value});
|
11331 |
+
|
11332 |
+
if(value)
|
11333 |
+
{
|
11334 |
+
// TODO: Unbind these when value is false
|
11335 |
+
this.googlePolygon.getPaths().forEach(function(path, index) {
|
11336 |
+
|
11337 |
+
var events = [
|
11338 |
+
"insert_at",
|
11339 |
+
"remove_at",
|
11340 |
+
"set_at"
|
11341 |
+
];
|
11342 |
+
|
11343 |
+
events.forEach(function(name) {
|
11344 |
+
google.maps.event.addListener(path, name, function() {
|
11345 |
+
self.trigger("change");
|
11346 |
+
})
|
11347 |
+
});
|
11348 |
+
|
11349 |
+
});
|
11350 |
+
|
11351 |
+
// TODO: Add dragging and listen for dragend
|
11352 |
+
google.maps.event.addListener(this.googlePolygon, "dragend", function(event) {
|
11353 |
+
self.trigger("change");
|
11354 |
+
});
|
11355 |
+
|
11356 |
+
google.maps.event.addListener(this.googlePolygon, "click", function(event) {
|
11357 |
+
|
11358 |
+
if(!WPGMZA.altKeyDown)
|
11359 |
+
return;
|
11360 |
+
|
11361 |
+
var path = this.getPath();
|
11362 |
+
path.removeAt(event.vertex);
|
11363 |
+
self.trigger("change");
|
11364 |
+
|
11365 |
+
});
|
11366 |
+
}
|
11367 |
}
|
11368 |
|
11369 |
+
WPGMZA.GooglePolygon.prototype.setDraggable = function(value)
|
11370 |
{
|
11371 |
+
this.googlePolygon.setDraggable(value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11372 |
}
|
11373 |
|
11374 |
+
/**
|
11375 |
+
* Returns the polygon represented by a JSON object
|
11376 |
+
* @return object
|
11377 |
+
*/
|
11378 |
+
WPGMZA.GooglePolygon.prototype.getGeometry = function()
|
11379 |
{
|
11380 |
+
var result = [];
|
11381 |
+
|
11382 |
+
// TODO: Support holes using multiple paths
|
11383 |
+
var path = this.googlePolygon.getPath();
|
11384 |
+
for(var i = 0; i < path.getLength(); i++)
|
11385 |
{
|
11386 |
+
var latLng = path.getAt(i);
|
11387 |
+
result.push({
|
11388 |
+
lat: latLng.lat(),
|
11389 |
+
lng: latLng.lng()
|
11390 |
+
});
|
|
|
|
|
11391 |
}
|
11392 |
|
11393 |
+
return result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11394 |
}
|
11395 |
|
11396 |
+
});
|
11397 |
+
|
11398 |
+
// js/v8/google-maps/google-polyline.js
|
11399 |
+
/**
|
11400 |
+
* @namespace WPGMZA
|
11401 |
+
* @module GooglePolyline
|
11402 |
+
* @requires WPGMZA.Polyline
|
11403 |
+
*/
|
11404 |
+
jQuery(function($) {
|
11405 |
+
|
11406 |
+
WPGMZA.GooglePolyline = function(options, googlePolyline) {
|
11407 |
+
|
11408 |
+
var self = this;
|
11409 |
+
|
11410 |
+
WPGMZA.Polyline.call(this, options, googlePolyline);
|
11411 |
+
|
11412 |
+
if(googlePolyline) {
|
11413 |
+
this.googlePolyline = googlePolyline;
|
11414 |
+
} else {
|
11415 |
+
this.googlePolyline = new google.maps.Polyline(this.settings);
|
11416 |
+
}
|
11417 |
+
|
11418 |
+
|
11419 |
+
this.googleFeature = this.googlePolyline;
|
11420 |
+
|
11421 |
+
if(options && options.polydata)
|
11422 |
+
{
|
11423 |
+
|
11424 |
+
var path = this.parseGeometry(options.polydata);
|
11425 |
+
this.googlePolyline.setPath(path);
|
11426 |
+
}
|
11427 |
+
|
11428 |
+
this.googlePolyline.wpgmzaPolyline = this;
|
11429 |
+
|
11430 |
+
if(options)
|
11431 |
+
this.setOptions(options);
|
11432 |
+
|
11433 |
+
google.maps.event.addListener(this.googlePolyline, "click", function() {
|
11434 |
+
self.dispatchEvent({type: "click"});
|
11435 |
+
});
|
11436 |
+
}
|
11437 |
+
|
11438 |
+
WPGMZA.GooglePolyline.prototype = Object.create(WPGMZA.Polyline.prototype);
|
11439 |
+
WPGMZA.GooglePolyline.prototype.constructor = WPGMZA.GooglePolyline;
|
11440 |
+
|
11441 |
+
WPGMZA.GooglePolyline.prototype.updateNativeFeature = function() {
|
11442 |
+
this.googlePolyline.setOptions(this.getScalarProperties());
|
11443 |
+
}
|
11444 |
+
|
11445 |
+
WPGMZA.GooglePolyline.prototype.setEditable = function(value) {
|
11446 |
+
var self = this;
|
11447 |
+
|
11448 |
+
this.googlePolyline.setOptions({editable: value});
|
11449 |
+
|
11450 |
+
|
11451 |
+
|
11452 |
+
if (value) {
|
11453 |
+
// TODO: Unbind these when value is false
|
11454 |
+
var path = this.googlePolyline.getPath();
|
11455 |
+
var events = [
|
11456 |
+
"insert_at",
|
11457 |
+
"remove_at",
|
11458 |
+
"set_at"
|
11459 |
+
];
|
11460 |
+
|
11461 |
+
events.forEach(function(name) {
|
11462 |
+
google.maps.event.addListener(path, name, function() {
|
11463 |
+
self.trigger("change");
|
11464 |
+
})
|
11465 |
+
});
|
11466 |
+
|
11467 |
+
// TODO: Add dragging and listen for dragend
|
11468 |
+
google.maps.event.addListener(this.googlePolyline, "dragend", function(event) {
|
11469 |
+
self.trigger("change");
|
11470 |
+
});
|
11471 |
+
|
11472 |
+
google.maps.event.addListener(this.googlePolyline, "click", function(event) {
|
11473 |
+
if(!WPGMZA.altKeyDown)
|
11474 |
+
return;
|
11475 |
+
|
11476 |
+
var path = this.getPath();
|
11477 |
+
path.removeAt(event.vertex);
|
11478 |
+
self.trigger("change");
|
11479 |
+
|
11480 |
+
});
|
11481 |
+
}
|
11482 |
+
}
|
11483 |
+
|
11484 |
+
WPGMZA.GooglePolyline.prototype.setDraggable = function(value) {
|
11485 |
+
this.googlePolyline.setOptions({draggable: value});
|
11486 |
+
}
|
11487 |
+
|
11488 |
+
WPGMZA.GooglePolyline.prototype.getGeometry = function() {
|
11489 |
+
|
11490 |
+
var result = [];
|
11491 |
+
|
11492 |
+
var path = this.googlePolyline.getPath();
|
11493 |
+
for(var i = 0; i < path.getLength(); i++)
|
11494 |
+
{
|
11495 |
+
var latLng = path.getAt(i);
|
11496 |
+
result.push({
|
11497 |
+
lat: latLng.lat(),
|
11498 |
+
lng: latLng.lng()
|
11499 |
+
});
|
11500 |
+
}
|
11501 |
+
|
11502 |
+
return result;
|
11503 |
+
}
|
11504 |
+
|
11505 |
+
});
|
11506 |
+
|
11507 |
+
// js/v8/google-maps/google-rectangle.js
|
11508 |
+
/**
|
11509 |
+
* @namespace WPGMZA
|
11510 |
+
* @module GoogleRectangle
|
11511 |
+
* @requires WPGMZA.Rectangle
|
11512 |
+
*/
|
11513 |
+
jQuery(function($) {
|
11514 |
+
|
11515 |
+
/**
|
11516 |
+
* Subclass, used when Google is the maps engine. <strong>Please <em>do not</em> call this constructor directly. Always use createInstance rather than instantiating this class directly.</strong> Using createInstance allows this class to be externally extensible.
|
11517 |
+
* @class WPGMZA.GoogleRectangle
|
11518 |
+
* @constructor WPGMZA.GoogleRectangle
|
11519 |
+
* @memberof WPGMZA
|
11520 |
+
* @augments WPGMZA.Rectangle
|
11521 |
+
* @see WPGMZA.Rectangle.createInstance
|
11522 |
+
*/
|
11523 |
+
WPGMZA.GoogleRectangle = function(options, googleRectangle)
|
11524 |
+
{
|
11525 |
+
var self = this;
|
11526 |
+
|
11527 |
+
if(!options)
|
11528 |
+
options = {};
|
11529 |
+
|
11530 |
+
WPGMZA.Rectangle.call(this, options, googleRectangle);
|
11531 |
+
|
11532 |
+
if(googleRectangle)
|
11533 |
+
{
|
11534 |
+
this.googleRectangle = googleRectangle;
|
11535 |
+
|
11536 |
+
this.cornerA = options.cornerA = new WPGMZA.LatLng({
|
11537 |
+
lat: googleRectangle.getBounds().getNorthEast().lat(),
|
11538 |
+
lng: googleRectangle.getBounds().getSouthWest().lng(),
|
11539 |
+
});
|
11540 |
+
|
11541 |
+
this.cornerB = options.cornerB = new WPGMZA.LatLng({
|
11542 |
+
lat: googleRectangle.getBounds().getSouthWest().lat(),
|
11543 |
+
lng: googleRectangle.getBounds().getNorthEast().lng()
|
11544 |
+
});
|
11545 |
+
}
|
11546 |
+
else
|
11547 |
+
{
|
11548 |
+
this.googleRectangle = new google.maps.Rectangle();
|
11549 |
+
this.googleRectangle.wpgmzaRectangle = this;
|
11550 |
+
}
|
11551 |
+
|
11552 |
+
this.googleFeature = this.googleRectangle;
|
11553 |
+
|
11554 |
+
if(options)
|
11555 |
+
this.setOptions(options);
|
11556 |
+
|
11557 |
+
google.maps.event.addListener(this.googleRectangle, "click", function() {
|
11558 |
+
self.dispatchEvent({type: "click"});
|
11559 |
+
});
|
11560 |
+
}
|
11561 |
+
|
11562 |
+
WPGMZA.GoogleRectangle.prototype = Object.create(WPGMZA.Rectangle.prototype);
|
11563 |
+
WPGMZA.GoogleRectangle.prototype.constructor = WPGMZA.GoogleRectangle;
|
11564 |
+
|
11565 |
+
WPGMZA.GoogleRectangle.prototype.getBounds = function()
|
11566 |
+
{
|
11567 |
+
return WPGMZA.LatLngBounds.fromGoogleLatLngBounds( this.googleRectangle.getBounds() );
|
11568 |
+
}
|
11569 |
+
|
11570 |
+
WPGMZA.GoogleRectangle.prototype.setVisible = function(visible)
|
11571 |
+
{
|
11572 |
+
this.googleRectangle.setVisible(visible ? true : false);
|
11573 |
+
}
|
11574 |
+
|
11575 |
+
WPGMZA.GoogleRectangle.prototype.setDraggable = function(value)
|
11576 |
+
{
|
11577 |
+
this.googleRectangle.setDraggable(value ? true : false);
|
11578 |
+
}
|
11579 |
+
|
11580 |
+
WPGMZA.GoogleRectangle.prototype.setEditable = function(value)
|
11581 |
+
{
|
11582 |
+
var self = this;
|
11583 |
+
|
11584 |
+
this.googleRectangle.setEditable(value ? true : false);
|
11585 |
+
|
11586 |
+
if(value)
|
11587 |
+
{
|
11588 |
+
google.maps.event.addListener(this.googleRectangle, "bounds_changed", function(event) {
|
11589 |
+
self.trigger("change");
|
11590 |
+
});
|
11591 |
+
}
|
11592 |
+
}
|
11593 |
+
|
11594 |
+
WPGMZA.GoogleRectangle.prototype.setOptions = function(options)
|
11595 |
+
{
|
11596 |
+
WPGMZA.Rectangle.prototype.setOptions.apply(this, arguments);
|
11597 |
+
|
11598 |
+
if(options.cornerA && options.cornerB)
|
11599 |
+
{
|
11600 |
+
this.cornerA = new WPGMZA.LatLng(options.cornerA);
|
11601 |
+
this.cornerB = new WPGMZA.LatLng(options.cornerB);
|
11602 |
+
}
|
11603 |
+
}
|
11604 |
+
|
11605 |
+
WPGMZA.GoogleRectangle.prototype.updateNativeFeature = function()
|
11606 |
+
{
|
11607 |
+
var googleOptions = this.getScalarProperties();
|
11608 |
+
|
11609 |
+
var north = parseFloat(this.cornerA.lat);
|
11610 |
+
var west = parseFloat(this.cornerA.lng);
|
11611 |
+
var south = parseFloat(this.cornerB.lat);
|
11612 |
+
var east = parseFloat(this.cornerB.lng);
|
11613 |
+
|
11614 |
+
if(north && west && south && east){
|
11615 |
+
googleOptions.bounds = {
|
11616 |
+
north: north,
|
11617 |
+
west: west,
|
11618 |
+
south: south,
|
11619 |
+
east: east
|
11620 |
+
};
|
11621 |
+
|
11622 |
+
}
|
11623 |
+
|
11624 |
+
this.googleRectangle.setOptions(googleOptions);
|
11625 |
+
}
|
11626 |
+
|
11627 |
+
});
|
11628 |
+
|
11629 |
+
// js/v8/google-maps/google-text.js
|
11630 |
+
/**
|
11631 |
+
* @namespace WPGMZA
|
11632 |
+
* @module GoogleText
|
11633 |
+
* @requires WPGMZA.Text
|
11634 |
+
*/
|
11635 |
+
jQuery(function($) {
|
11636 |
+
|
11637 |
+
WPGMZA.GoogleText = function(options)
|
11638 |
+
{
|
11639 |
+
WPGMZA.Text.apply(this, arguments);
|
11640 |
+
|
11641 |
+
this.overlay = new WPGMZA.GoogleTextOverlay(options);
|
11642 |
+
}
|
11643 |
+
|
11644 |
+
WPGMZA.extend(WPGMZA.GoogleText, WPGMZA.Text);
|
11645 |
+
|
11646 |
+
});
|
11647 |
+
|
11648 |
+
// js/v8/google-maps/google-text-overlay.js
|
11649 |
+
/**
|
11650 |
+
* @namespace WPGMZA
|
11651 |
+
* @module GoogleTextOverlay
|
11652 |
+
* @requires WPGMZA.GoogleText
|
11653 |
+
*/
|
11654 |
+
jQuery(function($) {
|
11655 |
+
|
11656 |
+
WPGMZA.GoogleTextOverlay = function(options)
|
11657 |
+
{
|
11658 |
+
this.element = $("<div class='wpgmza-google-text-overlay'><div class='wpgmza-inner'></div></div>");
|
11659 |
+
|
11660 |
+
if(!options)
|
11661 |
+
options = {};
|
11662 |
+
|
11663 |
+
if(options.position)
|
11664 |
+
this.position = options.position;
|
11665 |
+
|
11666 |
+
if(options.text)
|
11667 |
+
this.element.find(".wpgmza-inner").text(options.text);
|
11668 |
+
|
11669 |
+
if(options.map)
|
11670 |
+
this.setMap(options.map.googleMap);
|
11671 |
+
}
|
11672 |
+
|
11673 |
+
if(window.google && google.maps && google.maps.OverlayView)
|
11674 |
+
WPGMZA.GoogleTextOverlay.prototype = new google.maps.OverlayView();
|
11675 |
+
|
11676 |
+
WPGMZA.GoogleTextOverlay.prototype.onAdd = function()
|
11677 |
+
{
|
11678 |
+
var overlayProjection = this.getProjection();
|
11679 |
+
var position = overlayProjection.fromLatLngToDivPixel(this.position.toGoogleLatLng());
|
11680 |
+
|
11681 |
+
this.element.css({
|
11682 |
+
position: "absolute",
|
11683 |
+
left: position.x + "px",
|
11684 |
+
top: position.y + "px",
|
11685 |
+
minWidth : "200px"
|
11686 |
+
});
|
11687 |
+
|
11688 |
+
var panes = this.getPanes();
|
11689 |
+
panes.floatPane.appendChild(this.element[0]);
|
11690 |
+
}
|
11691 |
+
|
11692 |
+
WPGMZA.GoogleTextOverlay.prototype.draw = function()
|
11693 |
+
{
|
11694 |
+
var overlayProjection = this.getProjection();
|
11695 |
+
var position = overlayProjection.fromLatLngToDivPixel(this.position.toGoogleLatLng());
|
11696 |
+
|
11697 |
+
this.element.css({
|
11698 |
+
position: "absolute",
|
11699 |
+
left: position.x + "px",
|
11700 |
+
top: position.y + "px",
|
11701 |
+
minWidth : "200px"
|
11702 |
+
});
|
11703 |
+
}
|
11704 |
+
|
11705 |
+
WPGMZA.GoogleTextOverlay.prototype.onRemove = function()
|
11706 |
+
{
|
11707 |
+
this.element.remove();
|
11708 |
+
}
|
11709 |
+
|
11710 |
+
WPGMZA.GoogleTextOverlay.prototype.hide = function()
|
11711 |
+
{
|
11712 |
+
this.element.hide();
|
11713 |
+
}
|
11714 |
+
|
11715 |
+
WPGMZA.GoogleTextOverlay.prototype.show = function()
|
11716 |
+
{
|
11717 |
+
this.element.show();
|
11718 |
+
}
|
11719 |
+
|
11720 |
+
WPGMZA.GoogleTextOverlay.prototype.toggle = function()
|
11721 |
+
{
|
11722 |
+
if(this.element.is(":visible"))
|
11723 |
+
this.element.hide();
|
11724 |
+
else
|
11725 |
+
this.element.show();
|
11726 |
+
}
|
11727 |
+
|
11728 |
+
});
|
11729 |
+
|
11730 |
+
// js/v8/google-maps/google-vertex-context-menu.js
|
11731 |
+
/**
|
11732 |
+
* @namespace WPGMZA
|
11733 |
+
* @module GoogleVertexContextMenu
|
11734 |
+
* @requires wpgmza_api_call
|
11735 |
+
*/
|
11736 |
+
jQuery(function($) {
|
11737 |
+
|
11738 |
+
if(WPGMZA.settings.engine != "google-maps")
|
11739 |
+
return;
|
11740 |
+
|
11741 |
+
if(WPGMZA.googleAPIStatus && WPGMZA.googleAPIStatus.code == "USER_CONSENT_NOT_GIVEN")
|
11742 |
+
return;
|
11743 |
+
|
11744 |
+
WPGMZA.GoogleVertexContextMenu = function(mapEditPage)
|
11745 |
+
{
|
11746 |
+
var self = this;
|
11747 |
+
|
11748 |
+
this.mapEditPage = mapEditPage;
|
11749 |
+
|
11750 |
+
this.element = document.createElement("div");
|
11751 |
+
this.element.className = "wpgmza-vertex-context-menu";
|
11752 |
+
this.element.innerHTML = "Delete";
|
11753 |
+
|
11754 |
+
google.maps.event.addDomListener(this.element, "click", function(event) {
|
11755 |
+
self.removeVertex();
|
11756 |
+
event.preventDefault();
|
11757 |
+
event.stopPropagation();
|
11758 |
+
return false;
|
11759 |
+
});
|
11760 |
+
}
|
11761 |
+
|
11762 |
+
WPGMZA.GoogleVertexContextMenu.prototype = new google.maps.OverlayView();
|
11763 |
+
|
11764 |
+
WPGMZA.GoogleVertexContextMenu.prototype.onAdd = function()
|
11765 |
+
{
|
11766 |
+
var self = this;
|
11767 |
+
var map = this.getMap();
|
11768 |
+
|
11769 |
+
this.getPanes().floatPane.appendChild(this.element);
|
11770 |
+
this.divListener = google.maps.event.addDomListener(map.getDiv(), "mousedown", function(e) {
|
11771 |
+
if(e.target != self.element)
|
11772 |
+
self.close();
|
11773 |
+
}, true);
|
11774 |
+
}
|
11775 |
+
|
11776 |
+
WPGMZA.GoogleVertexContextMenu.prototype.onRemove = function()
|
11777 |
+
{
|
11778 |
+
google.maps.event.removeListener(this.divListener);
|
11779 |
+
this.element.parentNode.removeChild(this.element);
|
11780 |
+
|
11781 |
+
this.set("position");
|
11782 |
+
this.set("path");
|
11783 |
+
this.set("vertex");
|
11784 |
+
}
|
11785 |
+
|
11786 |
+
WPGMZA.GoogleVertexContextMenu.prototype.open = function(map, path, vertex)
|
11787 |
+
{
|
11788 |
+
this.set('position', path.getAt(vertex));
|
11789 |
+
this.set('path', path);
|
11790 |
+
this.set('vertex', vertex);
|
11791 |
+
this.setMap(map);
|
11792 |
+
this.draw();
|
11793 |
+
}
|
11794 |
+
|
11795 |
+
WPGMZA.GoogleVertexContextMenu.prototype.close = function()
|
11796 |
+
{
|
11797 |
+
this.setMap(null);
|
11798 |
+
}
|
11799 |
+
|
11800 |
+
WPGMZA.GoogleVertexContextMenu.prototype.draw = function()
|
11801 |
+
{
|
11802 |
+
var position = this.get('position');
|
11803 |
+
var projection = this.getProjection();
|
11804 |
+
|
11805 |
+
if (!position || !projection)
|
11806 |
+
return;
|
11807 |
+
|
11808 |
+
var point = projection.fromLatLngToDivPixel(position);
|
11809 |
+
this.element.style.top = point.y + 'px';
|
11810 |
+
this.element.style.left = point.x + 'px';
|
11811 |
+
}
|
11812 |
+
|
11813 |
+
WPGMZA.GoogleVertexContextMenu.prototype.removeVertex = function()
|
11814 |
+
{
|
11815 |
+
var path = this.get('path');
|
11816 |
+
var vertex = this.get('vertex');
|
11817 |
+
|
11818 |
+
if (!path || vertex == undefined) {
|
11819 |
+
this.close();
|
11820 |
+
return;
|
11821 |
+
}
|
11822 |
+
|
11823 |
+
path.removeAt(vertex);
|
11824 |
+
this.close();
|
11825 |
+
}
|
11826 |
+
|
11827 |
+
});
|
11828 |
+
|
11829 |
+
// js/v8/map-edit-page/feature-panel.js
|
11830 |
+
/**
|
11831 |
+
* @namespace WPGMZA
|
11832 |
+
* @module FeaturePanel
|
11833 |
+
* @requires WPGMZA.EventDispatcher
|
11834 |
+
*/
|
11835 |
+
jQuery(function($) {
|
11836 |
+
|
11837 |
+
WPGMZA.FeaturePanel = function(element, mapEditPage)
|
11838 |
+
{
|
11839 |
+
var self = this;
|
11840 |
+
|
11841 |
+
WPGMZA.EventDispatcher.apply(this, arguments);
|
11842 |
+
|
11843 |
+
this.map = mapEditPage.map;
|
11844 |
+
this.drawingManager = mapEditPage.drawingManager;
|
11845 |
+
|
11846 |
+
this.feature = null;
|
11847 |
+
|
11848 |
+
this.element = element;
|
11849 |
+
|
11850 |
+
this.initDefaults();
|
11851 |
+
this.setMode(WPGMZA.FeaturePanel.MODE_ADD);
|
11852 |
+
|
11853 |
+
this.drawingInstructionsElement = $(this.element).find(".wpgmza-feature-drawing-instructions");
|
11854 |
+
this.drawingInstructionsElement.detach();
|
11855 |
+
|
11856 |
+
this.editingInstructionsElement = $(this.element).find(".wpgmza-feature-editing-instructions");
|
11857 |
+
this.editingInstructionsElement.detach();
|
11858 |
+
|
11859 |
+
$("#wpgmaps_tabs_markers").on("tabsactivate", function(event, ui) {
|
11860 |
+
if($.contains(ui.newPanel[0], self.element[0]))
|
11861 |
+
self.onTabActivated(event);
|
11862 |
+
});
|
11863 |
+
|
11864 |
+
$("#wpgmaps_tabs_markers").on("tabsactivate", function(event, ui) {
|
11865 |
+
if($.contains(ui.oldPanel[0], self.element[0]))
|
11866 |
+
self.onTabDeactivated(event);
|
11867 |
+
});
|
11868 |
+
|
11869 |
+
// NB: Removed to get styling closer
|
11870 |
+
/*$(element).closest(".wpgmza-accordion").find("h3[data-add-caption]").on("click", function(event) {
|
11871 |
+
if(self.mode == "add")
|
11872 |
+
self.onAddFeature(event);
|
11873 |
+
});*/
|
11874 |
+
|
11875 |
+
$(document.body).on("click", "[data-edit-" + this.featureType + "-id]", function(event) {
|
11876 |
+
self.onEditFeature(event);
|
11877 |
+
});
|
11878 |
+
|
11879 |
+
$(document.body).on("click", "[data-delete-" + this.featureType + "-id]", function(event) {
|
11880 |
+
self.onDeleteFeature(event);
|
11881 |
+
});
|
11882 |
+
|
11883 |
+
$(this.element).find(".wpgmza-save-feature").on("click", function(event) {
|
11884 |
+
self.onSave(event);
|
11885 |
+
});
|
11886 |
+
|
11887 |
+
this.drawingManager.on(self.drawingManagerCompleteEvent, function(event) {
|
11888 |
+
self.onDrawingComplete(event);
|
11889 |
+
});
|
11890 |
+
|
11891 |
+
this.drawingManager.on("drawingmodechanged", function(event) {
|
11892 |
+
self.onDrawingModeChanged(event);
|
11893 |
+
});
|
11894 |
+
|
11895 |
+
$(this.element).on("change input", function(event) {
|
11896 |
+
self.onPropertyChanged(event);
|
11897 |
+
});
|
11898 |
+
}
|
11899 |
+
|
11900 |
+
WPGMZA.extend(WPGMZA.FeaturePanel, WPGMZA.EventDispatcher);
|
11901 |
+
|
11902 |
+
WPGMZA.FeaturePanel.MODE_ADD = "add";
|
11903 |
+
WPGMZA.FeaturePanel.MODE_EDIT = "edit";
|
11904 |
+
|
11905 |
+
WPGMZA.FeaturePanel.prevEditableFeature = null;
|
11906 |
+
|
11907 |
+
Object.defineProperty(WPGMZA.FeaturePanel.prototype, "featureType", {
|
11908 |
+
|
11909 |
+
"get": function() {
|
11910 |
+
return $(this.element).attr("data-wpgmza-feature-type");
|
11911 |
+
}
|
11912 |
+
|
11913 |
+
});
|
11914 |
+
|
11915 |
+
Object.defineProperty(WPGMZA.FeaturePanel.prototype, "drawingManagerCompleteEvent", {
|
11916 |
+
|
11917 |
+
"get": function() {
|
11918 |
+
return this.featureType + "complete";
|
11919 |
+
}
|
11920 |
+
|
11921 |
+
});
|
11922 |
+
|
11923 |
+
Object.defineProperty(WPGMZA.FeaturePanel.prototype, "featureDataTable", {
|
11924 |
+
|
11925 |
+
"get": function() {
|
11926 |
+
return $("[data-wpgmza-datatable][data-wpgmza-feature-type='" + this.featureType + "']")[0].wpgmzaDataTable;
|
11927 |
+
}
|
11928 |
+
|
11929 |
+
});
|
11930 |
+
|
11931 |
+
Object.defineProperty(WPGMZA.FeaturePanel.prototype, "featureAccordion", {
|
11932 |
+
|
11933 |
+
"get": function() {
|
11934 |
+
return $(this.element).closest(".wpgmza-accordion");
|
11935 |
+
}
|
11936 |
+
|
11937 |
+
});
|
11938 |
+
|
11939 |
+
Object.defineProperty(WPGMZA.FeaturePanel.prototype, "map", {
|
11940 |
+
|
11941 |
+
"get": function() {
|
11942 |
+
return WPGMZA.mapEditPage.map;
|
11943 |
+
}
|
11944 |
+
|
11945 |
+
});
|
11946 |
+
|
11947 |
+
Object.defineProperty(WPGMZA.FeaturePanel.prototype, "mode", {
|
11948 |
+
|
11949 |
+
"get": function() {
|
11950 |
+
return this._mode;
|
11951 |
+
}
|
11952 |
+
|
11953 |
+
});
|
11954 |
+
|
11955 |
+
WPGMZA.FeaturePanel.prototype.initPreloader = function()
|
11956 |
+
{
|
11957 |
+
if(this.preloader)
|
11958 |
+
return;
|
11959 |
+
|
11960 |
+
this.preloader = $(WPGMZA.preloaderHTML);
|
11961 |
+
this.preloader.hide();
|
11962 |
+
|
11963 |
+
$(this.element).append(this.preloader);
|
11964 |
+
}
|
11965 |
+
|
11966 |
+
WPGMZA.FeaturePanel.prototype.initDataTable = function()
|
11967 |
+
{
|
11968 |
+
var el = $(this.element).find("[data-wpgmza-datatable][data-wpgmza-rest-api-route]");
|
11969 |
+
|
11970 |
+
this[this.featureType + "AdminDataTable"] = new WPGMZA.AdminFeatureDataTable( el );
|
11971 |
+
}
|
11972 |
+
|
11973 |
+
WPGMZA.FeaturePanel.prototype.initDefaults = function()
|
11974 |
+
{
|
11975 |
+
$(this.element).find("[data-ajax-name]:not([type='radio'])").each(function(index, el) {
|
11976 |
+
|
11977 |
+
var val = $(el).val();
|
11978 |
+
|
11979 |
+
if(!val)
|
11980 |
+
return;
|
11981 |
+
|
11982 |
+
$(el).attr("data-default-value", val);
|
11983 |
+
|
11984 |
+
});
|
11985 |
+
}
|
11986 |
+
|
11987 |
+
WPGMZA.FeaturePanel.prototype.setCaptionType = function(type, id)
|
11988 |
+
{
|
11989 |
+
var args = arguments;
|
11990 |
+
var icons = {
|
11991 |
+
add: "fa-plus-circle",
|
11992 |
+
save: "fa-pencil-square-o"
|
11993 |
+
};
|
11994 |
+
|
11995 |
+
switch(type)
|
11996 |
+
{
|
11997 |
+
case WPGMZA.FeaturePanel.MODE_ADD:
|
11998 |
+
case WPGMZA.FeaturePanel.MODE_EDIT:
|
11999 |
+
|
12000 |
+
this.featureAccordion.find("[data-add-caption][data-edit-caption]").each(function(index, el) {
|
12001 |
+
|
12002 |
+
var text = $(el).attr("data-" + type + "-caption");
|
12003 |
+
var icon = $(el).find("i.fa");
|
12004 |
+
|
12005 |
+
if(id)
|
12006 |
+
text += " " + id;
|
12007 |
+
|
12008 |
+
$(el).text(text);
|
12009 |
+
|
12010 |
+
if(icon.length)
|
12011 |
+
{
|
12012 |
+
// Need to recreate the icon as text() will have wiped it out
|
12013 |
+
icon = $("<i class='fa' aria-hidden='true'></i>");
|
12014 |
+
|
12015 |
+
icon.addClass(icons[type]);
|
12016 |
+
|
12017 |
+
$(el).prepend(" ");
|
12018 |
+
$(el).prepend(icon);
|
12019 |
+
}
|
12020 |
+
|
12021 |
+
});
|
12022 |
+
|
12023 |
+
break;
|
12024 |
+
|
12025 |
+
default:
|
12026 |
+
throw new Error("Invalid type");
|
12027 |
+
break;
|
12028 |
+
}
|
12029 |
+
}
|
12030 |
+
|
12031 |
+
WPGMZA.FeaturePanel.prototype.setMode = function(type, id)
|
12032 |
+
{
|
12033 |
+
this._mode = type;
|
12034 |
+
this.setCaptionType(type, id);
|
12035 |
+
}
|
12036 |
+
|
12037 |
+
WPGMZA.FeaturePanel.prototype.setTargetFeature = function(feature)
|
12038 |
+
{
|
12039 |
+
var self = this;
|
12040 |
+
|
12041 |
+
// TODO: Implement fitBounds for all features
|
12042 |
+
//var bounds = feature.getBounds();
|
12043 |
+
//map.fitBounds(bounds);
|
12044 |
+
|
12045 |
+
|
12046 |
+
if(WPGMZA.FeaturePanel.prevEditableFeature) {
|
12047 |
+
var prev = WPGMZA.FeaturePanel.prevEditableFeature;
|
12048 |
+
|
12049 |
+
prev.setEditable(false);
|
12050 |
+
prev.setDraggable(false);
|
12051 |
+
|
12052 |
+
prev.off("change");
|
12053 |
+
}
|
12054 |
+
if(feature) {
|
12055 |
+
feature.setEditable(true);
|
12056 |
+
feature.setDraggable(true);
|
12057 |
+
|
12058 |
+
feature.on("change", function(event) {
|
12059 |
+
self.onFeatureChanged(event);
|
12060 |
+
});
|
12061 |
+
this.setMode(WPGMZA.FeaturePanel.MODE_EDIT);
|
12062 |
+
this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE);
|
12063 |
+
|
12064 |
+
this.showInstructions();
|
12065 |
+
}
|
12066 |
+
else {
|
12067 |
+
this.setMode(WPGMZA.FeaturePanel.MODE_ADD);
|
12068 |
+
}
|
12069 |
+
this.feature = WPGMZA.FeaturePanel.prevEditableFeature = feature;
|
12070 |
+
}
|
12071 |
+
|
12072 |
+
WPGMZA.FeaturePanel.prototype.reset = function()
|
12073 |
+
{
|
12074 |
+
$(this.element).find("[data-ajax-name]:not([data-ajax-name='map_id']):not([type='color']):not([type='checkbox']):not([type='radio'])").val("");
|
12075 |
+
$(this.element).find("select[data-ajax-name]>option:first-child").prop("selected", true);
|
12076 |
+
$(this.element).find("[data-ajax-name='id']").val("-1");
|
12077 |
+
|
12078 |
+
$(this.element).find("input[type='checkbox']").prop("checked", false);
|
12079 |
+
|
12080 |
+
if(tinyMCE.get("wpgmza-description-editor"))
|
12081 |
+
tinyMCE.get("wpgmza-description-editor").setContent("");
|
12082 |
+
else
|
12083 |
+
$("#wpgmza-description-editor").val("");
|
12084 |
+
|
12085 |
+
$('#wpgmza-description-editor').val("");
|
12086 |
+
|
12087 |
+
this.showPreloader(false);
|
12088 |
+
this.setMode(WPGMZA.FeaturePanel.MODE_ADD);
|
12089 |
+
|
12090 |
+
$(this.element).find("[data-ajax-name][data-default-value]").each(function(index, el) {
|
12091 |
+
|
12092 |
+
$(el).val( $(el).data("default-value") );
|
12093 |
+
|
12094 |
+
});
|
12095 |
+
}
|
12096 |
+
|
12097 |
+
WPGMZA.FeaturePanel.prototype.select = function(arg) {
|
12098 |
+
var id, expectedBaseClass, self = this;
|
12099 |
+
|
12100 |
+
this.reset();
|
12101 |
+
|
12102 |
+
if($.isNumeric(arg))
|
12103 |
+
id = arg;
|
12104 |
+
else
|
12105 |
+
{
|
12106 |
+
expectedBaseClass = WPGMZA[ WPGMZA.capitalizeWords(this.featureType) ];
|
12107 |
+
|
12108 |
+
if(!(feature instanceof expectedBaseClass))
|
12109 |
+
throw new Error("Invalid feature type for this panel");
|
12110 |
+
|
12111 |
+
id = arg.id;
|
12112 |
+
}
|
12113 |
+
|
12114 |
+
this.showPreloader(true);
|
12115 |
+
|
12116 |
+
WPGMZA.animateScroll($(".wpgmza_map"));
|
12117 |
+
|
12118 |
+
WPGMZA.restAPI.call("/" + this.featureType + "s/" + id + "?skip_cache=1", {
|
12119 |
+
|
12120 |
+
success: function(data, status, xhr) {
|
12121 |
+
|
12122 |
+
var functionSuffix = WPGMZA.capitalizeWords(self.featureType);
|
12123 |
+
var getByIDFunction = "get" + functionSuffix + "ByID";
|
12124 |
+
var feature = self.map[getByIDFunction](id);
|
12125 |
+
|
12126 |
+
self.populate(data);
|
12127 |
+
self.showPreloader(false);
|
12128 |
+
self.setMode(WPGMZA.FeaturePanel.MODE_EDIT, id);
|
12129 |
+
|
12130 |
+
self.setTargetFeature(feature);
|
12131 |
+
|
12132 |
+
}
|
12133 |
+
|
12134 |
+
});
|
12135 |
+
}
|
12136 |
+
|
12137 |
+
WPGMZA.FeaturePanel.prototype.showPreloader = function(show)
|
12138 |
+
{
|
12139 |
+
this.initPreloader();
|
12140 |
+
|
12141 |
+
if(arguments.length == 0 || show)
|
12142 |
+
{
|
12143 |
+
this.preloader.fadeIn();
|
12144 |
+
this.element.addClass("wpgmza-loading");
|
12145 |
+
}
|
12146 |
+
else
|
12147 |
+
{
|
12148 |
+
this.preloader.fadeOut();
|
12149 |
+
this.element.removeClass("wpgmza-loading");
|
12150 |
+
}
|
12151 |
+
}
|
12152 |
+
|
12153 |
+
WPGMZA.FeaturePanel.prototype.populate = function(data)
|
12154 |
+
{
|
12155 |
+
var value, target, name;
|
12156 |
+
|
12157 |
+
for(name in data)
|
12158 |
+
{
|
12159 |
+
target = $(this.element).find("[data-ajax-name='" + name + "']");
|
12160 |
+
value = data[name];
|
12161 |
+
|
12162 |
+
switch((target.attr("type") || "").toLowerCase())
|
12163 |
+
{
|
12164 |
+
case "checkbox":
|
12165 |
+
case "radio":
|
12166 |
+
|
12167 |
+
target.prop("checked", data[name] == 1);
|
12168 |
+
|
12169 |
+
break;
|
12170 |
+
|
12171 |
+
case "color":
|
12172 |
+
|
12173 |
+
// NB: Account for legacy color format
|
12174 |
+
if(!value.match(/^#/))
|
12175 |
+
value = "#" + value;
|
12176 |
+
|
12177 |
+
default:
|
12178 |
+
|
12179 |
+
if(typeof value == "object")
|
12180 |
+
value = JSON.stringify(value);
|
12181 |
+
|
12182 |
+
$(this.element).find("[data-ajax-name='" + name + "']:not(select)").val(value);
|
12183 |
+
|
12184 |
+
$(this.element).find("select[data-ajax-name='" + name + "']").each(function(index, el) {
|
12185 |
+
|
12186 |
+
if(typeof value == "string" && data[name].length == 0)
|
12187 |
+
return;
|
12188 |
+
|
12189 |
+
$(el).val(value);
|
12190 |
+
|
12191 |
+
});
|
12192 |
+
|
12193 |
+
break;
|
12194 |
+
}
|
12195 |
+
}
|
12196 |
+
}
|
12197 |
+
|
12198 |
+
WPGMZA.FeaturePanel.prototype.serializeFormData = function()
|
12199 |
+
{
|
12200 |
+
var fields = $(this.element).find("[data-ajax-name]");
|
12201 |
+
var data = {};
|
12202 |
+
|
12203 |
+
fields.each(function(index, el) {
|
12204 |
+
|
12205 |
+
var type = "text";
|
12206 |
+
if($(el).attr("type"))
|
12207 |
+
type = $(el).attr("type").toLowerCase();
|
12208 |
+
|
12209 |
+
switch(type)
|
12210 |
+
{
|
12211 |
+
case "checkbox":
|
12212 |
+
data[$(el).attr("data-ajax-name")] = $(el).prop("checked") ? 1 : 0;
|
12213 |
+
break;
|
12214 |
+
|
12215 |
+
case "radio":
|
12216 |
+
if($(el).prop("checked"))
|
12217 |
+
data[$(el).attr("data-ajax-name")] = $(el).val();
|
12218 |
+
break;
|
12219 |
+
|
12220 |
+
default:
|
12221 |
+
data[$(el).attr("data-ajax-name")] = $(el).val()
|
12222 |
+
break;
|
12223 |
+
}
|
12224 |
+
|
12225 |
+
});
|
12226 |
+
|
12227 |
+
return data;
|
12228 |
+
}
|
12229 |
+
|
12230 |
+
WPGMZA.FeaturePanel.prototype.discardChanges = function() {
|
12231 |
+
if(!this.feature)
|
12232 |
+
return;
|
12233 |
+
|
12234 |
+
var feature = this.feature;
|
12235 |
+
|
12236 |
+
this.setTargetFeature(null);
|
12237 |
+
|
12238 |
+
if(feature && feature.map)
|
12239 |
+
{
|
12240 |
+
this.map["remove" + WPGMZA.capitalizeWords(this.featureType)](feature);
|
12241 |
+
|
12242 |
+
if(feature.id > -1)
|
12243 |
+
this.updateFeatureByID(feature.id);
|
12244 |
+
}
|
12245 |
+
}
|
12246 |
+
|
12247 |
+
WPGMZA.FeaturePanel.prototype.updateFeatureByID = function(id)
|
12248 |
+
{
|
12249 |
+
var self = this;
|
12250 |
+
var feature;
|
12251 |
+
|
12252 |
+
var route = "/" + this.featureType + "s/";
|
12253 |
+
var functionSuffix = WPGMZA.capitalizeWords(self.featureType);
|
12254 |
+
var getByIDFunction = "get" + functionSuffix + "ByID";
|
12255 |
+
var removeFunction = "remove" + functionSuffix;
|
12256 |
+
var addFunction = "add" + functionSuffix;
|
12257 |
+
|
12258 |
+
WPGMZA.restAPI.call(route + id, {
|
12259 |
+
success: function(data, status, xhr) {
|
12260 |
+
|
12261 |
+
if(feature = self.map[getByIDFunction](id))
|
12262 |
+
self.map[removeFunction](feature);
|
12263 |
+
|
12264 |
+
feature = WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data);
|
12265 |
+
self.map[addFunction](feature);
|
12266 |
+
|
12267 |
+
}
|
12268 |
+
});
|
12269 |
+
}
|
12270 |
+
|
12271 |
+
WPGMZA.FeaturePanel.prototype.showInstructions = function()
|
12272 |
+
{
|
12273 |
+
switch(this.mode)
|
12274 |
+
{
|
12275 |
+
case WPGMZA.FeaturePanel.MODE_ADD:
|
12276 |
+
$(this.map.element).append(this.drawingInstructionsElement);
|
12277 |
+
$(this.drawingInstructionsElement).hide().fadeIn();
|
12278 |
+
break;
|
12279 |
+
|
12280 |
+
default:
|
12281 |
+
$(this.map.element).append(this.editingInstructionsElement);
|
12282 |
+
$(this.editingInstructionsElement).hide().fadeIn();
|
12283 |
+
break;
|
12284 |
+
}
|
12285 |
+
}
|
12286 |
+
|
12287 |
+
WPGMZA.FeaturePanel.prototype.onTabActivated = function() {
|
12288 |
+
this.reset();
|
12289 |
+
this.drawingManager.setDrawingMode(this.featureType);
|
12290 |
+
this.onAddFeature(event);
|
12291 |
+
|
12292 |
+
$(".wpgmza-table-container-title").hide();
|
12293 |
+
$(".wpgmza-table-container").hide();
|
12294 |
+
|
12295 |
+
var featureString = this.featureType.charAt(0).toUpperCase() + this.featureType.slice(1);
|
12296 |
+
|
12297 |
+
$("#wpgmza-table-container-"+featureString).show();
|
12298 |
+
$("#wpgmza-table-container-title-"+featureString).show();
|
12299 |
+
|
12300 |
+
}
|
12301 |
+
|
12302 |
+
WPGMZA.FeaturePanel.prototype.onTabDeactivated = function()
|
12303 |
+
{
|
12304 |
+
this.discardChanges();
|
12305 |
+
this.setTargetFeature(null);
|
12306 |
+
}
|
12307 |
+
|
12308 |
+
WPGMZA.FeaturePanel.prototype.onAddFeature = function(event)
|
12309 |
+
{
|
12310 |
+
this.drawingManager.setDrawingMode(this.featureType);
|
12311 |
+
|
12312 |
+
//if(this.featureType != "marker")
|
12313 |
+
// WPGMZA.animateScroll(WPGMZA.mapEditPage.map.element);
|
12314 |
+
}
|
12315 |
+
|
12316 |
+
WPGMZA.FeaturePanel.prototype.onEditFeature = function(event)
|
12317 |
+
{
|
12318 |
+
var self = this;
|
12319 |
+
var name = "data-edit-" + this.featureType + "-id";
|
12320 |
+
var id = $(event.currentTarget).attr(name);
|
12321 |
+
|
12322 |
+
this.discardChanges();
|
12323 |
+
|
12324 |
+
this.select(id);
|
12325 |
+
}
|
12326 |
+
|
12327 |
+
WPGMZA.FeaturePanel.prototype.onDeleteFeature = function(event)
|
12328 |
+
{
|
12329 |
+
var self = this;
|
12330 |
+
var name = "data-delete-" + this.featureType + "-id";
|
12331 |
+
var id = $(event.currentTarget).attr(name);
|
12332 |
+
var route = "/" + this.featureType + "s/";
|
12333 |
+
var feature = this.map["get" + WPGMZA.capitalizeWords(this.featureType) + "ByID"](id);
|
12334 |
+
|
12335 |
+
this.featureDataTable.dataTable.processing(true);
|
12336 |
+
|
12337 |
+
WPGMZA.restAPI.call(route + id, {
|
12338 |
+
method: "DELETE",
|
12339 |
+
success: function(data, status, xhr) {
|
12340 |
+
|
12341 |
+
self.map["remove" + WPGMZA.capitalizeWords(self.featureType)](feature);
|
12342 |
+
self.featureDataTable.reload();
|
12343 |
+
|
12344 |
+
}
|
12345 |
+
});
|
12346 |
+
}
|
12347 |
+
|
12348 |
+
WPGMZA.FeaturePanel.prototype.onDrawingModeChanged = function(event)
|
12349 |
+
{
|
12350 |
+
$(this.drawingInstructionsElement).detach();
|
12351 |
+
$(this.editingInstructionsElement).detach();
|
12352 |
+
|
12353 |
+
if(this.drawingManager.mode == this.featureType)
|
12354 |
+
{
|
12355 |
+
this.showInstructions();
|
12356 |
+
}
|
12357 |
+
}
|
12358 |
+
|
12359 |
+
WPGMZA.FeaturePanel.prototype.onDrawingComplete = function(event)
|
12360 |
+
{
|
12361 |
+
var self = this;
|
12362 |
+
var property = "engine" + WPGMZA.capitalizeWords(this.featureType);
|
12363 |
+
var engineFeature = event[property];
|
12364 |
+
var formData = this.serializeFormData();
|
12365 |
+
var geometryField = $(self.element).find("textarea[data-ajax-name$='data']");
|
12366 |
+
|
12367 |
+
delete formData.polydata;
|
12368 |
+
|
12369 |
+
var nativeFeature = WPGMZA[WPGMZA.capitalizeWords(this.featureType)].createInstance(
|
12370 |
+
formData,
|
12371 |
+
engineFeature
|
12372 |
+
);
|
12373 |
+
|
12374 |
+
this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE);
|
12375 |
+
this.map["add" + WPGMZA.capitalizeWords(this.featureType)](nativeFeature);
|
12376 |
+
|
12377 |
+
this.setTargetFeature(nativeFeature);
|
12378 |
+
|
12379 |
+
// NB: This only applies to some features, maybe updateGeometryFields would be better
|
12380 |
+
if(geometryField.length)
|
12381 |
+
geometryField.val(JSON.stringify(nativeFeature.getGeometry()));
|
12382 |
+
|
12383 |
+
if(this.featureType != "marker") {
|
12384 |
+
//WPGMZA.animateScroll( $(this.element).closest(".wpgmza-accordion") );
|
12385 |
+
}
|
12386 |
+
}
|
12387 |
+
|
12388 |
+
WPGMZA.FeaturePanel.prototype.onPropertyChanged = function(event)
|
12389 |
+
{
|
12390 |
+
var self = this;
|
12391 |
+
var feature = this.feature;
|
12392 |
+
|
12393 |
+
if(!feature)
|
12394 |
+
return; // No feature, we're likely in drawing mode and not editing a feature right now
|
12395 |
+
|
12396 |
+
// Gather all the fields from our inputs and set those properties on the feature
|
12397 |
+
$(this.element)
|
12398 |
+
.find(":input[data-ajax-name]")
|
12399 |
+
.each(function(index, el) {
|
12400 |
+
|
12401 |
+
var key = $(el).attr("data-ajax-name");
|
12402 |
+
feature[key] = $(el).val();
|
12403 |
+
|
12404 |
+
});
|
12405 |
+
|
12406 |
+
// Now cause the feature to update itself
|
12407 |
+
feature.updateNativeFeature();
|
12408 |
+
}
|
12409 |
+
|
12410 |
+
WPGMZA.FeaturePanel.prototype.onFeatureChanged = function(event)
|
12411 |
+
{
|
12412 |
+
var geometryField = $(this.element).find("textarea[data-ajax-name$='data']");
|
12413 |
+
|
12414 |
+
if(!geometryField.length)
|
12415 |
+
return;
|
12416 |
+
|
12417 |
+
geometryField.val(JSON.stringify(this.feature.getGeometry()));
|
12418 |
+
}
|
12419 |
+
|
12420 |
+
WPGMZA.FeaturePanel.prototype.onSave = function(event) {
|
12421 |
+
|
12422 |
+
var self = this;
|
12423 |
+
var id = $(self.element).find("[data-ajax-name='id']").val();
|
12424 |
+
var data = this.serializeFormData();
|
12425 |
+
|
12426 |
+
var route = "/" + this.featureType + "s/";
|
12427 |
+
var isNew = id == -1;
|
12428 |
+
|
12429 |
+
if (this.featureType == 'circle') {
|
12430 |
+
if (!data.center) {
|
12431 |
+
alert(WPGMZA.localized_strings.no_shape_circle);
|
12432 |
+
return;
|
12433 |
+
}
|
12434 |
+
}
|
12435 |
+
if (this.featureType == 'rectangle') {
|
12436 |
+
if (!data.cornerA) {
|
12437 |
+
alert(WPGMZA.localized_strings.no_shape_rectangle);
|
12438 |
+
return;
|
12439 |
+
}
|
12440 |
+
}
|
12441 |
+
if (this.featureType == 'polygon') {
|
12442 |
+
if (!data.polydata) {
|
12443 |
+
alert(WPGMZA.localized_strings.no_shape_polygon);
|
12444 |
+
return;
|
12445 |
+
}
|
12446 |
+
}
|
12447 |
+
if (this.featureType == 'polyline') {
|
12448 |
+
if (!data.polydata) {
|
12449 |
+
alert(WPGMZA.localized_strings.no_shape_polyline);
|
12450 |
+
return;
|
12451 |
+
}
|
12452 |
+
}
|
12453 |
+
|
12454 |
+
if(!isNew)
|
12455 |
+
route += id;
|
12456 |
+
|
12457 |
+
WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE);
|
12458 |
+
this.showPreloader(true);
|
12459 |
+
|
12460 |
+
WPGMZA.restAPI.call(route, {
|
12461 |
+
method: "POST",
|
12462 |
+
data: data,
|
12463 |
+
success: function(data, status, xhr) {
|
12464 |
+
|
12465 |
+
var feature;
|
12466 |
+
|
12467 |
+
var functionSuffix = WPGMZA.capitalizeWords(self.featureType);
|
12468 |
+
var getByIDFunction = "get" + functionSuffix + "ByID";
|
12469 |
+
var removeFunction = "remove" + functionSuffix;
|
12470 |
+
var addFunction = "add" + functionSuffix;
|
12471 |
+
|
12472 |
+
self.reset();
|
12473 |
+
|
12474 |
+
if(feature = self.map[getByIDFunction](id))
|
12475 |
+
self.map[removeFunction](feature);
|
12476 |
+
|
12477 |
+
self.setTargetFeature(null);
|
12478 |
+
self.showPreloader(false);
|
12479 |
+
|
12480 |
+
feature = WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data);
|
12481 |
+
self.map[addFunction](feature);
|
12482 |
+
|
12483 |
+
self.featureDataTable.reload();
|
12484 |
+
self.onTabActivated(event);
|
12485 |
+
|
12486 |
+
}
|
12487 |
+
})
|
12488 |
+
}
|
12489 |
+
|
12490 |
+
});
|
12491 |
|
|
|
|
|
|
|
12492 |
|
12493 |
+
// js/v8/map-edit-page/marker-panel.js
|
12494 |
+
/**
|
12495 |
+
* @namespace WPGMZA
|
12496 |
+
* @module MarkerPanel
|
12497 |
+
* @requires WPGMZA.FeaturePanel
|
12498 |
+
*/
|
12499 |
+
jQuery(function($) {
|
12500 |
+
|
12501 |
+
WPGMZA.MarkerPanel = function(element, mapEditPage)
|
12502 |
+
{
|
12503 |
+
WPGMZA.FeaturePanel.apply(this, arguments);
|
12504 |
+
}
|
12505 |
+
|
12506 |
+
WPGMZA.extend(WPGMZA.MarkerPanel, WPGMZA.FeaturePanel);
|
12507 |
+
|
12508 |
+
WPGMZA.MarkerPanel.createInstance = function(element, mapEditPage)
|
12509 |
+
{
|
12510 |
+
if(WPGMZA.isProVersion())
|
12511 |
+
return new WPGMZA.ProMarkerPanel(element, mapEditPage);
|
12512 |
+
|
12513 |
+
return new WPGMZA.MarkerPanel(element, mapEditPage);
|
12514 |
+
}
|
12515 |
+
|
12516 |
+
WPGMZA.MarkerPanel.prototype.initDefaults = function(){
|
12517 |
+
var self = this;
|
12518 |
+
|
12519 |
+
WPGMZA.FeaturePanel.prototype.initDefaults.apply(this, arguments);
|
12520 |
+
|
12521 |
+
this.adjustSubMode = false;
|
12522 |
+
|
12523 |
+
this.onTabActivated(null);
|
12524 |
+
|
12525 |
+
$(document.body).on("click", "[data-adjust-" + this.featureType + "-id]", function(event) {
|
12526 |
+
self.onAdjustFeature(event);
|
12527 |
+
});
|
12528 |
+
|
12529 |
+
$(document.body).on("click", ".wpgmza_approve_btn", function(event) {
|
12530 |
+
self.onApproveMarker(event);
|
12531 |
+
});
|
12532 |
+
|
12533 |
+
}
|
12534 |
+
|
12535 |
+
WPGMZA.MarkerPanel.prototype.onAdjustFeature = function(event){
|
12536 |
+
var self = this;
|
12537 |
+
var name = "data-adjust-" + this.featureType + "-id";
|
12538 |
+
var id = $(event.currentTarget).attr(name);
|
12539 |
+
|
12540 |
+
this.discardChanges();
|
12541 |
+
|
12542 |
+
this.adjustSubMode = true;
|
12543 |
+
|
12544 |
+
this.select(id);
|
12545 |
+
}
|
12546 |
+
|
12547 |
+
WPGMZA.MarkerPanel.prototype.onApproveMarker = function(event){
|
12548 |
+
var self = this;
|
12549 |
+
|
12550 |
+
var route = "/" + this.featureType + "s/" + $(event.currentTarget).attr('id');
|
12551 |
+
WPGMZA.restAPI.call(route, {
|
12552 |
+
method: "POST",
|
12553 |
+
data: {
|
12554 |
+
approved : "1"
|
12555 |
+
},
|
12556 |
+
success: function(data, status, xhr) {
|
12557 |
+
self.featureDataTable.reload();
|
12558 |
+
}
|
12559 |
+
});
|
12560 |
+
}
|
12561 |
+
|
12562 |
+
WPGMZA.MarkerPanel.prototype.onFeatureChanged = function(event){
|
12563 |
+
if(this.adjustSubMode){
|
12564 |
+
var aPos = this.feature.getPosition();
|
12565 |
+
|
12566 |
+
if(aPos){
|
12567 |
+
$(this.element).find("[data-ajax-name='lat']").val(aPos.lat);
|
12568 |
+
$(this.element).find("[data-ajax-name='lng']").val(aPos.lng);
|
12569 |
+
}
|
12570 |
+
// Exit early, we don't want to adjust the address
|
12571 |
+
return;
|
12572 |
+
}
|
12573 |
+
|
12574 |
+
var addressField = $(this.element).find("input[data-ajax-name$='address']");
|
12575 |
+
|
12576 |
+
if(!addressField.length)
|
12577 |
+
return;
|
12578 |
+
|
12579 |
+
var pos = this.feature.getPosition();
|
12580 |
+
addressField.val(pos.lat + ',' + pos.lng);
|
12581 |
+
}
|
12582 |
+
|
12583 |
+
WPGMZA.MarkerPanel.prototype.setTargetFeature = function(feature){
|
12584 |
+
if(WPGMZA.FeaturePanel.prevEditableFeature){
|
12585 |
+
var prev = WPGMZA.FeaturePanel.prevEditableFeature;
|
12586 |
+
|
12587 |
+
if(prev.setOpacity){
|
12588 |
+
prev.setOpacity(1);
|
12589 |
+
}
|
12590 |
+
}
|
12591 |
+
|
12592 |
+
|
12593 |
+
/**
|
12594 |
+
* We could probably make this adjust mode code more elegant in the future
|
12595 |
+
*
|
12596 |
+
* Temporary solution as it is causing trouble for clients
|
12597 |
+
*
|
12598 |
+
* Date: 2021-01-15
|
12599 |
+
*/
|
12600 |
+
$(this.element).find('[data-ajax-name]').removeAttr('disabled');
|
12601 |
+
$(this.element).find('fieldset').show();
|
12602 |
+
$(this.element).find('.wpgmza-adjust-mode-notice').addClass('wpgmza-hidden');
|
12603 |
+
|
12604 |
+
$(this.element).find('[data-ajax-name="lat"]').attr('type', 'hidden');
|
12605 |
+
$(this.element).find('[data-ajax-name="lng"]').attr('type', 'hidden');
|
12606 |
+
|
12607 |
+
$(this.element).find('.wpgmza-hide-in-adjust-mode').removeClass('wpgmza-hidden');
|
12608 |
+
$(this.element).find('.wpgmza-show-in-adjust-mode').addClass('wpgmza-hidden');
|
12609 |
+
|
12610 |
+
|
12611 |
+
if(feature){
|
12612 |
+
if(feature.setOpacity){
|
12613 |
+
feature.setOpacity(0.7);
|
12614 |
+
}
|
12615 |
+
|
12616 |
+
feature.getMap().panTo(feature.getPosition());
|
12617 |
+
|
12618 |
+
if(this.adjustSubMode){
|
12619 |
+
$(this.element).find('[data-ajax-name]').attr('disabled', 'disabled');
|
12620 |
+
$(this.element).find('fieldset:not(.wpgmza-always-on)').hide();
|
12621 |
+
$(this.element).find('.wpgmza-adjust-mode-notice').removeClass('wpgmza-hidden');
|
12622 |
+
|
12623 |
+
$(this.element).find('[data-ajax-name="lat"]').attr('type', 'text').removeAttr('disabled');
|
12624 |
+
$(this.element).find('[data-ajax-name="lng"]').attr('type', 'text').removeAttr('disabled');
|
12625 |
+
|
12626 |
+
$(this.element).find('.wpgmza-hide-in-adjust-mode').addClass('wpgmza-hidden');
|
12627 |
+
$(this.element).find('.wpgmza-show-in-adjust-mode').removeClass('wpgmza-hidden');
|
12628 |
+
}
|
12629 |
+
} else {
|
12630 |
+
this.adjustSubMode = false;
|
12631 |
+
}
|
12632 |
+
|
12633 |
+
WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this, arguments);
|
12634 |
+
}
|
12635 |
+
|
12636 |
+
WPGMZA.MarkerPanel.prototype.onSave = function(event)
|
12637 |
+
{
|
12638 |
+
var self = this;
|
12639 |
+
var geocoder = WPGMZA.Geocoder.createInstance();
|
12640 |
+
var address = $(this.element).find("[data-ajax-name='address']").val();
|
12641 |
+
|
12642 |
+
var geocodingData = {
|
12643 |
+
address: address
|
12644 |
+
}
|
12645 |
+
|
12646 |
+
|
12647 |
+
WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE);
|
12648 |
+
this.showPreloader(true);
|
12649 |
+
|
12650 |
+
// New cloud functions
|
12651 |
+
var cloud_lat = false;
|
12652 |
+
var cloud_lng = false;
|
12653 |
+
|
12654 |
+
// is the lat and lng set from the WPGM Cloud Search?
|
12655 |
+
if (document.getElementsByName("lat").length > 0) { cloud_lat = document.getElementsByName("lat")[0].value; }
|
12656 |
+
if (document.getElementsByName("lng").length > 0) { cloud_lng = document.getElementsByName("lng")[0].value; }
|
12657 |
+
|
12658 |
+
if (cloud_lat && cloud_lng) {
|
12659 |
+
if(!WPGMZA_localized_data.settings.googleMapsApiKey || WPGMZA_localized_data.settings.googleMapsApiKey === ''){
|
12660 |
+
//Let's only do this if it's not their own key, this causes issues with repositioning a marker
|
12661 |
+
geocodingData.lat = parseFloat(cloud_lat);
|
12662 |
+
geocodingData.lng = parseFloat(cloud_lng);
|
12663 |
+
}
|
12664 |
+
}
|
12665 |
+
|
12666 |
+
if(this.adjustSubMode){
|
12667 |
+
// Trust the force!
|
12668 |
+
WPGMZA.FeaturePanel.prototype.onSave.apply(self, arguments);
|
12669 |
+
} else {
|
12670 |
+
geocoder.geocode(geocodingData, function(results, status) {
|
12671 |
+
|
12672 |
+
switch(status)
|
12673 |
+
{
|
12674 |
+
case WPGMZA.Geocoder.ZERO_RESULTS:
|
12675 |
+
alert(WPGMZA.localized_strings.zero_results);
|
12676 |
+
self.showPreloader(false);
|
12677 |
+
return;
|
12678 |
+
break;
|
12679 |
+
|
12680 |
+
case WPGMZA.Geocoder.SUCCESS:
|
12681 |
+
break;
|
12682 |
+
|
12683 |
+
case WPGMZA.Geocoder.NO_ADDRESS:
|
12684 |
+
alert(WPGMZA.localized_strings.no_address);
|
12685 |
+
self.showPreloader(false);
|
12686 |
+
return;
|
12687 |
+
break;
|
12688 |
+
|
12689 |
+
|
12690 |
+
case WPGMZA.Geocoder.FAIL:
|
12691 |
+
default:
|
12692 |
+
alert(WPGMZA.localized_strings.geocode_fail);
|
12693 |
+
self.showPreloader(false);
|
12694 |
+
return;
|
12695 |
+
break;
|
12696 |
+
}
|
12697 |
+
|
12698 |
+
var result = results[0];
|
12699 |
+
|
12700 |
+
$(self.element).find("[data-ajax-name='lat']").val(result.lat);
|
12701 |
+
$(self.element).find("[data-ajax-name='lng']").val(result.lng);
|
12702 |
+
WPGMZA.FeaturePanel.prototype.onSave.apply(self, arguments);
|
12703 |
+
|
12704 |
+
});
|
12705 |
+
}
|
12706 |
+
|
12707 |
+
WPGMZA.mapEditPage.map.resetBounds();
|
12708 |
+
}
|
12709 |
+
|
12710 |
+
});
|
12711 |
+
|
12712 |
+
// js/v8/map-edit-page/circle-panel.js
|
12713 |
+
/**
|
12714 |
+
* @namespace WPGMZA
|
12715 |
+
* @module CirclePanel
|
12716 |
+
* @requires WPGMZA.FeaturePanel
|
12717 |
+
*/
|
12718 |
+
jQuery(function($) {
|
12719 |
+
|
12720 |
+
WPGMZA.CirclePanel = function(element, mapEditPage)
|
12721 |
+
{
|
12722 |
+
WPGMZA.FeaturePanel.apply(this, arguments);
|
12723 |
+
}
|
12724 |
+
|
12725 |
+
WPGMZA.extend(WPGMZA.CirclePanel, WPGMZA.FeaturePanel);
|
12726 |
+
|
12727 |
+
WPGMZA.CirclePanel.createInstance = function(element, mapEditPage)
|
12728 |
+
{
|
12729 |
+
if(WPGMZA.isProVersion())
|
12730 |
+
return new WPGMZA.ProCirclePanel(element, mapEditPage);
|
12731 |
+
|
12732 |
+
return new WPGMZA.CirclePanel(element, mapEditPage);
|
12733 |
+
}
|
12734 |
+
|
12735 |
+
WPGMZA.CirclePanel.prototype.updateFields = function()
|
12736 |
+
{
|
12737 |
+
$(this.element).find("[data-ajax-name='center']").val( this.feature.getCenter().toString() );
|
12738 |
+
$(this.element).find("[data-ajax-name='radius']").val( this.feature.getRadius() );
|
12739 |
+
}
|
12740 |
+
|
12741 |
+
WPGMZA.CirclePanel.prototype.onDrawingComplete = function(event)
|
12742 |
+
{
|
12743 |
+
WPGMZA.FeaturePanel.prototype.onDrawingComplete.apply(this, arguments);
|
12744 |
+
|
12745 |
+
this.updateFields();
|
12746 |
+
}
|
12747 |
+
|
12748 |
+
WPGMZA.CirclePanel.prototype.setTargetFeature = function(feature){
|
12749 |
+
WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this, arguments);
|
12750 |
+
|
12751 |
+
if(feature){
|
12752 |
+
this.updateFields();
|
12753 |
+
}
|
12754 |
+
}
|
12755 |
+
|
12756 |
+
WPGMZA.CirclePanel.prototype.onFeatureChanged = function(event)
|
12757 |
+
{
|
12758 |
+
WPGMZA.FeaturePanel.prototype.onFeatureChanged.apply(this, arguments);
|
12759 |
+
this.updateFields();
|
12760 |
+
}
|
12761 |
+
|
12762 |
});
|
12763 |
|
12764 |
+
// js/v8/map-edit-page/map-edit-page.js
|
12765 |
/**
|
12766 |
* @namespace WPGMZA
|
12767 |
+
* @module MapEditPage
|
12768 |
+
* @requires WPGMZA.EventDispatcher
|
|
|
12769 |
*/
|
12770 |
+
|
12771 |
+
var wpgmza_autoCompleteDisabled = false;
|
12772 |
+
|
12773 |
jQuery(function($) {
|
12774 |
|
12775 |
+
if(WPGMZA.currentPage != "map-edit")
|
12776 |
+
return;
|
12777 |
|
12778 |
+
WPGMZA.MapEditPage = function()
|
12779 |
{
|
12780 |
var self = this;
|
12781 |
+
var element = document.body;
|
12782 |
|
12783 |
+
WPGMZA.EventDispatcher.call(this);
|
12784 |
|
12785 |
+
$("#wpgmaps_options fieldset").wrapInner("<div class='wpgmza-flex'></div>");
|
12786 |
+
|
12787 |
+
this.themePanel = new WPGMZA.ThemePanel();
|
12788 |
+
this.themeEditor = new WPGMZA.ThemeEditor();
|
12789 |
+
|
12790 |
+
this.map = WPGMZA.maps[0];
|
12791 |
+
|
12792 |
+
// Drawing manager
|
12793 |
+
if(!WPGMZA.pro_version || WPGMZA.Version.compare(WPGMZA.pro_version, '8.1.0') >= WPGMZA.Version.EQUAL_TO)
|
12794 |
+
this.drawingManager = WPGMZA.DrawingManager.createInstance(this.map);
|
12795 |
+
|
12796 |
+
// UI
|
12797 |
+
this.initDataTables();
|
12798 |
+
this.initFeaturePanels();
|
12799 |
+
this.initJQueryUIControls();
|
12800 |
+
|
12801 |
+
if(WPGMZA.locale !== 'en'){
|
12802 |
+
$('#datatable_no_result_message,#datatable_search_string').parent().parent().hide();
|
12803 |
+
}
|
12804 |
+
|
12805 |
+
// Address input
|
12806 |
+
$("input.wpgmza-address").each(function(index, el) {
|
12807 |
+
el.addressInput = WPGMZA.AddressInput.createInstance(el, self.map);
|
12808 |
+
});
|
12809 |
+
|
12810 |
+
$('#wpgmza-map-edit-page input[type="color"]').each(function(){
|
12811 |
+
$("<div class='button-secondary wpgmza-paste-color-btn' title='Paste a HEX color code'><i class='fa fa-clipboard' aria-hidden='true'></i></div>").insertAfter(this);
|
12812 |
+
});
|
12813 |
+
|
12814 |
+
|
12815 |
+
jQuery('body').on('click','.wpgmza_ac_result', function(e) {
|
12816 |
+
var index = jQuery(this).data('id');
|
12817 |
+
var lat = jQuery(this).data('lat');
|
12818 |
+
var lng = jQuery(this).data('lng');
|
12819 |
+
var name = jQuery('#wpgmza_item_address_'+index).html();
|
12820 |
+
|
12821 |
+
|
12822 |
+
jQuery("input[name='lat']").val(lat);
|
12823 |
+
jQuery("input[name='lng']").val(lng);
|
12824 |
+
jQuery("#wpgmza_add_address_map_editor").val(name);
|
12825 |
+
jQuery('#wpgmza_autocomplete_search_results').hide();
|
12826 |
+
});
|
12827 |
+
|
12828 |
+
jQuery('body').on('click', '.wpgmza-paste-color-btn', function(){
|
12829 |
+
try{
|
12830 |
+
var colorBtn = $(this);
|
12831 |
+
if(!navigator || !navigator.clipboard || !navigator.clipboard.readText){
|
12832 |
+
return;
|
12833 |
}
|
12834 |
+
|
12835 |
+
navigator.clipboard.readText()
|
12836 |
+
.then(function(textcopy) {
|
12837 |
+
colorBtn.parent().find('input[type="color"]').val("#" + textcopy.replace("#","").trim());
|
12838 |
+
})
|
12839 |
+
.catch(function(err) {
|
12840 |
+
console.error("WP Google Maps: Could not access clipboard", err);
|
12841 |
+
});
|
12842 |
+
|
12843 |
+
} catch(c_ex){
|
12844 |
+
|
12845 |
+
}
|
12846 |
+
});
|
12847 |
+
|
12848 |
+
jQuery('body').on('focusout', '#wpgmza_add_address_map_editor', function(e) {
|
12849 |
+
setTimeout(function() {
|
12850 |
+
jQuery('#wpgmza_autocomplete_search_results').fadeOut('slow');
|
12851 |
+
},500)
|
12852 |
+
|
12853 |
+
});
|
12854 |
+
|
12855 |
+
var ajaxRequest = false;
|
12856 |
+
var wpgmzaAjaxTimeout = false;
|
12857 |
+
|
12858 |
+
var wpgmzaStartTyping = false;
|
12859 |
+
var wpgmzaKeyStrokeCount = 1;
|
12860 |
+
var wpgmzaAvgTimeBetweenStrokes = 300; //300 ms by default (equates to 40wpm which is the average typing speed of a person)
|
12861 |
+
var wpgmzaTotalTimeForKeyStrokes = 0;
|
12862 |
+
var wpgmzaTmp = '';
|
12863 |
+
var wpgmzaIdentifiedTypingSpeed = false;
|
12864 |
+
|
12865 |
+
$('body').on('keypress', '.wpgmza-address', function(e) {
|
12866 |
+
|
12867 |
+
if (this.id == 'wpgmza_add_address_map_editor') {
|
12868 |
+
if (wpgmza_autoCompleteDisabled) { return; }
|
12869 |
+
|
12870 |
+
|
12871 |
+
|
12872 |
+
// if user is using their own API key then use the normal Google AutoComplete
|
12873 |
+
var wpgmza_apikey = false;
|
12874 |
+
if (WPGMZA_localized_data.settings.googleMapsApiKey && WPGMZA_localized_data.settings.googleMapsApiKey !== '') {
|
12875 |
+
wpgmza_apikey = WPGMZA_localized_data.settings.googleMapsApiKey;
|
12876 |
+
return;
|
12877 |
+
} else {
|
12878 |
+
|
12879 |
+
if(e.key === "Escape" || e.key === "Alt" || e.key === "Control" || e.key === "Option" || e.key === "Shift" || e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "ArrowUp" || e.key === "ArrowDown") {
|
12880 |
+
$('#wpgmza_autocomplete_search_results').hide();
|
12881 |
+
return;
|
12882 |
+
}
|
12883 |
+
|
12884 |
+
if (!wpgmzaIdentifiedTypingSpeed) {
|
12885 |
+
//determine duration between key strokes to determine when we should send the request to the autocomplete server
|
12886 |
+
//doing this avoids sending API calls for slow typers.
|
12887 |
+
var d = new Date();
|
12888 |
+
|
12889 |
+
|
12890 |
+
// set a timer to reset the delay counter
|
12891 |
+
clearTimeout(wpgmzaTmp);
|
12892 |
+
wpgmzaTmp = setTimeout(function(){
|
12893 |
+
wpgmzaStartTyping = false;
|
12894 |
+
wpgmzaAvgTimeBetweenStrokes = 300;
|
12895 |
+
wpgmzaTotalTimeForKeyStrokes = 0;
|
12896 |
+
},1500
|
12897 |
+
); // I'm pretty sure no one types one key stroke per 1.5 seconds. This should be safe.
|
12898 |
+
if (!wpgmzaStartTyping) {
|
12899 |
+
// first character press, set start time.
|
12900 |
+
|
12901 |
+
wpgmzaStartTyping = d.getTime();
|
12902 |
+
wpgmzaKeyStrokeCount++;
|
12903 |
+
} else {
|
12904 |
+
if (wpgmzaKeyStrokeCount == 1) {
|
12905 |
+
// do nothing because its the first key stroke
|
12906 |
+
} else {
|
12907 |
+
|
12908 |
+
|
12909 |
+
wpgmzaCurrentTimeBetweenStrokes = d.getTime() - wpgmzaStartTyping;
|
12910 |
+
wpgmzaTotalTimeForKeyStrokes = wpgmzaTotalTimeForKeyStrokes + wpgmzaCurrentTimeBetweenStrokes;
|
12911 |
+
|
12912 |
+
wpgmzaAvgTimeBetweenStrokes = (wpgmzaTotalTimeForKeyStrokes / (wpgmzaKeyStrokeCount-1)); // we cannot count the first key as that was the starting point
|
12913 |
+
wpgmzaStartTyping = d.getTime();
|
12914 |
+
|
12915 |
+
if (wpgmzaKeyStrokeCount >= 3) {
|
12916 |
+
// we only need 3 keys to know how fast they type
|
12917 |
+
wpgmzaIdentifiedTypingSpeed = (wpgmzaAvgTimeBetweenStrokes);
|
12918 |
+
|
12919 |
+
|
12920 |
+
}
|
12921 |
+
}
|
12922 |
+
wpgmzaKeyStrokeCount++;
|
12923 |
+
|
12924 |
+
|
12925 |
+
|
12926 |
+
}
|
12927 |
+
return;
|
12928 |
+
}
|
12929 |
+
|
12930 |
+
|
12931 |
+
// clear the previous timer
|
12932 |
+
clearTimeout(wpgmzaAjaxTimeout);
|
12933 |
+
|
12934 |
+
$('#wpgmza_autocomplete_search_results').html('Searching...');
|
12935 |
+
$('#wpgmza_autocomplete_search_results').show();
|
12936 |
+
|
12937 |
+
|
12938 |
+
|
12939 |
+
|
12940 |
+
var currentSearch = jQuery(this).val();
|
12941 |
+
if (currentSearch !== '') {
|
12942 |
+
|
12943 |
+
if(ajaxRequest !== false){
|
12944 |
+
ajaxRequest.abort();
|
12945 |
+
}
|
12946 |
+
var wpgmza_api_url = '';
|
12947 |
+
if (!wpgmza_apikey) {
|
12948 |
+
wpgmza_api_url = "https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+window.location.hostname+"&hash="+WPGMZA_localized_data.siteHash
|
12949 |
+
} else {
|
12950 |
+
wpgmza_api_url = "https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+window.location.hostname+"&hash="+WPGMZA_localized_data.siteHash+"&k="+wpgmza_apikey
|
12951 |
+
}
|
12952 |
+
|
12953 |
+
// set a timer of how fast the person types in seconds to only continue with this if it runs out
|
12954 |
+
wpgmzaAjaxTimeout = setTimeout(function() {
|
12955 |
+
ajaxRequest = $.ajax({
|
12956 |
+
url: wpgmza_api_url,
|
12957 |
+
type: 'GET',
|
12958 |
+
dataType: 'json', // added data type
|
12959 |
+
success: function(results) {
|
12960 |
+
|
12961 |
+
try {
|
12962 |
+
|
12963 |
+
if (typeof results.error !== 'undefined') {
|
12964 |
+
if (results.error == 'error1') {
|
12965 |
+
$('#wpgmza_autoc_disabled').html(WPGMZA.localized_strings.cloud_api_key_error_1);
|
12966 |
+
$('#wpgmza_autoc_disabled').fadeIn('slow');
|
12967 |
+
$('#wpgmza_autocomplete_search_results').hide();
|
12968 |
+
wpgmza_autoCompleteDisabled = true;
|
12969 |
+
} else {
|
12970 |
+
console.error(results.error);
|
12971 |
+
}
|
12972 |
+
|
12973 |
+
} else {
|
12974 |
+
$('#wpgmza_autocomplete_search_results').html('');
|
12975 |
+
var html = "";
|
12976 |
+
for(var i in results){ html += "<div class='wpgmza_ac_result " + (html === "" ? "" : "border-top") + "' data-id='" + i + "' data-lat='"+results[i]['lat']+"' data-lng='"+results[i]['lng']+"'><div class='wpgmza_ac_container'><div class='wpgmza_ac_icon'><img src='"+results[i]['icon']+"' /></div><div class='wpgmza_ac_item'><span id='wpgmza_item_name_"+i+"' class='wpgmza_item_name'>" + results[i]['place_name'] + "</span><span id='wpgmza_item_address_"+i+"' class='wpgmza_item_address'>" + results[i]['formatted_address'] + "</span></div></div></div>"; }
|
12977 |
+
if(html == ""){ html = "<div class='p-2 text-center'><small>No results found...</small></div>"; }
|
12978 |
+
$('#wpgmza_autocomplete_search_results').html(html);
|
12979 |
+
$('#wpgmza_autocomplete_search_results').show();
|
12980 |
+
|
12981 |
+
}
|
12982 |
+
} catch (exception) {
|
12983 |
+
console.error("WP Google Maps Plugin: There was an error returning the list of places for your search");
|
12984 |
+
}
|
12985 |
+
|
12986 |
+
|
12987 |
+
|
12988 |
+
}
|
12989 |
+
});
|
12990 |
+
},(wpgmzaIdentifiedTypingSpeed*2));
|
12991 |
+
|
12992 |
+
|
12993 |
+
|
12994 |
+
|
12995 |
+
} else {
|
12996 |
+
$('#wpgmza_autocomplete_search_results').hide();
|
12997 |
+
}
|
12998 |
}
|
|
|
|
|
12999 |
}
|
13000 |
+
});
|
13001 |
+
|
13002 |
+
|
13003 |
+
// Map height change (for warning)
|
13004 |
+
$("#wpgmza_map_height_type").on("change", function(event) {
|
13005 |
+
self.onMapHeightTypeChange(event);
|
13006 |
+
});
|
13007 |
|
13008 |
+
// Don't have instructions in advanced marker panel, it's confusing for debugging and unnecessary
|
13009 |
+
$("#advanced-markers .wpgmza-feature-drawing-instructions").remove();
|
13010 |
|
13011 |
+
// Hide the auto search area maximum zoom - not available in Basic. Pro will take care of showing it when needed
|
13012 |
+
$("[data-search-area='auto']").hide();
|
|
|
|
|
13013 |
|
13014 |
+
// Control listeners
|
13015 |
+
$(document.body).on("click", "[data-wpgmza-admin-marker-datatable] input[name='mark']", function(event) {
|
13016 |
+
self.onShiftClick(event);
|
|
|
|
|
|
|
|
|
|
|
13017 |
});
|
13018 |
|
13019 |
+
$("#wpgmza_map_type").on("change", function(event) {
|
13020 |
+
self.onMapTypeChanged(event);
|
13021 |
});
|
13022 |
+
|
13023 |
+
$("body").on("click",".wpgmza_copy_shortcode", function() {
|
13024 |
+
var $temp = jQuery('<input>');
|
13025 |
+
var $tmp2 = jQuery('<span id="wpgmza_tmp" style="display:none; width:100%; text-align:center;">');
|
13026 |
+
jQuery("body").append($temp);
|
13027 |
+
$temp.val(jQuery(this).val()).select();
|
13028 |
+
document.execCommand("copy");
|
13029 |
+
$temp.remove();
|
13030 |
+
WPGMZA.notification("Shortcode Copied");
|
13031 |
+
});
|
13032 |
|
13033 |
+
this.on("markerupdated", function(event) {
|
13034 |
+
self.onMarkerUpdated(event);
|
13035 |
+
});
|
13036 |
+
|
13037 |
+
// NB: Older version of Pro (< 7.0.0 - pre-WPGMZA.Map) will have this.map as undefined. Only run this code if we have a WPGMZA.Map to work with.
|
13038 |
+
if(this.map)
|
13039 |
+
{
|
13040 |
+
this.map.on("zoomchanged", function(event) {
|
13041 |
+
self.onZoomChanged(event);
|
13042 |
+
});
|
13043 |
|
13044 |
+
this.map.on("boundschanged", function(event) {
|
13045 |
+
self.onBoundsChanged(event);
|
|
|
13046 |
});
|
13047 |
|
13048 |
+
this.map.on("rightclick", function(event) {
|
13049 |
+
self.onRightClick(event);
|
|
|
13050 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13051 |
}
|
13052 |
|
13053 |
+
$(element).on("click", ".wpgmza_poly_del_btn", function(event) {
|
13054 |
+
self.onDeletePolygon(event);
|
13055 |
});
|
13056 |
|
13057 |
+
$(element).on("click", ".wpgmza_polyline_del_btn", function(event) {
|
13058 |
+
self.onDeletePolyline(event);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13059 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13060 |
|
13061 |
+
$(element).on("click", ".wpgmza_dataset_del_btn", function(evevnt) {
|
13062 |
+
self.onDeleteHeatmap(event);
|
13063 |
+
});
|
|
|
|
|
|
|
13064 |
|
13065 |
+
$(element).on("click", ".wpgmza_circle_del_btn", function(event) {
|
13066 |
+
self.onDeleteCircle(event);
|
13067 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13068 |
|
13069 |
+
$(element).on("click", ".wpgmza_rectangle_del_btn", function(event) {
|
13070 |
+
self.onDeleteRectangle(event);
|
13071 |
+
});
|
13072 |
+
|
13073 |
+
$(element).on("click", "#wpgmza-open-advanced-theme-data", function(event){
|
13074 |
+
event.preventDefault();
|
13075 |
+
$('.wpgmza_theme_data_container').toggleClass('wpgmza_hidden');
|
13076 |
+
});
|
13077 |
}
|
13078 |
|
13079 |
+
WPGMZA.extend(WPGMZA.MapEditPage, WPGMZA.EventDispatcher);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13080 |
|
13081 |
+
WPGMZA.MapEditPage.createInstance = function()
|
|
|
|
|
|
|
|
|
13082 |
{
|
13083 |
+
if(WPGMZA.isProVersion() && WPGMZA.Version.compare(WPGMZA.pro_version, "8.0.0") >= WPGMZA.Version.EQUAL_TO)
|
13084 |
+
return new WPGMZA.ProMapEditPage();
|
13085 |
|
13086 |
+
return new WPGMZA.MapEditPage();
|
13087 |
}
|
13088 |
|
13089 |
+
WPGMZA.MapEditPage.prototype.initDataTables = function()
|
13090 |
{
|
13091 |
+
var self = this;
|
13092 |
+
|
13093 |
+
$("[data-wpgmza-datatable][data-wpgmza-rest-api-route]").each(function(index, el) {
|
13094 |
+
|
13095 |
+
var featureType = $(el).attr("data-wpgmza-feature-type");
|
13096 |
+
|
13097 |
+
self[featureType + "AdminDataTable"] = new WPGMZA.AdminFeatureDataTable(el);
|
13098 |
+
|
13099 |
+
});
|
13100 |
}
|
13101 |
|
13102 |
+
WPGMZA.MapEditPage.prototype.initFeaturePanels = function()
|
13103 |
{
|
13104 |
+
var self = this;
|
13105 |
+
|
13106 |
+
$(".wpgmza-feature-accordion[data-wpgmza-feature-type]").each(function(index, el) {
|
13107 |
+
|
13108 |
+
var featurePanelElement = $(el).find(".wpgmza-feature-panel-container > *");
|
13109 |
+
var featureType = $(el).attr("data-wpgmza-feature-type");
|
13110 |
+
var panelClassName = WPGMZA.capitalizeWords(featureType) + "Panel";
|
13111 |
+
var module = WPGMZA[panelClassName];
|
13112 |
+
var instance = module.createInstance(featurePanelElement, self);
|
13113 |
+
|
13114 |
+
self[featureType + "Panel"] = instance;
|
13115 |
+
|
13116 |
+
});
|
13117 |
}
|
13118 |
|
13119 |
+
WPGMZA.MapEditPage.prototype.initJQueryUIControls = function()
|
13120 |
{
|
13121 |
+
var self = this;
|
13122 |
+
var mapContainer;
|
13123 |
+
|
13124 |
+
// Now initialise tabs
|
13125 |
+
$("#wpgmaps_tabs").tabs();
|
13126 |
+
|
13127 |
+
// NB: If the map container has a <ul> then this will break the tabs (this happens in OpenLayers). Temporarily detach the map to avoid this.
|
13128 |
+
mapContainer = $("#wpgmza-map-container").detach();
|
13129 |
+
|
13130 |
+
$("#wpgmaps_tabs_markers").tabs();
|
13131 |
+
|
13132 |
+
// NB: Re-add the map container (see above)
|
13133 |
+
$(".map_wrapper").prepend(mapContainer);
|
13134 |
+
|
13135 |
+
// And the zoom slider
|
13136 |
+
$("#slider-range-max").slider({
|
13137 |
+
range: "max",
|
13138 |
+
min: 1,
|
13139 |
+
max: 21,
|
13140 |
+
value: $("input[name='map_start_zoom']").val(),
|
13141 |
+
slide: function( event, ui ) {
|
13142 |
+
$("input[name='map_start_zoom']").val(ui.value);
|
13143 |
+
self.map.setZoom(ui.value);
|
13144 |
+
}
|
13145 |
+
});
|
13146 |
}
|
13147 |
|
13148 |
+
WPGMZA.MapEditPage.prototype.onShiftClick = function(event)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13149 |
{
|
13150 |
+
var checkbox = event.currentTarget;
|
13151 |
+
var row = jQuery(checkbox).closest("tr");
|
|
|
13152 |
|
13153 |
+
if(this.lastSelectedRow && event.shiftKey)
|
13154 |
+
{
|
13155 |
+
var prevIndex = this.lastSelectedRow.index();
|
13156 |
+
var currIndex = row.index();
|
13157 |
+
var startIndex = Math.min(prevIndex, currIndex);
|
13158 |
+
var endIndex = Math.max(prevIndex, currIndex);
|
13159 |
+
var rows = jQuery("[data-wpgmza-admin-marker-datatable] tbody>tr");
|
13160 |
|
13161 |
+
// Clear
|
13162 |
+
jQuery("[data-wpgmza-admin-marker-datatable] input[name='mark']").prop("checked", false);
|
13163 |
|
13164 |
+
for(var i = startIndex; i <= endIndex; i++)
|
13165 |
+
jQuery(rows[i]).find("input[name='mark']").prop("checked", true);
|
13166 |
|
|
|
13167 |
|
13168 |
+
|
13169 |
+
}
|
13170 |
|
13171 |
+
this.lastSelectedRow = row;
|
|
|
|
|
|
|
|
|
|
|
13172 |
}
|
13173 |
|
13174 |
+
WPGMZA.MapEditPage.prototype.onMapTypeChanged = function(event)
|
|
|
|
|
|
|
13175 |
{
|
13176 |
+
if(WPGMZA.settings.engine == "open-layers")
|
13177 |
+
return;
|
13178 |
|
13179 |
+
var mapTypeId;
|
13180 |
+
|
13181 |
+
switch(event.target.value)
|
13182 |
{
|
13183 |
+
case "2":
|
13184 |
+
mapTypeId = google.maps.MapTypeId.SATELLITE;
|
13185 |
+
break;
|
13186 |
+
|
13187 |
+
case "3":
|
13188 |
+
mapTypeId = google.maps.MapTypeId.HYBRID;
|
13189 |
+
break;
|
13190 |
+
|
13191 |
+
case "4":
|
13192 |
+
mapTypeId = google.maps.MapTypeId.TERRAIN;
|
13193 |
+
break;
|
13194 |
+
|
13195 |
+
default:
|
13196 |
+
mapTypeId = google.maps.MapTypeId.ROADMAP;
|
13197 |
+
break;
|
13198 |
}
|
13199 |
|
13200 |
+
this.map.setOptions({
|
13201 |
+
mapTypeId: mapTypeId
|
13202 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13203 |
}
|
13204 |
|
13205 |
+
WPGMZA.MapEditPage.prototype.onMarkerUpdated = function(event)
|
13206 |
{
|
13207 |
+
this.markerDataTable.reload();
|
|
|
|
|
13208 |
}
|
13209 |
|
13210 |
+
WPGMZA.MapEditPage.prototype.onZoomChanged = function(event) {
|
13211 |
+
$(".map_start_zoom").val(this.map.getZoom());
|
13212 |
+
}
|
13213 |
+
|
13214 |
+
WPGMZA.MapEditPage.prototype.onBoundsChanged = function(event)
|
13215 |
{
|
13216 |
+
var location = this.map.getCenter();
|
13217 |
|
13218 |
+
$("#wpgmza_start_location").val(location.lat + "," + location.lng);
|
13219 |
+
$("input[name='map_start_lat']").val(location.lat);
|
13220 |
+
$("input[name='map_start_lng']").val(location.lng);
|
13221 |
+
|
13222 |
+
$("#wpgmza_start_zoom").val(this.map.getZoom());
|
13223 |
+
|
13224 |
+
$("#wpgmaps_save_reminder").show();
|
13225 |
}
|
13226 |
|
13227 |
+
WPGMZA.MapEditPage.prototype.onMapHeightTypeChange = function(event)
|
13228 |
{
|
13229 |
+
if(event.target.value == "%")
|
13230 |
+
$("#wpgmza_height_warning").show();
|
|
|
13231 |
}
|
13232 |
|
13233 |
+
WPGMZA.MapEditPage.prototype.onRightClick = function(event)
|
13234 |
{
|
13235 |
+
var self = this;
|
13236 |
+
var marker;
|
13237 |
|
13238 |
+
if(this.drawingManager && this.drawingManager.mode != WPGMZA.DrawingManager.MODE_MARKER)
|
13239 |
+
return; // Do nothing, not in marker mode
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13240 |
|
13241 |
+
if(!this.rightClickMarker)
|
13242 |
+
{
|
13243 |
+
this.rightClickMarker = WPGMZA.Marker.createInstance({
|
13244 |
+
draggable: true
|
13245 |
+
});
|
13246 |
|
13247 |
+
this.rightClickMarker.on("dragend", function(event) {
|
13248 |
+
$(".wpgmza-marker-panel [data-ajax-name='address']").val(event.latLng.lat + "," + event.latLng.lng);
|
13249 |
+
});
|
13250 |
+
|
13251 |
+
this.map.on("click", function(event) {
|
13252 |
+
self.rightClickMarker.setMap(null);
|
13253 |
+
});
|
13254 |
+
}
|
13255 |
|
13256 |
+
marker = this.rightClickMarker;
|
|
|
13257 |
|
13258 |
+
marker.setPosition(event.latLng);
|
13259 |
+
marker.setMap(this.map);
|
13260 |
+
|
13261 |
+
$(".wpgmza-marker-panel [data-ajax-name='address']").val(event.latLng.lat+', '+event.latLng.lng);
|
13262 |
}
|
13263 |
|
13264 |
+
WPGMZA.MapEditPage.prototype.onDeletePolygon = function(event)
|
13265 |
{
|
13266 |
+
var cur_id = parseInt($(this).attr("id"));
|
13267 |
+
var data = {
|
13268 |
+
action: 'delete_poly',
|
13269 |
+
security: wpgmza_legacy_map_edit_page_vars.ajax_nonce,
|
13270 |
+
map_id: this.map.id,
|
13271 |
+
poly_id: cur_id
|
13272 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
13273 |
|
13274 |
+
$.post(ajaxurl, data, function (response) {
|
13275 |
+
|
13276 |
+
WPGM_Path[cur_id].setMap(null);
|
13277 |
+
delete WPGM_PathData[cur_id];
|
13278 |
+
delete WPGM_Path[cur_id];
|
13279 |
+
$("#wpgmza_poly_holder").html(response);
|
13280 |
+
|
13281 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13282 |
}
|
13283 |
|
13284 |
+
WPGMZA.MapEditPage.prototype.onDeletePolyline = function(event)
|
13285 |
{
|
13286 |
+
var cur_id = $(this).attr("id");
|
13287 |
+
var data = {
|
13288 |
+
action: 'delete_polyline',
|
13289 |
+
security: wpgmza_legacy_map_edit_page_vars.ajax_nonce,
|
13290 |
+
map_id: this.map.id,
|
13291 |
+
poly_id: cur_id
|
13292 |
+
};
|
13293 |
+
|
13294 |
+
$.post(ajaxurl, data, function (response) {
|
13295 |
+
|
13296 |
+
WPGM_PathLine[cur_id].setMap(null);
|
13297 |
+
delete WPGM_PathLineData[cur_id];
|
13298 |
+
delete WPGM_PathLine[cur_id];
|
13299 |
+
$("#wpgmza_polyline_holder").html(response);
|
13300 |
+
|
13301 |
+
});
|
13302 |
}
|
13303 |
|
13304 |
+
WPGMZA.MapEditPage.prototype.onDeleteHeatmap = function(event)
|
13305 |
{
|
13306 |
+
var cur_id = $(this).attr("id");
|
13307 |
+
var data = {
|
13308 |
+
action: 'delete_dataset',
|
13309 |
+
security: wpgmza_legacy_map_edit_page_vars.ajax_nonce,
|
13310 |
+
map_id: this.map.id,
|
13311 |
+
poly_id: cur_id
|
13312 |
+
};
|
13313 |
|
13314 |
+
$.post(ajaxurl, data, function (response) {
|
13315 |
+
|
13316 |
+
heatmap[cur_id].setMap(null);
|
13317 |
+
delete heatmap[cur_id];
|
13318 |
+
$("#wpgmza_heatmap_holder").html(response);
|
13319 |
+
|
13320 |
+
});
|
13321 |
}
|
13322 |
|
13323 |
+
WPGMZA.MapEditPage.prototype.onDeleteCircle = function(event)
|
13324 |
{
|
13325 |
+
var circle_id = $(this).attr("id");
|
|
|
13326 |
|
13327 |
+
var data = {
|
13328 |
+
action: 'delete_circle',
|
13329 |
+
security: wpgmza_legacy_map_edit_page_vars.ajax_nonce,
|
13330 |
+
map_id: this.map.id,
|
13331 |
+
circle_id: circle_id
|
13332 |
+
};
|
13333 |
+
|
13334 |
+
$.post(ajaxurl, data, function (response) {
|
13335 |
+
|
13336 |
+
$("#tabs-m-5 table").replaceWith(response);
|
13337 |
+
|
13338 |
+
circle_array.forEach(function (circle) {
|
13339 |
+
|
13340 |
+
if (circle.id == circle_id) {
|
13341 |
+
circle.setMap(null);
|
13342 |
+
return false;
|
13343 |
+
}
|
13344 |
+
|
13345 |
+
});
|
13346 |
+
|
13347 |
+
});
|
13348 |
}
|
13349 |
|
13350 |
+
WPGMZA.MapEditPage.prototype.onDeleteRectangle = function(event)
|
13351 |
+
{
|
13352 |
+
var rectangle_id = $(this).attr("id");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13353 |
|
13354 |
+
var data = {
|
13355 |
+
action: 'delete_rectangle',
|
13356 |
+
security: wpgmza_legacy_map_edit_page_vars.ajax_nonce,
|
13357 |
+
map_id: this.map.id,
|
13358 |
+
rectangle_id: rectangle_id
|
13359 |
};
|
|
|
|
|
|
|
13360 |
|
13361 |
+
$.post(ajaxurl, data, function (response) {
|
|
|
|
|
|
|
|
|
|
|
13362 |
|
13363 |
+
$("#tabs-m-6 table").replaceWith(response);
|
13364 |
+
|
13365 |
+
rectangle_array.forEach(function (rectangle) {
|
13366 |
+
|
13367 |
+
if (rectangle.id == rectangle_id) {
|
13368 |
+
rectangle.setMap(null);
|
13369 |
+
return false;
|
13370 |
+
}
|
13371 |
+
|
13372 |
+
});
|
13373 |
+
|
13374 |
+
});
|
13375 |
+
}
|
13376 |
+
|
13377 |
+
$(document).ready(function(event) {
|
13378 |
+
|
13379 |
+
WPGMZA.mapEditPage = WPGMZA.MapEditPage.createInstance();
|
13380 |
+
|
13381 |
+
});
|
13382 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13383 |
});
|
13384 |
|
13385 |
+
// js/v8/map-edit-page/polygon-panel.js
|
13386 |
/**
|
13387 |
* @namespace WPGMZA
|
13388 |
+
* @module PolygonPanel
|
13389 |
+
* @requires WPGMZA.FeaturePanel
|
13390 |
*/
|
13391 |
jQuery(function($) {
|
13392 |
|
13393 |
+
WPGMZA.PolygonPanel = function(element, mapEditPage)
|
13394 |
+
{
|
13395 |
+
WPGMZA.FeaturePanel.apply(this, arguments);
|
13396 |
+
}
|
13397 |
+
|
13398 |
+
WPGMZA.extend(WPGMZA.PolygonPanel, WPGMZA.FeaturePanel);
|
13399 |
+
|
13400 |
+
WPGMZA.PolygonPanel.createInstance = function(element, mapEditPage)
|
13401 |
+
{
|
13402 |
+
if(WPGMZA.isProVersion())
|
13403 |
+
return new WPGMZA.ProPolygonPanel(element, mapEditPage);
|
13404 |
|
13405 |
+
return new WPGMZA.PolygonPanel(element, mapEditPage);
|
13406 |
+
}
|
13407 |
+
|
13408 |
+
Object.defineProperty(WPGMZA.PolygonPanel.prototype, "drawingManagerCompleteEvent", {
|
13409 |
|
13410 |
+
"get": function() {
|
13411 |
+
return "polygonclosed";
|
|
|
|
|
13412 |
}
|
13413 |
|
13414 |
+
});
|
13415 |
+
|
13416 |
+
});
|
13417 |
+
|
13418 |
+
// js/v8/map-edit-page/polyline-panel.js
|
13419 |
+
/**
|
13420 |
+
* @namespace WPGMZA
|
13421 |
+
* @module PolylinePanel
|
13422 |
+
* @requires WPGMZA.FeaturePanel
|
13423 |
+
*/
|
13424 |
+
jQuery(function($) {
|
13425 |
+
|
13426 |
+
WPGMZA.PolylinePanel = function(element, mapEditPage)
|
13427 |
+
{
|
13428 |
+
WPGMZA.FeaturePanel.apply(this, arguments);
|
13429 |
+
}
|
13430 |
+
|
13431 |
+
WPGMZA.extend(WPGMZA.PolylinePanel, WPGMZA.FeaturePanel);
|
13432 |
+
|
13433 |
+
WPGMZA.PolylinePanel.createInstance = function(element, mapEditPage)
|
13434 |
+
{
|
13435 |
+
if(WPGMZA.isProVersion())
|
13436 |
+
return new WPGMZA.ProPolylinePanel(element, mapEditPage);
|
13437 |
|
13438 |
+
return new WPGMZA.PolylinePanel(element, mapEditPage);
|
|
|
|
|
13439 |
}
|
13440 |
|
13441 |
+
});
|
13442 |
+
|
13443 |
+
// js/v8/map-edit-page/rectangle-panel.js
|
13444 |
+
/**
|
13445 |
+
* @namespace WPGMZA
|
13446 |
+
* @module RectanglePanel
|
13447 |
+
* @requires WPGMZA.FeaturePanel
|
13448 |
+
*/
|
13449 |
+
jQuery(function($) {
|
13450 |
|
13451 |
+
WPGMZA.RectanglePanel = function(element, mapEditPage)
|
13452 |
+
{
|
13453 |
+
WPGMZA.FeaturePanel.apply(this, arguments);
|
13454 |
}
|
13455 |
|
13456 |
+
WPGMZA.extend(WPGMZA.RectanglePanel, WPGMZA.FeaturePanel);
|
13457 |
+
|
13458 |
+
WPGMZA.RectanglePanel.createInstance = function(element, mapEditPage)
|
13459 |
+
{
|
13460 |
+
if(WPGMZA.isProVersion())
|
13461 |
+
return new WPGMZA.ProRectanglePanel(element, mapEditPage);
|
13462 |
|
13463 |
+
return new WPGMZA.RectanglePanel(element, mapEditPage);
|
13464 |
+
}
|
13465 |
+
|
13466 |
+
WPGMZA.RectanglePanel.prototype.updateFields = function()
|
13467 |
+
{
|
13468 |
+
var bounds = this.feature.getBounds();
|
13469 |
+
if(bounds.north && bounds.west && bounds.south && bounds.east){
|
13470 |
+
$(this.element).find("[data-ajax-name='cornerA']").val( bounds.north + ", " + bounds.west );
|
13471 |
+
$(this.element).find("[data-ajax-name='cornerB']").val( bounds.south + ", " + bounds.east );
|
13472 |
+
}
|
13473 |
+
}
|
13474 |
+
|
13475 |
+
WPGMZA.RectanglePanel.prototype.setTargetFeature = function(feature){
|
13476 |
+
WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this, arguments);
|
13477 |
+
|
13478 |
+
if(feature){
|
13479 |
+
this.updateFields();
|
13480 |
+
}
|
13481 |
+
}
|
13482 |
+
|
13483 |
+
WPGMZA.RectanglePanel.prototype.onDrawingComplete = function(event)
|
13484 |
+
{
|
13485 |
+
WPGMZA.FeaturePanel.prototype.onDrawingComplete.apply(this, arguments);
|
13486 |
+
|
13487 |
+
this.updateFields();
|
13488 |
+
}
|
13489 |
+
|
13490 |
+
WPGMZA.RectanglePanel.prototype.onFeatureChanged = function(event)
|
13491 |
+
{
|
13492 |
+
WPGMZA.FeaturePanel.prototype.onFeatureChanged.apply(this, arguments);
|
13493 |
+
this.updateFields();
|
13494 |
+
}
|
13495 |
+
|
13496 |
+
});
|
13497 |
+
|
13498 |
+
// js/v8/open-layers/ol-circle.js
|
13499 |
+
/**
|
13500 |
+
* @namespace WPGMZA
|
13501 |
+
* @module OLCircle
|
13502 |
+
* @requires WPGMZA.Circle
|
13503 |
+
*/
|
13504 |
+
jQuery(function($) {
|
13505 |
+
|
13506 |
+
var Parent = WPGMZA.Circle;
|
13507 |
+
|
13508 |
+
WPGMZA.OLCircle = function(options, olFeature)
|
13509 |
+
{
|
13510 |
+
var self = this, geom;
|
13511 |
|
13512 |
+
Parent.call(this, options, olFeature);
|
13513 |
|
13514 |
+
if(!options)
|
13515 |
+
options = {};
|
13516 |
|
13517 |
+
if(olFeature)
|
13518 |
+
{
|
13519 |
+
var circle = olFeature.getGeometry();
|
13520 |
+
var center = ol.proj.toLonLat(circle.getCenter());
|
|
|
|
|
|
|
|
|
13521 |
|
13522 |
+
geom = circle;
|
|
|
|
|
|
|
|
|
13523 |
|
13524 |
+
options.center = new WPGMZA.LatLng(
|
13525 |
+
center[1],
|
13526 |
+
center[0]
|
13527 |
+
);
|
13528 |
+
options.radius = circle.getRadius() / 1000;
|
13529 |
+
}
|
13530 |
+
else
|
13531 |
+
{
|
13532 |
+
geom = new ol.geom.Circle(
|
13533 |
+
ol.proj.fromLonLat([
|
13534 |
+
parseFloat(options.center.lng),
|
13535 |
+
parseFloat(options.center.lat)
|
13536 |
+
]),
|
13537 |
+
options.radius * 1000
|
13538 |
+
);
|
13539 |
+
}
|
13540 |
+
|
13541 |
+
this.layer = new ol.layer.Vector({
|
13542 |
+
source: new ol.source.Vector()
|
13543 |
+
});
|
13544 |
+
|
13545 |
+
this.olFeature = new ol.Feature({
|
13546 |
+
geometry: geom
|
13547 |
+
});
|
13548 |
+
|
13549 |
+
this.layer.getSource().addFeature(this.olFeature);
|
13550 |
+
this.layer.getSource().getFeatures()[0].setProperties({
|
13551 |
+
wpgmzaCircle: this,
|
13552 |
+
wpgmzaFeature: this
|
13553 |
+
});
|
13554 |
+
|
13555 |
+
if(options)
|
13556 |
+
this.setOptions(options);
|
13557 |
+
}
|
13558 |
+
|
13559 |
+
WPGMZA.OLCircle.prototype = Object.create(Parent.prototype);
|
13560 |
+
WPGMZA.OLCircle.prototype.constructor = WPGMZA.OLCircle;
|
13561 |
+
|
13562 |
+
WPGMZA.OLCircle.prototype.setOptions = function(options)
|
13563 |
+
{
|
13564 |
+
Parent.prototype.setOptions.call(this, options);
|
13565 |
+
|
13566 |
+
if("editable" in options)
|
13567 |
+
WPGMZA.OLFeature.setInteractionsOnFeature(this, options.editable);
|
13568 |
+
}
|
13569 |
+
|
13570 |
+
WPGMZA.OLCircle.prototype.getCenter = function()
|
13571 |
+
{
|
13572 |
+
var lonLat = ol.proj.toLonLat(this.olFeature.getGeometry().getCenter());
|
13573 |
|
13574 |
+
return new WPGMZA.LatLng({
|
13575 |
+
lat: lonLat[1],
|
13576 |
+
lng: lonLat[0]
|
13577 |
+
});
|
13578 |
+
}
|
13579 |
+
|
13580 |
+
WPGMZA.OLCircle.prototype.recreate = function()
|
13581 |
+
{
|
13582 |
+
if(this.olFeature)
|
13583 |
+
{
|
13584 |
+
this.layer.getSource().removeFeature(this.olFeature);
|
13585 |
+
delete this.olFeature;
|
13586 |
}
|
13587 |
+
|
13588 |
+
if(!this.center || !this.radius)
|
13589 |
+
return;
|
13590 |
+
|
13591 |
+
// IMPORTANT: Please note that due to what appears to be a bug in OpenLayers, the following code MUST be exected specifically in this order, or the circle won't appear
|
13592 |
+
var radius = parseFloat(this.radius) * 1000;
|
13593 |
+
var x, y;
|
13594 |
+
|
13595 |
+
x = this.center.lng;
|
13596 |
+
y = this.center.lat;
|
13597 |
+
|
13598 |
+
var circle4326 = ol.geom.Polygon.circular([x, y], radius, 64);
|
13599 |
+
var circle3857 = circle4326.clone().transform('EPSG:4326', 'EPSG:3857');
|
13600 |
+
|
13601 |
+
this.olFeature = new ol.Feature(circle3857);
|
13602 |
+
|
13603 |
+
this.layer.getSource().addFeature(this.olFeature);
|
13604 |
}
|
13605 |
+
|
13606 |
+
WPGMZA.OLCircle.prototype.setVisible = function(visible)
|
13607 |
+
{
|
13608 |
+
this.layer.setVisible(visible ? true : false);
|
13609 |
}
|
13610 |
|
13611 |
+
WPGMZA.OLCircle.prototype.setCenter = function(center)
|
13612 |
+
{
|
13613 |
+
WPGMZA.Circle.prototype.setCenter.apply(this, arguments);
|
13614 |
|
13615 |
+
this.recreate();
|
13616 |
+
}
|
13617 |
+
|
13618 |
+
WPGMZA.OLCircle.prototype.getRadius = function()
|
13619 |
+
{
|
13620 |
+
var geom = this.layer.getSource().getFeatures()[0].getGeometry();
|
13621 |
+
return geom.getRadius() / 1000; // Meters to kilometers
|
13622 |
+
}
|
13623 |
+
|
13624 |
+
WPGMZA.OLCircle.prototype.setRadius = function(radius)
|
13625 |
+
{
|
13626 |
+
WPGMZA.Circle.prototype.setRadius.apply(this, arguments);
|
13627 |
+
}
|
13628 |
+
|
13629 |
+
WPGMZA.OLCircle.prototype.setOptions = function(options)
|
13630 |
+
{
|
13631 |
+
Parent.prototype.setOptions.apply(this, arguments);
|
13632 |
|
13633 |
+
if("editable" in options)
|
13634 |
+
WPGMZA.OLFeature.setInteractionsOnFeature(this, options.editable);
|
13635 |
}
|
13636 |
|
13637 |
});
|
13638 |
|
13639 |
+
// js/v8/open-layers/ol-drawing-manager.js
|
13640 |
/**
|
13641 |
* @namespace WPGMZA
|
13642 |
+
* @module OLDrawingManager
|
13643 |
+
* @requires WPGMZA.DrawingManager
|
13644 |
*/
|
13645 |
jQuery(function($) {
|
13646 |
+
WPGMZA.OLDrawingManager = function(map)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13647 |
{
|
13648 |
var self = this;
|
13649 |
|
13650 |
+
WPGMZA.DrawingManager.call(this, map);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13651 |
|
13652 |
+
this.source = new ol.source.Vector({wrapX: false});
|
|
|
13653 |
|
13654 |
+
this.layer = new ol.layer.Vector({
|
13655 |
+
source: this.source
|
13656 |
});
|
13657 |
+
|
13658 |
+
/*this.map.on("init", function() {
|
13659 |
+
self.map.olMap.addLayer(self.layer);
|
13660 |
+
});*/
|
13661 |
}
|
13662 |
|
13663 |
+
WPGMZA.OLDrawingManager.prototype = Object.create(WPGMZA.DrawingManager.prototype);
|
13664 |
+
WPGMZA.OLDrawingManager.prototype.constructor = WPGMZA.OLDrawingManager;
|
13665 |
|
13666 |
+
WPGMZA.OLDrawingManager.prototype.setOptions = function(options)
|
13667 |
{
|
13668 |
+
var params = {};
|
|
|
13669 |
|
13670 |
+
if(options.strokeOpacity)
|
13671 |
+
params.stroke = new ol.style.Stroke({
|
13672 |
+
color: WPGMZA.hexOpacityToRGBA(options.strokeColor, options.strokeOpacity)
|
13673 |
+
})
|
13674 |
+
|
13675 |
+
if(options.fillOpacity)
|
13676 |
+
params.fill = new ol.style.Fill({
|
13677 |
+
color: WPGMZA.hexOpacityToRGBA(options.fillColor, options.fillOpacity)
|
13678 |
+
});
|
13679 |
|
13680 |
+
this.layer.setStyle(new ol.style.Style(params));
|
|
|
|
|
13681 |
}
|
13682 |
|
13683 |
+
WPGMZA.OLDrawingManager.prototype.setDrawingMode = function(mode)
|
13684 |
{
|
13685 |
var self = this;
|
13686 |
+
var type, endEventType;
|
13687 |
|
13688 |
+
WPGMZA.DrawingManager.prototype.setDrawingMode.call(this, mode);
|
13689 |
|
13690 |
+
if(this.interaction)
|
13691 |
{
|
13692 |
+
this.map.olMap.removeInteraction(this.interaction);
|
13693 |
+
this.interaction = null;
|
|
|
13694 |
}
|
|
|
|
|
|
|
|
|
|
|
13695 |
|
13696 |
+
switch(mode)
|
13697 |
{
|
13698 |
+
case WPGMZA.DrawingManager.MODE_NONE:
|
13699 |
+
return;
|
13700 |
+
break;
|
13701 |
+
|
13702 |
+
case WPGMZA.DrawingManager.MODE_MARKER:
|
13703 |
+
return;
|
13704 |
+
break;
|
13705 |
+
|
13706 |
+
case WPGMZA.DrawingManager.MODE_POLYGON:
|
13707 |
+
type = "Polygon";
|
13708 |
+
endEventType = "polygonclosed";
|
13709 |
+
break;
|
13710 |
+
|
13711 |
+
case WPGMZA.DrawingManager.MODE_POLYLINE:
|
13712 |
+
type = "LineString";
|
13713 |
+
endEventType = "polylinecomplete";
|
13714 |
+
break;
|
13715 |
+
|
13716 |
+
case WPGMZA.DrawingManager.MODE_CIRCLE:
|
13717 |
+
type = "Circle";
|
13718 |
+
endEventType = "circlecomplete";
|
13719 |
+
break;
|
13720 |
+
|
13721 |
+
case WPGMZA.DrawingManager.MODE_RECTANGLE:
|
13722 |
+
type = "Circle";
|
13723 |
+
endEventType = "rectanglecomplete";
|
13724 |
+
break;
|
13725 |
+
|
13726 |
+
case WPGMZA.DrawingManager.MODE_HEATMAP:
|
13727 |
+
return;
|
13728 |
+
break;
|
13729 |
+
|
13730 |
+
default:
|
13731 |
+
throw new Error("Invalid drawing mode");
|
13732 |
+
break;
|
13733 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13734 |
|
13735 |
+
if(WPGMZA.mapEditPage && WPGMZA.mapEditPage.selectInteraction)
|
13736 |
+
{
|
13737 |
+
WPGMZA.mapEditPage.map.olMap.removeInteraction(WPGMZA.mapEditPage.selectInteraction);
|
|
|
|
|
|
|
|
|
|
|
13738 |
}
|
13739 |
|
13740 |
+
var options = {
|
13741 |
+
source: this.source,
|
13742 |
+
type: type
|
13743 |
+
};
|
13744 |
+
|
13745 |
+
if(mode == WPGMZA.DrawingManager.MODE_RECTANGLE)
|
13746 |
+
options.geometryFunction = ol.interaction.Draw.createBox();
|
13747 |
+
|
13748 |
+
this.interaction = new ol.interaction.Draw(options);
|
13749 |
+
|
13750 |
+
this.interaction.on("drawend", function(event) {
|
13751 |
+
if(!endEventType)
|
13752 |
+
return;
|
13753 |
+
|
13754 |
+
var WPGMZAEvent = new WPGMZA.Event(endEventType);
|
13755 |
+
|
13756 |
+
switch(mode)
|
13757 |
+
{
|
13758 |
+
case WPGMZA.DrawingManager.MODE_POLYGON:
|
13759 |
+
WPGMZAEvent.enginePolygon = event.feature;
|
13760 |
+
break;
|
13761 |
+
|
13762 |
+
case WPGMZA.DrawingManager.MODE_POLYLINE:
|
13763 |
+
WPGMZAEvent.enginePolyline = event.feature;
|
13764 |
+
break;
|
13765 |
+
|
13766 |
+
case WPGMZA.DrawingManager.MODE_CIRCLE:
|
13767 |
+
WPGMZAEvent.engineCircle = event.feature;
|
13768 |
+
break;
|
13769 |
+
|
13770 |
+
case WPGMZA.DrawingManager.MODE_RECTANGLE:
|
13771 |
+
WPGMZAEvent.engineRectangle = event.feature;
|
13772 |
+
break;
|
13773 |
+
|
13774 |
+
default:
|
13775 |
+
throw new Error("Drawing mode not implemented");
|
13776 |
+
break;
|
13777 |
+
}
|
13778 |
+
|
13779 |
+
self.dispatchEvent(WPGMZAEvent);
|
13780 |
+
});
|
13781 |
+
|
13782 |
+
this.map.olMap.addInteraction(this.interaction);
|
13783 |
}
|
13784 |
|
13785 |
});
|
13786 |
|
13787 |
+
// js/v8/open-layers/ol-feature.js
|
13788 |
/**
|
13789 |
* @namespace WPGMZA
|
13790 |
+
* @module OLFeature
|
13791 |
+
* @requires WPGMZA
|
13792 |
*/
|
13793 |
jQuery(function($) {
|
13794 |
|
13795 |
+
WPGMZA.OLFeature = function(options)
|
13796 |
{
|
13797 |
+
WPGMZA.assertInstangeOf(this, "OLFeature");
|
13798 |
|
13799 |
+
WPGMZA.Feature.apply(this, arguments);
|
13800 |
}
|
13801 |
|
13802 |
+
WPGMZA.extend(WPGMZA.OLFeature, WPGMZA.Feature);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13803 |
|
13804 |
+
WPGMZA.OLFeature.getOLStyle = function(options)
|
13805 |
{
|
13806 |
+
var translated = {};
|
13807 |
|
13808 |
if(!options)
|
13809 |
+
return new ol.style.Style();
|
13810 |
|
13811 |
+
options = $.extend({}, options);
|
|
|
13812 |
|
13813 |
+
// NB: Legacy name support
|
13814 |
+
var map = {
|
13815 |
+
"fillcolor": "fillColor",
|
13816 |
+
"opacity": "fillOpacity",
|
13817 |
+
"linecolor": "strokeColor",
|
13818 |
+
"lineopacity": "strokeOpacity",
|
13819 |
+
"linethickness": "strokeWeight"
|
13820 |
+
};
|
13821 |
|
13822 |
+
for(var name in options)
|
13823 |
+
{
|
13824 |
+
if(name in map)
|
13825 |
+
options[map[name]] = options[name];
|
13826 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
13827 |
|
13828 |
+
// Translate
|
13829 |
+
if(options.strokeColor)
|
13830 |
+
{
|
13831 |
+
var opacity = 1.0;
|
13832 |
+
var weight = 1;
|
13833 |
+
|
13834 |
+
if("strokeOpacity" in options)
|
13835 |
+
opacity = options.strokeOpacity;
|
13836 |
+
|
13837 |
+
if("strokeWeight" in options)
|
13838 |
+
weight = options.strokeWeight;
|
13839 |
+
|
13840 |
+
translated.stroke = new ol.style.Stroke({
|
13841 |
+
color: WPGMZA.hexOpacityToString(options.strokeColor, opacity),
|
13842 |
+
width: weight
|
13843 |
+
});
|
13844 |
+
}
|
13845 |
|
13846 |
+
if(options.fillColor)
|
13847 |
+
{
|
13848 |
+
var opacity = 1.0;
|
13849 |
+
|
13850 |
+
if("fillOpacity" in options)
|
13851 |
+
opacity = options.fillOpacity;
|
13852 |
+
|
13853 |
+
var color = WPGMZA.hexOpacityToString(options.fillColor, opacity);
|
13854 |
+
|
13855 |
+
translated.fill = new ol.style.Fill({
|
13856 |
+
color: color
|
13857 |
+
});
|
13858 |
+
}
|
13859 |
+
|
13860 |
+
return new ol.style.Style(translated);
|
|
|
|
|
|
|
|
|
|
|
|
|
13861 |
}
|
13862 |
|
13863 |
+
WPGMZA.OLFeature.setInteractionsOnFeature = function(feature, enable)
|
13864 |
{
|
13865 |
+
if(enable)
|
13866 |
+
{
|
13867 |
+
if(feature.modifyInteraction)
|
13868 |
+
return;
|
13869 |
+
|
13870 |
+
feature.snapInteraction = new ol.interaction.Snap({
|
13871 |
+
source: feature.layer.getSource()
|
13872 |
+
});
|
13873 |
+
|
13874 |
+
feature.map.olMap.addInteraction(feature.snapInteraction);
|
13875 |
+
|
13876 |
+
feature.modifyInteraction = new ol.interaction.Modify({
|
13877 |
+
source: feature.layer.getSource()
|
13878 |
+
});
|
13879 |
+
|
13880 |
+
feature.map.olMap.addInteraction(feature.modifyInteraction);
|
13881 |
+
|
13882 |
+
feature.modifyInteraction.on("modifyend", function(event) {
|
13883 |
+
feature.trigger("change");
|
13884 |
+
});
|
13885 |
+
|
13886 |
+
// NB: I believe this was causing issues with an older version of OpenLayers when two interactions were simultaneiously on, worth trying again.
|
13887 |
+
/*feature.translateInteraction = new ol.interaction.Translate({
|
13888 |
+
source: feature.layer.getSource()
|
13889 |
+
});
|
13890 |
+
|
13891 |
+
feature.map.olMap.addInteraction(feature.translateInteraction);*/
|
13892 |
+
}
|
13893 |
else
|
13894 |
+
{
|
13895 |
+
if(!feature.modifyInteraction)
|
13896 |
+
return;
|
13897 |
+
|
13898 |
+
if(feature.map)
|
13899 |
+
{
|
13900 |
+
feature.map.olMap.removeInteraction(feature.snapInteraction);
|
13901 |
+
feature.map.olMap.removeInteraction(feature.modifyInteraction);
|
13902 |
+
// feature.map.olMap.removeInteraction(feature.translateInteraction);
|
13903 |
+
}
|
13904 |
+
|
13905 |
+
delete feature.snapInteraction;
|
13906 |
+
delete feature.modifyInteraction;
|
13907 |
+
// delete feature.translateInteraction;
|
13908 |
+
}
|
13909 |
}
|
13910 |
|
13911 |
});
|
13912 |
|
13913 |
+
// js/v8/open-layers/ol-geocoder.js
|
13914 |
/**
|
13915 |
* @namespace WPGMZA
|
13916 |
+
* @module OLGeocoder
|
13917 |
+
* @requires WPGMZA.Geocoder
|
13918 |
*/
|
13919 |
jQuery(function($) {
|
13920 |
|
13921 |
+
/**
|
13922 |
+
* @class OLGeocoder
|
13923 |
+
* @extends Geocoder
|
13924 |
+
* @summary OpenLayers geocoder - uses Nominatim by default
|
13925 |
+
*/
|
13926 |
+
WPGMZA.OLGeocoder = function()
|
|
|
13927 |
{
|
|
|
13928 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13929 |
}
|
13930 |
|
13931 |
+
WPGMZA.OLGeocoder.prototype = Object.create(WPGMZA.Geocoder.prototype);
|
13932 |
+
WPGMZA.OLGeocoder.prototype.constructor = WPGMZA.OLGeocoder;
|
13933 |
|
13934 |
+
/**
|
13935 |
+
* @function getResponseFromCache
|
13936 |
+
* @access protected
|
13937 |
+
* @summary Tries to retrieve cached coordinates from server cache
|
13938 |
+
* @param {string} address The street address to geocode
|
13939 |
+
* @param {function} callback Where to send the results, as an array
|
13940 |
+
* @return {void}
|
13941 |
+
*/
|
13942 |
+
WPGMZA.OLGeocoder.prototype.getResponseFromCache = function(query, callback)
|
13943 |
{
|
13944 |
+
WPGMZA.restAPI.call("/geocode-cache", {
|
13945 |
+
data: {
|
13946 |
+
query: JSON.stringify(query)
|
13947 |
+
},
|
13948 |
+
success: function(response, xhr, status) {
|
13949 |
+
// Legacy compatibility support
|
13950 |
+
response.lng = response.lon;
|
13951 |
+
|
13952 |
+
callback(response);
|
13953 |
+
},
|
13954 |
+
useCompressedPathVariable: true
|
13955 |
+
});
|
13956 |
|
13957 |
+
/*$.ajax(WPGMZA.ajaxurl, {
|
13958 |
+
data: {
|
13959 |
+
action: "wpgmza_query_nominatim_cache",
|
13960 |
+
query: JSON.stringify(query)
|
13961 |
+
},
|
13962 |
+
success: function(response, xhr, status) {
|
13963 |
+
// Legacy compatibility support
|
13964 |
+
response.lng = response.lon;
|
13965 |
+
|
13966 |
+
callback(response);
|
13967 |
+
}
|
13968 |
+
});*/
|
13969 |
}
|
13970 |
|
13971 |
+
/**
|
13972 |
+
* @function getResponseFromNominatim
|
13973 |
+
* @access protected
|
13974 |
+
* @summary Queries Nominatim on the specified address
|
13975 |
+
* @param {object} options An object containing the options for geocoding, address is a mandatory field
|
13976 |
+
* @param {function} callback The function to send the results to, as an array
|
13977 |
+
*/
|
13978 |
+
WPGMZA.OLGeocoder.prototype.getResponseFromNominatim = function(options, callback)
|
13979 |
{
|
13980 |
+
var data = {
|
13981 |
+
q: options.address,
|
13982 |
+
format: "json"
|
13983 |
+
};
|
13984 |
|
13985 |
+
if(options.componentRestrictions && options.componentRestrictions.country){
|
13986 |
+
data.countrycodes = options.componentRestrictions.country;
|
13987 |
+
} else if(options.country){
|
13988 |
+
data.countrycodes = options.country;
|
13989 |
+
}
|
13990 |
+
|
13991 |
+
$.ajax("https://nominatim.openstreetmap.org/search/", {
|
13992 |
+
data: data,
|
13993 |
+
success: function(response, xhr, status) {
|
13994 |
+
callback(response);
|
13995 |
+
},
|
13996 |
+
error: function(response, xhr, status) {
|
13997 |
+
callback(null, WPGMZA.Geocoder.FAIL)
|
13998 |
+
}
|
13999 |
+
});
|
14000 |
}
|
14001 |
|
14002 |
+
/**
|
14003 |
+
* @function cacheResponse
|
14004 |
+
* @access protected
|
14005 |
+
* @summary Caches a response on the server, usually after it's been returned from Nominatim
|
14006 |
+
* @param {string} address The street address
|
14007 |
+
* @param {object|array} response The response to cache
|
14008 |
+
* @returns {void}
|
14009 |
+
*/
|
14010 |
+
WPGMZA.OLGeocoder.prototype.cacheResponse = function(query, response)
|
14011 |
{
|
14012 |
+
$.ajax(WPGMZA.ajaxurl, {
|
14013 |
+
data: {
|
14014 |
+
action: "wpgmza_store_nominatim_cache",
|
14015 |
+
query: JSON.stringify(query),
|
14016 |
+
response: JSON.stringify(response)
|
14017 |
+
},
|
14018 |
+
method: "POST"
|
14019 |
+
});
|
14020 |
}
|
14021 |
+
|
14022 |
+
/**
|
14023 |
+
* @function clearCache
|
14024 |
+
* @access protected
|
14025 |
+
* @summary Clears the Nomanatim geocode cache
|
14026 |
+
* @returns {void}
|
14027 |
+
*/
|
14028 |
+
WPGMZA.OLGeocoder.prototype.clearCache = function(callback)
|
14029 |
{
|
14030 |
+
$.ajax(WPGMZA.ajaxurl, {
|
14031 |
+
data: {
|
14032 |
+
action: "wpgmza_clear_nominatim_cache"
|
14033 |
+
},
|
14034 |
+
method: "POST",
|
14035 |
+
success: function(response){
|
14036 |
+
callback(response);
|
14037 |
+
}
|
14038 |
+
});
|
14039 |
}
|
14040 |
|
14041 |
+
WPGMZA.OLGeocoder.prototype.getLatLngFromAddress = function(options, callback)
|
14042 |
{
|
14043 |
+
return WPGMZA.OLGeocoder.prototype.geocode(options, callback);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14044 |
}
|
14045 |
|
14046 |
+
WPGMZA.OLGeocoder.prototype.getAddressFromLatLng = function(options, callback)
|
14047 |
{
|
14048 |
+
return WPGMZA.OLGeocoder.prototype.geocode(options, callback);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14049 |
}
|
14050 |
|
14051 |
+
WPGMZA.OLGeocoder.prototype.geocode = function(options, callback)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14052 |
{
|
14053 |
var self = this;
|
14054 |
|
14055 |
+
if(!options)
|
14056 |
+
throw new Error("Invalid options");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14057 |
|
14058 |
+
if(WPGMZA.LatLng.REGEXP.test(options.address))
|
14059 |
+
{
|
14060 |
+
var latLng = WPGMZA.LatLng.fromString(options.address);
|
14061 |
+
|
14062 |
+
callback([{
|
14063 |
+
geometry: {
|
14064 |
+
location: latLng
|
14065 |
+
},
|
14066 |
+
latLng: latLng,
|
14067 |
+
lat: latLng.lat,
|
14068 |
+
lng: latLng.lng
|
14069 |
+
}], WPGMZA.Geocoder.SUCCESS);
|
14070 |
+
|
14071 |
+
return;
|
14072 |
+
}
|
14073 |
|
14074 |
+
if(options.location)
|
14075 |
+
options.latLng = new WPGMZA.LatLng(options.location);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14076 |
|
14077 |
+
var finish, location;
|
|
|
|
|
14078 |
|
14079 |
+
if(options.address)
|
14080 |
+
{
|
14081 |
+
location = options.address;
|
14082 |
+
|
14083 |
+
finish = function(response, status)
|
14084 |
+
{
|
14085 |
+
for(var i = 0; i < response.length; i++)
|
14086 |
+
{
|
14087 |
+
response[i].geometry = {
|
14088 |
+
location: new WPGMZA.LatLng({
|
14089 |
+
lat: parseFloat(response[i].lat),
|
14090 |
+
lng: parseFloat(response[i].lon)
|
14091 |
+
})
|
14092 |
+
};
|
14093 |
+
|
14094 |
+
response[i].latLng = {
|
14095 |
+
lat: parseFloat(response[i].lat),
|
14096 |
+
lng: parseFloat(response[i].lon)
|
14097 |
+
};
|
14098 |
+
|
14099 |
+
response[i].bounds = new WPGMZA.LatLngBounds(
|
14100 |
+
new WPGMZA.LatLng({
|
14101 |
+
lat: response[i].boundingbox[1],
|
14102 |
+
lng: response[i].boundingbox[2]
|
14103 |
+
}),
|
14104 |
+
new WPGMZA.LatLng({
|
14105 |
+
lat: response[i].boundingbox[0],
|
14106 |
+
lng: response[i].boundingbox[3]
|
14107 |
+
})
|
14108 |
+
);
|
14109 |
+
|
14110 |
+
// Backward compatibility with old UGM
|
14111 |
+
response[i].lng = response[i].lon;
|
14112 |
+
}
|
14113 |
+
|
14114 |
+
callback(response, status);
|
14115 |
+
}
|
14116 |
+
}
|
14117 |
+
else if(options.latLng)
|
14118 |
+
{
|
14119 |
+
location = options.latLng.toString();
|
14120 |
+
|
14121 |
+
finish = function(response, status)
|
14122 |
+
{
|
14123 |
+
var address = response[0].display_name;
|
14124 |
+
callback([address], status);
|
14125 |
+
}
|
14126 |
+
}
|
14127 |
+
else
|
14128 |
+
throw new Error("You must supply either a latLng or address")
|
14129 |
|
14130 |
+
var query = {location: location, options: options};
|
14131 |
+
this.getResponseFromCache(query, function(response) {
|
14132 |
+
if(response.length)
|
14133 |
+
{
|
14134 |
+
finish(response, WPGMZA.Geocoder.SUCCESS);
|
14135 |
+
return;
|
14136 |
+
}
|
14137 |
+
|
14138 |
+
self.getResponseFromNominatim($.extend(options, {address: location}), function(response, status) {
|
14139 |
+
if(status == WPGMZA.Geocoder.FAIL)
|
14140 |
+
{
|
14141 |
+
callback(null, WPGMZA.Geocoder.FAIL);
|
14142 |
+
return;
|
14143 |
+
}
|
14144 |
+
|
14145 |
+
if(response.length == 0)
|
14146 |
+
{
|
14147 |
+
callback([], WPGMZA.Geocoder.ZERO_RESULTS);
|
14148 |
+
return;
|
14149 |
+
}
|
14150 |
+
|
14151 |
+
finish(response, WPGMZA.Geocoder.SUCCESS);
|
14152 |
+
|
14153 |
+
self.cacheResponse(query, response);
|
14154 |
+
});
|
14155 |
});
|
14156 |
+
}
|
14157 |
+
|
14158 |
+
});
|
14159 |
+
|
14160 |
+
// js/v8/open-layers/ol-info-window.js
|
14161 |
+
/**
|
14162 |
+
* @namespace WPGMZA
|
14163 |
+
* @module OLInfoWindow
|
14164 |
+
* @requires WPGMZA.InfoWindow
|
14165 |
+
* @pro-requires WPGMZA.ProInfoWindow
|
14166 |
+
*/
|
14167 |
+
jQuery(function($) {
|
14168 |
+
|
14169 |
+
var Parent;
|
14170 |
+
|
14171 |
+
WPGMZA.OLInfoWindow = function(feature)
|
14172 |
+
{
|
14173 |
+
var self = this;
|
14174 |
|
14175 |
+
Parent.call(this, feature);
|
|
|
|
|
14176 |
|
14177 |
+
this.element = $("<div class='wpgmza-infowindow ol-info-window-container ol-info-window-plain'></div>")[0];
|
14178 |
+
|
14179 |
+
$(this.element).on("click", ".ol-info-window-close", function(event) {
|
14180 |
+
self.close();
|
14181 |
});
|
14182 |
}
|
14183 |
|
14184 |
+
if(WPGMZA.isProVersion())
|
14185 |
+
Parent = WPGMZA.ProInfoWindow;
|
14186 |
+
else
|
14187 |
+
Parent = WPGMZA.InfoWindow;
|
14188 |
|
14189 |
+
WPGMZA.OLInfoWindow.prototype = Object.create(Parent.prototype);
|
14190 |
+
WPGMZA.OLInfoWindow.prototype.constructor = WPGMZA.OLInfoWindow;
|
14191 |
|
14192 |
+
Object.defineProperty(WPGMZA.OLInfoWindow.prototype, "isPanIntoViewAllowed", {
|
14193 |
|
14194 |
+
"get": function()
|
14195 |
+
{
|
14196 |
+
return true;
|
14197 |
}
|
14198 |
|
14199 |
});
|
14200 |
|
14201 |
+
/**
|
14202 |
+
* Opens the info window
|
14203 |
+
* TODO: This should take a feature, not an event
|
14204 |
+
* @return boolean FALSE if the info window should not & will not open, TRUE if it will
|
14205 |
+
*/
|
14206 |
+
WPGMZA.OLInfoWindow.prototype.open = function(map, feature)
|
14207 |
+
{
|
14208 |
+
var self = this;
|
14209 |
+
var latLng = feature.getPosition();
|
14210 |
|
14211 |
+
if(!Parent.prototype.open.call(this, map, feature))
|
14212 |
+
return false;
|
|
|
14213 |
|
14214 |
+
// Set parent for events to bubble up
|
14215 |
+
this.parent = map;
|
|
|
14216 |
|
14217 |
+
if(this.overlay)
|
14218 |
+
this.feature.map.olMap.removeOverlay(this.overlay);
|
14219 |
+
|
14220 |
+
this.overlay = new ol.Overlay({
|
14221 |
+
element: this.element,
|
14222 |
+
stopEvent: true,
|
14223 |
+
insertFirst: true
|
14224 |
+
});
|
14225 |
|
14226 |
+
this.overlay.setPosition(ol.proj.fromLonLat([
|
14227 |
+
latLng.lng,
|
14228 |
+
latLng.lat
|
14229 |
+
]));
|
14230 |
+
self.feature.map.olMap.addOverlay(this.overlay);
|
14231 |
|
14232 |
+
$(this.element).show();
|
14233 |
+
|
14234 |
+
this.setContent(this.content);
|
14235 |
+
|
14236 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
14237 |
+
{
|
14238 |
+
WPGMZA.getImageDimensions(feature.getIcon(), function(size) {
|
14239 |
+
|
14240 |
+
$(self.element).css({left: Math.round(size.width / 2) + "px"});
|
14241 |
+
|
14242 |
+
});
|
14243 |
}
|
14244 |
|
14245 |
+
this.trigger("infowindowopen");
|
14246 |
+
this.trigger("domready");
|
14247 |
+
}
|
14248 |
|
14249 |
+
WPGMZA.OLInfoWindow.prototype.close = function(event)
|
14250 |
+
{
|
14251 |
+
// TODO: Why? This shouldn't have to be here. Removing the overlay should hide the element (it doesn't)
|
14252 |
+
$(this.element).hide();
|
14253 |
|
14254 |
+
if(!this.overlay)
|
14255 |
+
return;
|
|
|
14256 |
|
14257 |
+
WPGMZA.InfoWindow.prototype.close.call(this);
|
14258 |
+
|
14259 |
+
this.trigger("infowindowclose");
|
14260 |
+
|
14261 |
+
this.feature.map.olMap.removeOverlay(this.overlay);
|
14262 |
+
this.overlay = null;
|
14263 |
+
}
|
14264 |
|
14265 |
+
WPGMZA.OLInfoWindow.prototype.setContent = function(html)
|
14266 |
+
{
|
14267 |
+
Parent.prototype.setContent.call(this, html);
|
14268 |
|
14269 |
+
this.content = html;
|
14270 |
+
var eaBtn = !WPGMZA.isProVersion() ? this.addEditButton() : '';
|
14271 |
+
$(this.element).html(eaBtn+"<i class='fa fa-times ol-info-window-close' aria-hidden='true'></i>" + html);
|
14272 |
+
}
|
14273 |
+
|
14274 |
+
WPGMZA.OLInfoWindow.prototype.setOptions = function(options)
|
14275 |
+
{
|
14276 |
+
if(options.maxWidth)
|
14277 |
+
{
|
14278 |
+
$(this.element).css({"max-width": options.maxWidth + "px"});
|
14279 |
}
|
14280 |
+
}
|
14281 |
+
|
14282 |
+
WPGMZA.OLInfoWindow.prototype.onOpen = function()
|
14283 |
+
{
|
14284 |
+
var self = this;
|
14285 |
+
var imgs = $(this.element).find("img");
|
14286 |
+
var numImages = imgs.length;
|
14287 |
+
var numImagesLoaded = 0;
|
14288 |
|
14289 |
+
WPGMZA.InfoWindow.prototype.onOpen.apply(this, arguments);
|
14290 |
+
|
14291 |
+
if(this.isPanIntoViewAllowed)
|
14292 |
+
{
|
14293 |
+
function inside(el, viewport)
|
14294 |
+
{
|
14295 |
+
var a = $(el)[0].getBoundingClientRect();
|
14296 |
+
var b = $(viewport)[0].getBoundingClientRect();
|
14297 |
+
|
14298 |
+
return a.left >= b.left && a.left <= b.right &&
|
14299 |
+
a.right <= b.right && a.right >= b.left &&
|
14300 |
+
a.top >= b.top && a.top <= b.bottom &&
|
14301 |
+
a.bottom <= b.bottom && a.bottom >= b.top;
|
14302 |
+
}
|
14303 |
+
|
14304 |
+
function panIntoView()
|
14305 |
+
{
|
14306 |
+
var height = $(self.element).height();
|
14307 |
+
var offset = -height * 0.45;
|
14308 |
+
|
14309 |
+
self.feature.map.animateNudge(0, offset, self.feature.getPosition());
|
14310 |
+
}
|
14311 |
+
|
14312 |
+
imgs.each(function(index, el) {
|
14313 |
+
el.onload = function() {
|
14314 |
+
if(++numImagesLoaded == numImages && !inside(self.element, self.feature.map.element))
|
14315 |
+
panIntoView();
|
14316 |
+
}
|
14317 |
+
});
|
14318 |
+
|
14319 |
+
if(numImages == 0 && !inside(self.element, self.feature.map.element))
|
14320 |
+
panIntoView();
|
14321 |
+
}
|
14322 |
+
}
|
14323 |
+
|
14324 |
+
});
|
14325 |
+
|
14326 |
+
// js/v8/open-layers/ol-map.js
|
14327 |
+
/**
|
14328 |
+
* @namespace WPGMZA
|
14329 |
+
* @module OLMap
|
14330 |
+
* @requires WPGMZA.Map
|
14331 |
+
* @pro-requires WPGMZA.ProMap
|
14332 |
+
*/
|
14333 |
+
jQuery(function($) {
|
14334 |
+
|
14335 |
+
var Parent;
|
14336 |
+
|
14337 |
+
WPGMZA.OLMap = function(element, options)
|
14338 |
+
{
|
14339 |
+
var self = this;
|
14340 |
+
|
14341 |
+
Parent.call(this, element);
|
14342 |
+
|
14343 |
+
this.setOptions(options);
|
14344 |
+
|
14345 |
+
var viewOptions = this.settings.toOLViewOptions();
|
14346 |
+
|
14347 |
+
$(this.element).html("");
|
14348 |
+
|
14349 |
+
this.olMap = new ol.Map({
|
14350 |
+
target: $(element)[0],
|
14351 |
+
layers: [
|
14352 |
+
this.getTileLayer()
|
14353 |
+
],
|
14354 |
+
view: new ol.View(viewOptions)
|
14355 |
+
});
|
14356 |
+
|
14357 |
+
// NB: Handles legacy checkboxes as well as new, standard controls
|
14358 |
+
function isSettingDisabled(value)
|
14359 |
+
{
|
14360 |
+
if(value === "yes")
|
14361 |
+
return true;
|
14362 |
+
|
14363 |
+
return (value ? true : false);
|
14364 |
+
}
|
14365 |
+
|
14366 |
+
// TODO: Re-implement using correct setting names
|
14367 |
+
// Interactions
|
14368 |
+
this.olMap.getInteractions().forEach(function(interaction) {
|
14369 |
+
|
14370 |
+
// NB: The true and false values are flipped because these settings represent the "disabled" state when true
|
14371 |
+
if(interaction instanceof ol.interaction.DragPan)
|
14372 |
+
interaction.setActive(
|
14373 |
+
!isSettingDisabled(self.settings.wpgmza_settings_map_draggable)
|
14374 |
+
);
|
14375 |
+
else if(interaction instanceof ol.interaction.DoubleClickZoom)
|
14376 |
+
interaction.setActive(
|
14377 |
+
!isSettingDisabled(self.settings.wpgmza_settings_map_clickzoom)
|
14378 |
+
);
|
14379 |
+
else if(interaction instanceof ol.interaction.MouseWheelZoom)
|
14380 |
+
interaction.setActive(
|
14381 |
+
!isSettingDisabled(self.settings.wpgmza_settings_map_scroll)
|
14382 |
+
);
|
14383 |
+
|
14384 |
+
}, this);
|
14385 |
+
|
14386 |
+
// Cooperative gesture handling
|
14387 |
+
if(!(this.settings.wpgmza_force_greedy_gestures == "greedy" || this.settings.wpgmza_force_greedy_gestures == "yes" || this.settings.wpgmza_force_greedy_gestures == true))
|
14388 |
+
{
|
14389 |
+
this.gestureOverlay = $("<div class='wpgmza-gesture-overlay'></div>")
|
14390 |
+
this.gestureOverlayTimeoutID = null;
|
14391 |
+
|
14392 |
+
if(WPGMZA.isTouchDevice())
|
14393 |
+
{
|
14394 |
+
// On touch devices, require two fingers to drag and pan
|
14395 |
+
// NB: Temporarily removed due to inconsistent behaviour
|
14396 |
+
/*this.olMap.getInteractions().forEach(function(interaction) {
|
14397 |
+
|
14398 |
+
if(interaction instanceof ol.interaction.DragPan)
|
14399 |
+
self.olMap.removeInteraction(interaction);
|
14400 |
+
|
14401 |
+
});
|
14402 |
+
|
14403 |
+
this.olMap.addInteraction(new ol.interaction.DragPan({
|
14404 |
+
|
14405 |
+
condition: function(olBrowserEvent) {
|
14406 |
+
|
14407 |
+
var allowed = olBrowserEvent.originalEvent.touches.length == 2;
|
14408 |
+
|
14409 |
+
if(!allowed)
|
14410 |
+
self.showGestureOverlay();
|
14411 |
+
|
14412 |
+
return allowed;
|
14413 |
+
}
|
14414 |
+
|
14415 |
+
}));
|
14416 |
+
|
14417 |
+
this.gestureOverlay.text(WPGMZA.localized_strings.use_two_fingers);*/
|
14418 |
+
}
|
14419 |
+
else
|
14420 |
+
{
|
14421 |
+
// On desktops, require Ctrl + zoom to zoom, show an overlay if that condition is not met
|
14422 |
+
this.olMap.on("wheel", function(event) {
|
14423 |
+
|
14424 |
+
if(!ol.events.condition.platformModifierKeyOnly(event))
|
14425 |
+
{
|
14426 |
+
self.showGestureOverlay();
|
14427 |
+
event.originalEvent.preventDefault();
|
14428 |
+
return false;
|
14429 |
+
}
|
14430 |
+
|
14431 |
+
});
|
14432 |
+
|
14433 |
+
this.gestureOverlay.text(WPGMZA.localized_strings.use_ctrl_scroll_to_zoom);
|
14434 |
+
}
|
14435 |
+
}
|
14436 |
+
|
14437 |
+
// Controls
|
14438 |
+
this.olMap.getControls().forEach(function(control) {
|
14439 |
+
|
14440 |
+
// NB: The true and false values are flipped because these settings represent the "disabled" state when true
|
14441 |
+
if(control instanceof ol.control.Zoom && WPGMZA.settings.wpgmza_settings_map_zoom == true)
|
14442 |
+
self.olMap.removeControl(control);
|
14443 |
+
|
14444 |
+
}, this);
|
14445 |
+
|
14446 |
+
if(!isSettingDisabled(WPGMZA.settings.wpgmza_settings_map_full_screen_control))
|
14447 |
+
this.olMap.addControl(new ol.control.FullScreen());
|
14448 |
+
|
14449 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
14450 |
+
{
|
14451 |
+
// Marker layer
|
14452 |
+
this.markerLayer = new ol.layer.Vector({
|
14453 |
+
source: new ol.source.Vector({
|
14454 |
+
features: []
|
14455 |
+
})
|
14456 |
+
});
|
14457 |
+
this.olMap.addLayer(this.markerLayer);
|
14458 |
+
|
14459 |
+
this.olMap.on("click", function(event) {
|
14460 |
+
var features = self.olMap.getFeaturesAtPixel(event.pixel);
|
14461 |
+
|
14462 |
+
if(!features || !features.length)
|
14463 |
+
return;
|
14464 |
+
|
14465 |
+
var marker = features[0].wpgmzaMarker;
|
14466 |
+
|
14467 |
+
if(!marker){
|
14468 |
+
return;
|
14469 |
+
}
|
14470 |
+
|
14471 |
+
marker.trigger("click");
|
14472 |
+
marker.trigger("select");
|
14473 |
+
});
|
14474 |
+
}
|
14475 |
+
|
14476 |
+
// Listen for drag start
|
14477 |
+
this.olMap.on("movestart", function(event) {
|
14478 |
+
self.isBeingDragged = true;
|
14479 |
+
});
|
14480 |
+
|
14481 |
+
// Listen for end of pan so we can wrap longitude if needs be
|
14482 |
+
this.olMap.on("moveend", function(event) {
|
14483 |
+
self.wrapLongitude();
|
14484 |
+
|
14485 |
+
self.isBeingDragged = false;
|
14486 |
+
self.dispatchEvent("dragend");
|
14487 |
+
self.onIdle();
|
14488 |
+
});
|
14489 |
+
|
14490 |
+
// Listen for zoom
|
14491 |
+
this.olMap.getView().on("change:resolution", function(event) {
|
14492 |
+
self.dispatchEvent("zoom_changed");
|
14493 |
+
self.dispatchEvent("zoomchanged");
|
14494 |
+
setTimeout(function() {
|
14495 |
+
self.onIdle();
|
14496 |
+
}, 10);
|
14497 |
+
});
|
14498 |
+
|
14499 |
+
// Listen for bounds changing
|
14500 |
+
this.olMap.getView().on("change", function() {
|
14501 |
+
// Wrap longitude
|
14502 |
+
self.onBoundsChanged();
|
14503 |
+
});
|
14504 |
+
self.onBoundsChanged();
|
14505 |
+
|
14506 |
+
// Hover interaction
|
14507 |
+
this._mouseoverNativeFeatures = [];
|
14508 |
+
|
14509 |
+
this.olMap.on("pointermove", function(event) {
|
14510 |
+
|
14511 |
+
if(event.dragging)
|
14512 |
+
return;
|
14513 |
+
|
14514 |
+
try{
|
14515 |
+
var featuresUnderPixel = event.target.getFeaturesAtPixel(event.pixel);
|
14516 |
+
}catch(e) {
|
14517 |
+
// NB: Hacktacular.. An error is thrown when you mouse over a heatmap. See https://github.com/openlayers/openlayers/issues/10100. This was allegedly solved and merged in but seems to still be present in OpenLayers 6.4.3.
|
14518 |
+
return;
|
14519 |
+
}
|
14520 |
+
|
14521 |
+
if(!featuresUnderPixel)
|
14522 |
+
featuresUnderPixel = [];
|
14523 |
+
|
14524 |
+
var nativeFeaturesUnderPixel = [], i, props;
|
14525 |
+
|
14526 |
+
for(i = 0; i < featuresUnderPixel.length; i++)
|
14527 |
+
{
|
14528 |
+
props = featuresUnderPixel[i].getProperties();
|
14529 |
+
|
14530 |
+
if(!props.wpgmzaFeature)
|
14531 |
+
continue;
|
14532 |
+
|
14533 |
+
nativeFeature = props.wpgmzaFeature;
|
14534 |
+
nativeFeaturesUnderPixel.push(nativeFeature);
|
14535 |
+
|
14536 |
+
if(self._mouseoverNativeFeatures.indexOf(nativeFeature) == -1)
|
14537 |
+
{
|
14538 |
+
// Now hovering over this feature, when we weren't previously
|
14539 |
+
nativeFeature.trigger("mouseover");
|
14540 |
+
self._mouseoverNativeFeatures.push(nativeFeature);
|
14541 |
+
}
|
14542 |
+
}
|
14543 |
+
|
14544 |
+
for(i = self._mouseoverNativeFeatures.length - 1; i >= 0; i--)
|
14545 |
+
{
|
14546 |
+
nativeFeature = self._mouseoverNativeFeatures[i];
|
14547 |
+
|
14548 |
+
if(nativeFeaturesUnderPixel.indexOf(nativeFeature) == -1)
|
14549 |
+
{
|
14550 |
+
// No longer hovering over this feature, where we had been previously
|
14551 |
+
nativeFeature.trigger("mouseout");
|
14552 |
+
self._mouseoverNativeFeatures.splice(i, 1);
|
14553 |
+
}
|
14554 |
+
}
|
14555 |
+
|
14556 |
+
});
|
14557 |
+
|
14558 |
+
// Right click listener
|
14559 |
+
$(this.element).on("click contextmenu", function(event) {
|
14560 |
+
|
14561 |
+
var isRight;
|
14562 |
+
event = event || window.event;
|
14563 |
+
|
14564 |
+
var latLng = self.pixelsToLatLng(event.offsetX, event.offsetY);
|
14565 |
+
|
14566 |
+
if("which" in event)
|
14567 |
+
isRight = event.which == 3;
|
14568 |
+
else if("button" in event)
|
14569 |
+
isRight = event.button == 2;
|
14570 |
+
|
14571 |
+
if(event.which == 1 || event.button == 1){
|
14572 |
+
if(self.isBeingDragged)
|
14573 |
+
return;
|
14574 |
+
|
14575 |
+
// Left click
|
14576 |
+
if($(event.target).closest(".ol-marker").length)
|
14577 |
+
return; // A marker was clicked, not the map. Do nothing
|
14578 |
+
|
14579 |
+
/*
|
14580 |
+
* User is clicking on the map, but looks like it was not a marker...
|
14581 |
+
*
|
14582 |
+
* Finding a light at the end of the tunnel
|
14583 |
+
*/
|
14584 |
+
try{
|
14585 |
+
var featuresUnderPixel = self.olMap.getFeaturesAtPixel([event.offsetX, event.offsetY]);
|
14586 |
+
}catch(e) {
|
14587 |
+
return;
|
14588 |
+
}
|
14589 |
+
|
14590 |
+
if(!featuresUnderPixel)
|
14591 |
+
featuresUnderPixel = [];
|
14592 |
+
|
14593 |
+
var nativeFeaturesUnderPixel = [], i, props;
|
14594 |
+
for(i = 0; i < featuresUnderPixel.length; i++){
|
14595 |
+
props = featuresUnderPixel[i].getProperties();
|
14596 |
+
|
14597 |
+
if(!props.wpgmzaFeature)
|
14598 |
+
continue;
|
14599 |
+
|
14600 |
+
nativeFeature = props.wpgmzaFeature;
|
14601 |
+
nativeFeaturesUnderPixel.push(nativeFeature);
|
14602 |
+
|
14603 |
+
nativeFeature.trigger("click");
|
14604 |
+
}
|
14605 |
+
|
14606 |
+
if(featuresUnderPixel.length > 0){
|
14607 |
+
/*
|
14608 |
+
* This is for a pixel interpolated feature, like polygons
|
14609 |
+
*
|
14610 |
+
* Let's return early, to avoid double event firing
|
14611 |
+
*/
|
14612 |
+
return;
|
14613 |
+
}
|
14614 |
+
|
14615 |
+
self.trigger({
|
14616 |
+
type: "click",
|
14617 |
+
latLng: latLng
|
14618 |
+
});
|
14619 |
+
|
14620 |
+
return;
|
14621 |
+
}
|
14622 |
+
|
14623 |
+
if(!isRight){
|
14624 |
+
return;
|
14625 |
+
}
|
14626 |
+
|
14627 |
+
return self.onRightClick(event);
|
14628 |
+
});
|
14629 |
+
|
14630 |
+
// Dispatch event
|
14631 |
+
if(!WPGMZA.isProVersion())
|
14632 |
+
{
|
14633 |
+
this.trigger("init");
|
14634 |
+
|
14635 |
+
this.dispatchEvent("created");
|
14636 |
+
WPGMZA.events.dispatchEvent({type: "mapcreated", map: this});
|
14637 |
+
|
14638 |
+
// Legacy event
|
14639 |
+
$(this.element).trigger("wpgooglemaps_loaded");
|
14640 |
+
}
|
14641 |
+
}
|
14642 |
+
|
14643 |
+
if(WPGMZA.isProVersion())
|
14644 |
+
Parent = WPGMZA.ProMap;
|
14645 |
+
else
|
14646 |
+
Parent = WPGMZA.Map;
|
14647 |
+
|
14648 |
+
WPGMZA.OLMap.prototype = Object.create(Parent.prototype);
|
14649 |
+
WPGMZA.OLMap.prototype.constructor = WPGMZA.OLMap;
|
14650 |
+
|
14651 |
+
WPGMZA.OLMap.prototype.getTileLayer = function()
|
14652 |
+
{
|
14653 |
+
var options = {};
|
14654 |
+
|
14655 |
+
if(WPGMZA.settings.tile_server_url){
|
14656 |
+
options.url = WPGMZA.settings.tile_server_url;
|
14657 |
+
|
14658 |
+
if(WPGMZA.settings.tile_server_url === 'custom_override'){
|
14659 |
+
if(WPGMZA.settings.tile_server_url_override && WPGMZA.settings.tile_server_url_override.trim() !== ""){
|
14660 |
+
options.url = WPGMZA.settings.tile_server_url_override.trim();
|
14661 |
+
} else {
|
14662 |
+
//Override attempt, let's default?
|
14663 |
+
options.url = "https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
14664 |
+
}
|
14665 |
+
}
|
14666 |
+
|
14667 |
+
if(WPGMZA.settings.open_layers_api_key && WPGMZA.settings.open_layers_api_key !== ""){
|
14668 |
+
options.url += "?apikey=" + WPGMZA.settings.open_layers_api_key.trim();
|
14669 |
+
}
|
14670 |
+
}
|
14671 |
+
|
14672 |
+
return new ol.layer.Tile({
|
14673 |
+
source: new ol.source.OSM(options)
|
14674 |
+
});
|
14675 |
+
}
|
14676 |
+
|
14677 |
+
WPGMZA.OLMap.prototype.wrapLongitude = function()
|
14678 |
+
{
|
14679 |
+
var transformed = ol.proj.transform(this.olMap.getView().getCenter(), "EPSG:3857", "EPSG:4326");
|
14680 |
+
var center = {
|
14681 |
+
lat: transformed[1],
|
14682 |
+
lng: transformed[0]
|
14683 |
+
};
|
14684 |
+
|
14685 |
+
if(center.lng >= -180 && center.lng <= 180)
|
14686 |
+
return;
|
14687 |
+
|
14688 |
+
center.lng = center.lng - 360 * Math.floor(center.lng / 360);
|
14689 |
+
|
14690 |
+
if(center.lng > 180)
|
14691 |
+
center.lng -= 360;
|
14692 |
+
|
14693 |
+
this.setCenter(center);
|
14694 |
+
}
|
14695 |
+
|
14696 |
+
WPGMZA.OLMap.prototype.getCenter = function()
|
14697 |
+
{
|
14698 |
+
var lonLat = ol.proj.toLonLat(
|
14699 |
+
this.olMap.getView().getCenter()
|
14700 |
+
);
|
14701 |
+
return {
|
14702 |
+
lat: lonLat[1],
|
14703 |
+
lng: lonLat[0]
|
14704 |
+
};
|
14705 |
+
}
|
14706 |
+
|
14707 |
+
WPGMZA.OLMap.prototype.setCenter = function(latLng)
|
14708 |
+
{
|
14709 |
+
var view = this.olMap.getView();
|
14710 |
+
|
14711 |
+
WPGMZA.Map.prototype.setCenter.call(this, latLng);
|
14712 |
+
|
14713 |
+
view.setCenter(ol.proj.fromLonLat([
|
14714 |
+
latLng.lng,
|
14715 |
+
latLng.lat
|
14716 |
+
]));
|
14717 |
+
|
14718 |
+
this.wrapLongitude();
|
14719 |
+
|
14720 |
+
this.onBoundsChanged();
|
14721 |
+
}
|
14722 |
+
|
14723 |
+
WPGMZA.OLMap.prototype.getBounds = function()
|
14724 |
+
{
|
14725 |
+
var bounds = this.olMap.getView().calculateExtent(this.olMap.getSize());
|
14726 |
+
var nativeBounds = new WPGMZA.LatLngBounds();
|
14727 |
+
|
14728 |
+
var topLeft = ol.proj.toLonLat([bounds[0], bounds[1]]);
|
14729 |
+
var bottomRight = ol.proj.toLonLat([bounds[2], bounds[3]]);
|
14730 |
+
|
14731 |
+
nativeBounds.north = topLeft[1];
|
14732 |
+
nativeBounds.south = bottomRight[1];
|
14733 |
+
|
14734 |
+
nativeBounds.west = topLeft[0];
|
14735 |
+
nativeBounds.east = bottomRight[0];
|
14736 |
+
|
14737 |
+
return nativeBounds;
|
14738 |
+
}
|
14739 |
+
|
14740 |
+
/**
|
14741 |
+
* Fit to given boundaries
|
14742 |
+
* @return void
|
14743 |
+
*/
|
14744 |
+
WPGMZA.OLMap.prototype.fitBounds = function(southWest, northEast)
|
14745 |
+
{
|
14746 |
+
if(southWest instanceof WPGMZA.LatLng)
|
14747 |
+
southWest = {lat: southWest.lat, lng: southWest.lng};
|
14748 |
+
if(northEast instanceof WPGMZA.LatLng)
|
14749 |
+
northEast = {lat: northEast.lat, lng: northEast.lng};
|
14750 |
+
else if(southWest instanceof WPGMZA.LatLngBounds)
|
14751 |
+
{
|
14752 |
+
var bounds = southWest;
|
14753 |
+
|
14754 |
+
southWest = {
|
14755 |
+
lat: bounds.south,
|
14756 |
+
lng: bounds.west
|
14757 |
+
};
|
14758 |
+
|
14759 |
+
northEast = {
|
14760 |
+
lat: bounds.north,
|
14761 |
+
lng: bounds.east
|
14762 |
+
};
|
14763 |
+
}
|
14764 |
+
|
14765 |
+
var view = this.olMap.getView();
|
14766 |
+
|
14767 |
+
var extent = ol.extent.boundingExtent([
|
14768 |
+
ol.proj.fromLonLat([
|
14769 |
+
parseFloat(southWest.lng),
|
14770 |
+
parseFloat(southWest.lat)
|
14771 |
+
]),
|
14772 |
+
ol.proj.fromLonLat([
|
14773 |
+
parseFloat(northEast.lng),
|
14774 |
+
parseFloat(northEast.lat)
|
14775 |
+
])
|
14776 |
+
]);
|
14777 |
+
view.fit(extent, this.olMap.getSize());
|
14778 |
+
}
|
14779 |
+
|
14780 |
+
WPGMZA.OLMap.prototype.panTo = function(latLng, zoom)
|
14781 |
+
{
|
14782 |
+
var view = this.olMap.getView();
|
14783 |
+
var options = {
|
14784 |
+
center: ol.proj.fromLonLat([
|
14785 |
+
parseFloat(latLng.lng),
|
14786 |
+
parseFloat(latLng.lat),
|
14787 |
+
]),
|
14788 |
+
duration: 500
|
14789 |
+
};
|
14790 |
+
|
14791 |
+
if(arguments.length > 1)
|
14792 |
+
options.zoom = parseInt(zoom);
|
14793 |
+
|
14794 |
+
view.animate(options);
|
14795 |
+
}
|
14796 |
+
|
14797 |
+
WPGMZA.OLMap.prototype.getZoom = function()
|
14798 |
+
{
|
14799 |
+
return Math.round( this.olMap.getView().getZoom() );
|
14800 |
+
}
|
14801 |
+
|
14802 |
+
WPGMZA.OLMap.prototype.setZoom = function(value)
|
14803 |
+
{
|
14804 |
+
this.olMap.getView().setZoom(value);
|
14805 |
+
}
|
14806 |
+
|
14807 |
+
WPGMZA.OLMap.prototype.getMinZoom = function()
|
14808 |
+
{
|
14809 |
+
return this.olMap.getView().getMinZoom();
|
14810 |
+
}
|
14811 |
+
|
14812 |
+
WPGMZA.OLMap.prototype.setMinZoom = function(value)
|
14813 |
+
{
|
14814 |
+
this.olMap.getView().setMinZoom(value);
|
14815 |
+
}
|
14816 |
+
|
14817 |
+
WPGMZA.OLMap.prototype.getMaxZoom = function()
|
14818 |
+
{
|
14819 |
+
return this.olMap.getView().getMaxZoom();
|
14820 |
+
}
|
14821 |
+
|
14822 |
+
WPGMZA.OLMap.prototype.setMaxZoom = function(value)
|
14823 |
+
{
|
14824 |
+
this.olMap.getView().setMaxZoom(value);
|
14825 |
+
}
|
14826 |
+
|
14827 |
+
WPGMZA.OLMap.prototype.setOptions = function(options)
|
14828 |
+
{
|
14829 |
+
Parent.prototype.setOptions.call(this, options);
|
14830 |
+
|
14831 |
+
if(!this.olMap)
|
14832 |
+
return;
|
14833 |
+
|
14834 |
+
this.olMap.getView().setProperties( this.settings.toOLViewOptions() );
|
14835 |
+
}
|
14836 |
+
|
14837 |
+
/**
|
14838 |
+
* TODO: Consider moving all these functions to their respective classes, same on google map (DO IT!!! It's very misleading having them here)
|
14839 |
+
*/
|
14840 |
+
WPGMZA.OLMap.prototype.addMarker = function(marker)
|
14841 |
+
{
|
14842 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT)
|
14843 |
+
this.olMap.addOverlay(marker.overlay);
|
14844 |
+
else
|
14845 |
+
{
|
14846 |
+
this.markerLayer.getSource().addFeature(marker.feature);
|
14847 |
+
marker.featureInSource = true;
|
14848 |
+
}
|
14849 |
+
|
14850 |
+
Parent.prototype.addMarker.call(this, marker);
|
14851 |
+
}
|
14852 |
+
|
14853 |
+
WPGMZA.OLMap.prototype.removeMarker = function(marker)
|
14854 |
+
{
|
14855 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT)
|
14856 |
+
this.olMap.removeOverlay(marker.overlay);
|
14857 |
+
else
|
14858 |
+
{
|
14859 |
+
this.markerLayer.getSource().removeFeature(marker.feature);
|
14860 |
+
marker.featureInSource = false;
|
14861 |
+
}
|
14862 |
+
|
14863 |
+
Parent.prototype.removeMarker.call(this, marker);
|
14864 |
+
}
|
14865 |
+
|
14866 |
+
WPGMZA.OLMap.prototype.addPolygon = function(polygon)
|
14867 |
+
{
|
14868 |
+
this.olMap.addLayer(polygon.layer);
|
14869 |
+
|
14870 |
+
Parent.prototype.addPolygon.call(this, polygon);
|
14871 |
+
}
|
14872 |
+
|
14873 |
+
WPGMZA.OLMap.prototype.removePolygon = function(polygon)
|
14874 |
+
{
|
14875 |
+
this.olMap.removeLayer(polygon.layer);
|
14876 |
+
|
14877 |
+
Parent.prototype.removePolygon.call(this, polygon);
|
14878 |
+
}
|
14879 |
+
|
14880 |
+
WPGMZA.OLMap.prototype.addPolyline = function(polyline)
|
14881 |
+
{
|
14882 |
+
this.olMap.addLayer(polyline.layer);
|
14883 |
+
|
14884 |
+
Parent.prototype.addPolyline.call(this, polyline);
|
14885 |
+
}
|
14886 |
+
|
14887 |
+
WPGMZA.OLMap.prototype.removePolyline = function(polyline)
|
14888 |
+
{
|
14889 |
+
this.olMap.removeLayer(polyline.layer);
|
14890 |
+
|
14891 |
+
Parent.prototype.removePolyline.call(this, polyline);
|
14892 |
+
}
|
14893 |
+
|
14894 |
+
WPGMZA.OLMap.prototype.addCircle = function(circle)
|
14895 |
+
{
|
14896 |
+
this.olMap.addLayer(circle.layer);
|
14897 |
+
|
14898 |
+
Parent.prototype.addCircle.call(this, circle);
|
14899 |
+
}
|
14900 |
+
|
14901 |
+
WPGMZA.OLMap.prototype.removeCircle = function(circle)
|
14902 |
+
{
|
14903 |
+
this.olMap.removeLayer(circle.layer);
|
14904 |
+
|
14905 |
+
Parent.prototype.removeCircle.call(this, circle);
|
14906 |
+
}
|
14907 |
+
|
14908 |
+
WPGMZA.OLMap.prototype.addRectangle = function(rectangle)
|
14909 |
+
{
|
14910 |
+
this.olMap.addLayer(rectangle.layer);
|
14911 |
+
|
14912 |
+
Parent.prototype.addRectangle.call(this, rectangle);
|
14913 |
+
}
|
14914 |
+
|
14915 |
+
WPGMZA.OLMap.prototype.removeRectangle = function(rectangle)
|
14916 |
+
{
|
14917 |
+
this.olMap.removeLayer(rectangle.layer);
|
14918 |
+
|
14919 |
+
Parent.prototype.removeRectangle.call(this, rectangle);
|
14920 |
+
}
|
14921 |
+
|
14922 |
+
WPGMZA.OLMap.prototype.pixelsToLatLng = function(x, y)
|
14923 |
+
{
|
14924 |
+
if(y == undefined)
|
14925 |
+
{
|
14926 |
+
if("x" in x && "y" in x)
|
14927 |
+
{
|
14928 |
+
y = x.y;
|
14929 |
+
x = x.x;
|
14930 |
+
}
|
14931 |
+
else
|
14932 |
+
console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)");
|
14933 |
+
}
|
14934 |
+
|
14935 |
+
var coord = this.olMap.getCoordinateFromPixel([x, y]);
|
14936 |
+
|
14937 |
+
if(!coord)
|
14938 |
+
return {
|
14939 |
+
x: null,
|
14940 |
+
y: null
|
14941 |
+
};
|
14942 |
+
|
14943 |
+
var lonLat = ol.proj.toLonLat(coord);
|
14944 |
+
return {
|
14945 |
+
lat: lonLat[1],
|
14946 |
+
lng: lonLat[0]
|
14947 |
+
};
|
14948 |
+
}
|
14949 |
+
|
14950 |
+
WPGMZA.OLMap.prototype.latLngToPixels = function(latLng)
|
14951 |
+
{
|
14952 |
+
var coord = ol.proj.fromLonLat([latLng.lng, latLng.lat]);
|
14953 |
+
var pixel = this.olMap.getPixelFromCoordinate(coord);
|
14954 |
+
|
14955 |
+
if(!pixel)
|
14956 |
+
return {
|
14957 |
+
x: null,
|
14958 |
+
y: null
|
14959 |
+
};
|
14960 |
+
|
14961 |
+
return {
|
14962 |
+
x: pixel[0],
|
14963 |
+
y: pixel[1]
|
14964 |
+
};
|
14965 |
+
}
|
14966 |
+
|
14967 |
+
WPGMZA.OLMap.prototype.enableBicycleLayer = function(value)
|
14968 |
+
{
|
14969 |
+
if(value)
|
14970 |
+
{
|
14971 |
+
if(!this.bicycleLayer)
|
14972 |
+
this.bicycleLayer = new ol.layer.Tile({
|
14973 |
+
source: new ol.source.OSM({
|
14974 |
+
url: "http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png"
|
14975 |
+
})
|
14976 |
+
});
|
14977 |
+
|
14978 |
+
this.olMap.addLayer(this.bicycleLayer);
|
14979 |
+
}
|
14980 |
+
else
|
14981 |
+
{
|
14982 |
+
if(!this.bicycleLayer)
|
14983 |
+
return;
|
14984 |
+
|
14985 |
+
this.olMap.removeLayer(this.bicycleLayer);
|
14986 |
+
}
|
14987 |
+
}
|
14988 |
+
|
14989 |
+
WPGMZA.OLMap.prototype.showGestureOverlay = function()
|
14990 |
+
{
|
14991 |
+
var self = this;
|
14992 |
+
|
14993 |
+
clearTimeout(this.gestureOverlayTimeoutID);
|
14994 |
+
|
14995 |
+
$(this.gestureOverlay).stop().animate({opacity: "100"});
|
14996 |
+
$(this.element).append(this.gestureOverlay);
|
14997 |
+
|
14998 |
+
$(this.gestureOverlay).css({
|
14999 |
+
"line-height": $(this.element).height() + "px",
|
15000 |
+
"opacity": "1.0"
|
15001 |
+
});
|
15002 |
+
$(this.gestureOverlay).show();
|
15003 |
+
|
15004 |
+
this.gestureOverlayTimeoutID = setTimeout(function() {
|
15005 |
+
self.gestureOverlay.fadeOut(2000);
|
15006 |
+
}, 2000);
|
15007 |
+
}
|
15008 |
+
|
15009 |
+
WPGMZA.OLMap.prototype.onElementResized = function(event)
|
15010 |
+
{
|
15011 |
+
this.olMap.updateSize();
|
15012 |
+
}
|
15013 |
+
|
15014 |
+
WPGMZA.OLMap.prototype.onRightClick = function(event)
|
15015 |
+
{
|
15016 |
+
if($(event.target).closest(".ol-marker, .wpgmza_modern_infowindow, .wpgmza-modern-store-locator").length)
|
15017 |
+
return true;
|
15018 |
+
|
15019 |
+
var parentOffset = $(this.element).offset();
|
15020 |
+
var relX = event.pageX - parentOffset.left;
|
15021 |
+
var relY = event.pageY - parentOffset.top;
|
15022 |
+
var latLng = this.pixelsToLatLng(relX, relY);
|
15023 |
+
|
15024 |
+
this.trigger({type: "rightclick", latLng: latLng});
|
15025 |
+
|
15026 |
+
// Legacy event compatibility
|
15027 |
+
$(this.element).trigger({type: "rightclick", latLng: latLng});
|
15028 |
+
|
15029 |
+
// Prevent menu
|
15030 |
+
event.preventDefault();
|
15031 |
+
return false;
|
15032 |
+
}
|
15033 |
+
|
15034 |
+
WPGMZA.OLMap.prototype.enableAllInteractions = function()
|
15035 |
+
{
|
15036 |
+
|
15037 |
+
this.olMap.getInteractions().forEach(function(interaction) {
|
15038 |
+
|
15039 |
+
if(interaction instanceof ol.interaction.DragPan || interaction instanceof ol.interaction.DoubleClickZoom || interaction instanceof ol.interaction.MouseWheelZoom)
|
15040 |
+
{
|
15041 |
+
interaction.setActive(true);
|
15042 |
+
}
|
15043 |
+
|
15044 |
+
}, this);
|
15045 |
+
|
15046 |
+
}
|
15047 |
+
|
15048 |
+
});
|
15049 |
+
|
15050 |
+
// js/v8/open-layers/ol-marker.js
|
15051 |
+
/**
|
15052 |
+
* @namespace WPGMZA
|
15053 |
+
* @module OLMarker
|
15054 |
+
* @requires WPGMZA.Marker
|
15055 |
+
* @pro-requires WPGMZA.ProMarker
|
15056 |
+
*/
|
15057 |
+
jQuery(function($) {
|
15058 |
|
15059 |
+
var Parent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15060 |
|
15061 |
+
WPGMZA.OLMarker = function(options)
|
15062 |
{
|
15063 |
+
var self = this;
|
15064 |
|
15065 |
+
Parent.call(this, options);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15066 |
|
15067 |
+
var settings = {};
|
15068 |
+
if(options)
|
15069 |
{
|
15070 |
+
for(var name in options)
|
15071 |
+
{
|
15072 |
+
if(options[name] instanceof WPGMZA.LatLng)
|
15073 |
+
{
|
15074 |
+
settings[name] = options[name].toLatLngLiteral();
|
15075 |
+
}
|
15076 |
+
else if(options[name] instanceof WPGMZA.Map)
|
15077 |
+
{
|
15078 |
+
// Do nothing (ignore)
|
15079 |
+
}
|
15080 |
+
else
|
15081 |
+
settings[name] = options[name];
|
15082 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15083 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15084 |
|
15085 |
+
var origin = ol.proj.fromLonLat([
|
15086 |
+
parseFloat(this.lng),
|
15087 |
+
parseFloat(this.lat)
|
15088 |
+
]);
|
15089 |
|
15090 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT)
|
15091 |
+
{
|
15092 |
+
var img = $("<img alt=''/>")[0];
|
15093 |
+
img.onload = function(event) {
|
15094 |
+
self.updateElementHeight();
|
15095 |
+
if(self.map)
|
15096 |
+
self.map.olMap.updateSize();
|
15097 |
+
}
|
15098 |
+
img.src = WPGMZA.defaultMarkerIcon;
|
15099 |
|
15100 |
+
this.element = $("<div class='ol-marker'></div>")[0];
|
15101 |
+
this.element.appendChild(img);
|
15102 |
+
|
15103 |
+
this.element.wpgmzaMarker = this;
|
15104 |
+
|
15105 |
+
$(this.element).on("mouseover", function(event) {
|
15106 |
+
self.dispatchEvent("mouseover");
|
|
|
|
|
|
|
|
|
15107 |
});
|
|
|
|
|
15108 |
|
15109 |
+
this.overlay = new ol.Overlay({
|
15110 |
+
element: this.element,
|
15111 |
+
position: origin,
|
15112 |
+
positioning: "bottom-center",
|
15113 |
+
stopEvent: false
|
15114 |
+
});
|
15115 |
+
this.overlay.setPosition(origin);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15116 |
|
15117 |
+
if(this.animation)
|
15118 |
+
this.setAnimation(this.animation);
|
15119 |
+
else if(this.anim) // NB: Code to support old name
|
15120 |
+
this.setAnimation(this.anim);
|
15121 |
|
15122 |
+
if(options)
|
15123 |
+
{
|
15124 |
+
if(options.draggable)
|
15125 |
+
this.setDraggable(true);
|
15126 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15127 |
|
15128 |
+
this.rebindClickListener();
|
15129 |
+
}
|
15130 |
+
else if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
15131 |
+
{
|
15132 |
+
this.feature = new ol.Feature({
|
15133 |
+
geometry: new ol.geom.Point(origin)
|
15134 |
+
});
|
15135 |
|
15136 |
+
this.feature.setStyle(this.getVectorLayerStyle());
|
15137 |
+
this.feature.wpgmzaMarker = this;
|
15138 |
+
this.feature.wpgmzaFeature = this;
|
15139 |
}
|
15140 |
+
else
|
15141 |
+
throw new Error("Invalid marker render mode");
|
15142 |
|
15143 |
+
this.setOptions(settings);
|
15144 |
+
this.trigger("init");
|
15145 |
+
}
|
15146 |
+
|
15147 |
+
// NB: Does not presently inherit OLFeature, which it probably should
|
15148 |
+
|
15149 |
+
if(WPGMZA.isProVersion())
|
15150 |
+
Parent = WPGMZA.ProMarker;
|
15151 |
+
else
|
15152 |
+
Parent = WPGMZA.Marker;
|
15153 |
+
|
15154 |
+
WPGMZA.OLMarker.prototype = Object.create(Parent.prototype);
|
15155 |
+
WPGMZA.OLMarker.prototype.constructor = WPGMZA.OLMarker;
|
15156 |
+
|
15157 |
+
WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT = "element";
|
15158 |
+
WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER = "vector"; // NB: This feature is experimental
|
15159 |
+
|
15160 |
+
WPGMZA.OLMarker.renderMode = WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT;
|
15161 |
+
|
15162 |
+
if(WPGMZA.settings.engine == "open-layers" && WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
15163 |
+
{
|
15164 |
+
WPGMZA.OLMarker.defaultVectorLayerStyle = new ol.style.Style({
|
15165 |
+
image: new ol.style.Icon({
|
15166 |
+
anchor: [0.5, 1],
|
15167 |
+
src: WPGMZA.defaultMarkerIcon
|
15168 |
+
})
|
15169 |
});
|
15170 |
+
|
15171 |
+
WPGMZA.OLMarker.hiddenVectorLayerStyle = new ol.style.Style({});
|
15172 |
}
|
15173 |
|
15174 |
+
WPGMZA.OLMarker.prototype.getVectorLayerStyle = function()
|
15175 |
{
|
15176 |
+
if(this.vectorLayerStyle)
|
15177 |
+
return this.vectorLayerStyle;
|
15178 |
|
15179 |
+
return WPGMZA.OLMarker.defaultVectorLayerStyle;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15180 |
}
|
15181 |
|
15182 |
+
WPGMZA.OLMarker.prototype.updateElementHeight = function(height, calledOnFocus)
|
15183 |
{
|
15184 |
+
var self = this;
|
15185 |
|
15186 |
+
if(!height)
|
15187 |
+
height = $(this.element).find("img").height();
|
15188 |
+
|
15189 |
+
if(height == 0 && !calledOnFocus)
|
15190 |
{
|
15191 |
+
$(window).one("focus", function(event) {
|
15192 |
+
self.updateElementHeight(false, true);
|
15193 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15194 |
}
|
15195 |
+
|
15196 |
+
$(this.element).css({height: height + "px"});
|
15197 |
}
|
15198 |
|
15199 |
+
WPGMZA.OLMarker.prototype.addLabel = function()
|
15200 |
{
|
15201 |
+
this.setLabel(this.getLabelText());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15202 |
}
|
15203 |
|
15204 |
+
WPGMZA.OLMarker.prototype.setLabel = function(label)
|
15205 |
+
{
|
15206 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
15207 |
+
{
|
15208 |
+
console.warn("Marker labels are not currently supported in Vector Layer rendering mode");
|
15209 |
return;
|
15210 |
+
}
|
|
|
|
|
|
|
15211 |
|
15212 |
+
if(!label)
|
15213 |
{
|
15214 |
+
if(this.label)
|
15215 |
+
$(this.element).find(".ol-marker-label").remove();
|
15216 |
|
15217 |
+
return;
|
|
|
15218 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
15219 |
|
15220 |
+
if(!this.label)
|
15221 |
+
{
|
15222 |
+
this.label = $("<div class='ol-marker-label'/>");
|
15223 |
+
$(this.element).append(this.label);
|
15224 |
+
}
|
15225 |
|
15226 |
+
this.label.html(label);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15227 |
}
|
15228 |
|
15229 |
+
WPGMZA.OLMarker.prototype.getVisible = function(visible)
|
15230 |
{
|
15231 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
15232 |
{
|
|
|
|
|
|
|
|
|
15233 |
|
|
|
|
|
|
|
|
|
15234 |
}
|
15235 |
+
else
|
15236 |
+
return this.overlay.getElement().style.display != "none";
|
15237 |
}
|
15238 |
|
15239 |
+
WPGMZA.OLMarker.prototype.setVisible = function(visible)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15240 |
{
|
15241 |
+
Parent.prototype.setVisible.call(this, visible);
|
15242 |
+
|
15243 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
15244 |
+
{
|
15245 |
+
if(visible)
|
15246 |
+
{
|
15247 |
+
var style = this.getVectorLayerStyle();
|
15248 |
+
this.feature.setStyle(style);
|
15249 |
+
}
|
15250 |
+
else
|
15251 |
+
this.feature.setStyle(null);
|
15252 |
+
|
15253 |
+
/*var source = this.map.markerLayer.getSource();
|
15254 |
+
|
15255 |
+
/*if(this.featureInSource == visible)
|
15256 |
+
return;
|
15257 |
+
|
15258 |
+
if(visible)
|
15259 |
+
source.addFeature(this.feature);
|
15260 |
+
else
|
15261 |
+
source.removeFeature(this.feature);
|
15262 |
+
|
15263 |
+
this.featureInSource = visible;*/
|
15264 |
+
}
|
15265 |
+
else
|
15266 |
+
this.overlay.getElement().style.display = (visible ? "block" : "none");
|
15267 |
}
|
15268 |
|
15269 |
+
WPGMZA.OLMarker.prototype.setPosition = function(latLng)
|
15270 |
{
|
15271 |
+
Parent.prototype.setPosition.call(this, latLng);
|
15272 |
|
15273 |
+
var origin = ol.proj.fromLonLat([
|
15274 |
+
parseFloat(this.lng),
|
15275 |
+
parseFloat(this.lat)
|
15276 |
+
]);
|
15277 |
|
15278 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
15279 |
+
this.feature.setGeometry(new ol.geom.Point(origin));
|
15280 |
+
else
|
15281 |
+
this.overlay.setPosition(origin);
|
|
|
|
|
|
|
|
|
|
|
15282 |
}
|
15283 |
|
15284 |
+
WPGMZA.OLMarker.prototype.updateOffset = function(x, y)
|
15285 |
{
|
15286 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
15287 |
+
{
|
15288 |
+
console.warn("Marker offset is not currently supported in Vector Layer rendering mode");
|
15289 |
+
return;
|
15290 |
+
}
|
15291 |
|
15292 |
+
var x = this._offset.x;
|
15293 |
+
var y = this._offset.y;
|
15294 |
|
15295 |
+
this.element.style.position = "relative";
|
15296 |
+
this.element.style.left = x + "px";
|
15297 |
+
this.element.style.top = y + "px";
|
|
|
|
|
|
|
|
|
|
|
|
|
15298 |
}
|
15299 |
|
15300 |
+
WPGMZA.OLMarker.prototype.setAnimation = function(anim)
|
15301 |
{
|
15302 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
|
|
|
|
|
|
15303 |
{
|
15304 |
+
console.warn("Marker animation is not currently supported in Vector Layer rendering mode");
|
15305 |
+
return;
|
15306 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15307 |
|
15308 |
+
Parent.prototype.setAnimation.call(this, anim);
|
|
|
|
|
15309 |
|
15310 |
+
switch(anim)
|
15311 |
+
{
|
15312 |
+
case WPGMZA.Marker.ANIMATION_NONE:
|
15313 |
+
$(this.element).removeAttr("data-anim");
|
15314 |
+
break;
|
15315 |
+
|
15316 |
+
case WPGMZA.Marker.ANIMATION_BOUNCE:
|
15317 |
+
$(this.element).attr("data-anim", "bounce");
|
15318 |
+
break;
|
15319 |
+
|
15320 |
+
case WPGMZA.Marker.ANIMATION_DROP:
|
15321 |
+
$(this.element).attr("data-anim", "drop");
|
15322 |
+
break;
|
15323 |
}
|
15324 |
}
|
15325 |
|
15326 |
+
WPGMZA.OLMarker.prototype.setDraggable = function(draggable)
|
15327 |
{
|
15328 |
var self = this;
|
|
|
15329 |
|
15330 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
15331 |
+
{
|
15332 |
+
console.warn("Marker dragging is not currently supported in Vector Layer rendering mode");
|
15333 |
+
return;
|
15334 |
+
}
|
15335 |
|
15336 |
+
if(draggable)
|
15337 |
+
{
|
15338 |
+
var options = {
|
15339 |
+
disabled: false
|
15340 |
+
};
|
15341 |
+
|
15342 |
+
if(!this.jQueryDraggableInitialized)
|
15343 |
+
{
|
15344 |
+
options.start = function(event) {
|
15345 |
+
self.onDragStart(event);
|
15346 |
+
}
|
15347 |
|
15348 |
+
options.stop = function(event) {
|
15349 |
+
self.onDragEnd(event);
|
15350 |
+
};
|
15351 |
+
}
|
15352 |
+
|
15353 |
+
$(this.element).draggable(options);
|
15354 |
+
this.jQueryDraggableInitialized = true;
|
15355 |
+
|
15356 |
+
this.rebindClickListener();
|
15357 |
+
}
|
15358 |
+
else
|
15359 |
+
$(this.element).draggable({disabled: true});
|
15360 |
}
|
15361 |
|
15362 |
+
WPGMZA.OLMarker.prototype.setOpacity = function(opacity)
|
15363 |
{
|
15364 |
+
if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)
|
15365 |
+
{
|
15366 |
+
console.warn("Marker opacity is not currently supported in Vector Layer rendering mode");
|
15367 |
return;
|
15368 |
+
}
|
15369 |
|
15370 |
+
$(this.element).css({opacity: opacity});
|
15371 |
}
|
15372 |
|
15373 |
+
WPGMZA.OLMarker.prototype.onDragStart = function(event)
|
15374 |
+
{
|
15375 |
+
this.isBeingDragged = true;
|
15376 |
|
15377 |
+
this.map.olMap.getInteractions().forEach(function(interaction) {
|
15378 |
+
|
15379 |
+
if(interaction instanceof ol.interaction.DragPan)
|
15380 |
+
interaction.setActive(false);
|
15381 |
+
|
15382 |
+
});
|
15383 |
+
}
|
15384 |
+
|
15385 |
+
WPGMZA.OLMarker.prototype.onDragEnd = function(event)
|
15386 |
+
{
|
15387 |
+
var self = this;
|
15388 |
+
var offset = {
|
15389 |
+
top: parseFloat( $(this.element).css("top").match(/-?\d+/)[0] ),
|
15390 |
+
left: parseFloat( $(this.element).css("left").match(/-?\d+/)[0] )
|
15391 |
+
};
|
15392 |
|
15393 |
+
$(this.element).css({
|
15394 |
+
top: "0px",
|
15395 |
+
left: "0px"
|
15396 |
+
});
|
15397 |
|
15398 |
+
var currentLatLng = this.getPosition();
|
15399 |
+
var pixelsBeforeDrag = this.map.latLngToPixels(currentLatLng);
|
15400 |
+
var pixelsAfterDrag = {
|
15401 |
+
x: pixelsBeforeDrag.x + offset.left,
|
15402 |
+
y: pixelsBeforeDrag.y + offset.top
|
15403 |
+
};
|
15404 |
+
var latLngAfterDrag = this.map.pixelsToLatLng(pixelsAfterDrag);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15405 |
|
15406 |
+
this.setPosition(latLngAfterDrag);
|
|
|
15407 |
|
15408 |
+
this.isBeingDragged = false;
|
15409 |
+
this.trigger({type: "dragend", latLng: latLngAfterDrag});
|
15410 |
+
|
15411 |
+
this.trigger("change");
|
15412 |
+
|
15413 |
+
// NB: "yes" represents disabled
|
15414 |
+
if(this.map.settings.wpgmza_settings_map_draggable != "yes")
|
15415 |
+
this.map.olMap.getInteractions().forEach(function(interaction) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15416 |
|
15417 |
+
if(interaction instanceof ol.interaction.DragPan)
|
15418 |
+
interaction.setActive(true);
|
15419 |
|
15420 |
+
});
|
|
|
|
|
|
|
|
|
15421 |
}
|
15422 |
|
15423 |
+
WPGMZA.OLMarker.prototype.onElementClick = function(event)
|
15424 |
+
{
|
15425 |
+
var self = event.currentTarget.wpgmzaMarker;
|
15426 |
+
|
15427 |
+
if(self.isBeingDragged)
|
15428 |
+
return; // Don't dispatch click event after a drag
|
15429 |
+
|
15430 |
+
self.dispatchEvent("click");
|
15431 |
+
self.dispatchEvent("select");
|
15432 |
+
}
|
15433 |
+
|
15434 |
+
/**
|
15435 |
+
* Binds / rebinds the click listener. This must be bound after draggable is initialized,
|
15436 |
+
* this solves the click listener firing before dragend
|
15437 |
+
*/
|
15438 |
+
WPGMZA.OLMarker.prototype.rebindClickListener = function()
|
15439 |
+
{
|
15440 |
+
$(this.element).off("click", this.onElementClick);
|
15441 |
+
$(this.element).on("click", this.onElementClick);
|
15442 |
+
}
|
15443 |
+
|
15444 |
+
});
|
15445 |
|
15446 |
+
// js/v8/open-layers/ol-modern-store-locator-circle.js
|
15447 |
/**
|
15448 |
* @namespace WPGMZA
|
15449 |
+
* @module OLModernStoreLocatorCircle
|
15450 |
+
* @requires WPGMZA.ModernStoreLocatorCircle
|
15451 |
*/
|
15452 |
jQuery(function($) {
|
15453 |
|
15454 |
+
WPGMZA.OLModernStoreLocatorCircle = function(map, settings)
|
15455 |
{
|
15456 |
+
WPGMZA.ModernStoreLocatorCircle.call(this, map, settings);
|
15457 |
}
|
15458 |
|
15459 |
+
WPGMZA.OLModernStoreLocatorCircle.prototype = Object.create(WPGMZA.ModernStoreLocatorCircle.prototype);
|
15460 |
+
WPGMZA.OLModernStoreLocatorCircle.prototype.constructor = WPGMZA.OLModernStoreLocatorCircle;
|
15461 |
|
15462 |
+
WPGMZA.OLModernStoreLocatorCircle.prototype.initCanvasLayer = function()
|
15463 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15464 |
var self = this;
|
15465 |
+
var mapElement = $(this.map.element);
|
15466 |
+
var olViewportElement = mapElement.children(".ol-viewport");
|
15467 |
|
15468 |
+
this.canvas = document.createElement("canvas");
|
15469 |
+
this.canvas.className = "wpgmza-ol-canvas-overlay";
|
15470 |
+
olViewportElement.find('.ol-layers .ol-layer:first-child').prepend(this.canvas);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15471 |
|
15472 |
+
this.renderFunction = function(event) {
|
|
|
|
|
|
|
|
|
|
|
|
|
15473 |
|
15474 |
+
if(self.canvas.width != olViewportElement.width() || self.canvas.height != olViewportElement.height())
|
15475 |
+
{
|
15476 |
+
self.canvas.width = olViewportElement.width();
|
15477 |
+
self.canvas.height = olViewportElement.height();
|
15478 |
+
|
15479 |
+
$(this.canvas).css({
|
15480 |
+
width: olViewportElement.width() + "px",
|
15481 |
+
height: olViewportElement.height() + "px"
|
15482 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15483 |
}
|
15484 |
+
|
15485 |
+
self.draw();
|
15486 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15487 |
|
15488 |
+
this.map.olMap.on("postrender", this.renderFunction);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15489 |
}
|
15490 |
|
15491 |
+
WPGMZA.OLModernStoreLocatorCircle.prototype.getContext = function(type)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15492 |
{
|
15493 |
+
return this.canvas.getContext(type);
|
15494 |
}
|
15495 |
|
15496 |
+
WPGMZA.OLModernStoreLocatorCircle.prototype.getCanvasDimensions = function()
|
15497 |
+
{
|
15498 |
+
return {
|
15499 |
+
width: this.canvas.width,
|
15500 |
+
height: this.canvas.height
|
15501 |
+
};
|
15502 |
+
}
|
15503 |
|
15504 |
+
WPGMZA.OLModernStoreLocatorCircle.prototype.getCenterPixels = function()
|
15505 |
{
|
15506 |
+
var center = this.map.latLngToPixels(this.settings.center);
|
|
|
15507 |
|
15508 |
+
return center;
|
15509 |
}
|
15510 |
+
|
15511 |
+
WPGMZA.OLModernStoreLocatorCircle.prototype.getWorldOriginOffset = function()
|
15512 |
{
|
15513 |
+
return {
|
15514 |
+
x: 0,
|
15515 |
+
y: 0
|
15516 |
+
};
|
15517 |
}
|
15518 |
|
15519 |
+
WPGMZA.OLModernStoreLocatorCircle.prototype.getTransformedRadius = function(km)
|
15520 |
{
|
15521 |
+
var center = new WPGMZA.LatLng(this.settings.center);
|
15522 |
+
var outer = new WPGMZA.LatLng(center);
|
15523 |
|
15524 |
+
outer.moveByDistance(km, 90);
|
15525 |
+
|
15526 |
+
var centerPixels = this.map.latLngToPixels(center);
|
15527 |
+
var outerPixels = this.map.latLngToPixels(outer);
|
15528 |
+
|
15529 |
+
return Math.abs(outerPixels.x - centerPixels.x);
|
15530 |
|
15531 |
+
/*if(!window.testMarker){
|
15532 |
+
window.testMarker = WPGMZA.Marker.createInstance({
|
15533 |
+
position: outer
|
15534 |
+
});
|
15535 |
+
WPGMZA.maps[0].addMarker(window.testMarker);
|
15536 |
}
|
15537 |
+
|
15538 |
+
return 100;*/
|
15539 |
}
|
15540 |
|
15541 |
+
WPGMZA.OLModernStoreLocatorCircle.prototype.getScale = function()
|
15542 |
{
|
15543 |
+
return 1;
|
15544 |
+
}
|
15545 |
+
|
15546 |
+
WPGMZA.OLModernStoreLocatorCircle.prototype.destroy = function()
|
15547 |
+
{
|
15548 |
+
$(this.canvas).remove();
|
15549 |
+
|
15550 |
+
this.map.olMap.un("postrender", this.renderFunction);
|
15551 |
+
this.map = null;
|
15552 |
+
this.canvas = null;
|
15553 |
}
|
15554 |
|
15555 |
});
|
15556 |
|
15557 |
+
// js/v8/open-layers/ol-modern-store-locator.js
|
15558 |
/**
|
15559 |
* @namespace WPGMZA
|
15560 |
+
* @module OLModernStoreLocator
|
15561 |
+
* @requires WPGMZA.ModernStoreLocator
|
15562 |
*/
|
|
|
|
|
|
|
15563 |
jQuery(function($) {
|
15564 |
|
15565 |
+
WPGMZA.OLModernStoreLocator = function(map_id)
|
|
|
|
|
|
|
15566 |
{
|
15567 |
+
var element;
|
|
|
|
|
|
|
15568 |
|
15569 |
+
WPGMZA.ModernStoreLocator.call(this, map_id);
|
15570 |
|
15571 |
+
if(WPGMZA.isProVersion())
|
15572 |
+
element = $(".wpgmza_map[data-map-id='" + map_id + "']");
|
15573 |
+
else
|
15574 |
+
element = $("#wpgmza_map");
|
15575 |
|
15576 |
+
element.append(this.element);
|
15577 |
+
}
|
15578 |
+
|
15579 |
+
WPGMZA.OLModernStoreLocator.prototype = Object.create(WPGMZA.ModernStoreLocator);
|
15580 |
+
WPGMZA.OLModernStoreLocator.prototype.constructor = WPGMZA.OLModernStoreLocator;
|
15581 |
+
|
15582 |
+
});
|
15583 |
+
|
15584 |
+
// js/v8/open-layers/ol-polygon.js
|
15585 |
+
/**
|
15586 |
+
* @namespace WPGMZA
|
15587 |
+
* @module OLPolygon
|
15588 |
+
* @requires WPGMZA.Polygon
|
15589 |
+
* @pro-requires WPGMZA.ProPolygon
|
15590 |
+
*/
|
15591 |
+
jQuery(function($) {
|
15592 |
+
|
15593 |
+
var Parent;
|
15594 |
+
|
15595 |
+
WPGMZA.OLPolygon = function(options, olFeature)
|
15596 |
+
{
|
15597 |
+
var self = this;
|
15598 |
|
15599 |
+
Parent.call(this, options, olFeature);
|
|
|
|
|
15600 |
|
15601 |
+
if(olFeature)
|
15602 |
+
{
|
15603 |
+
this.olFeature = olFeature;
|
|
|
|
|
|
|
|
|
15604 |
}
|
15605 |
+
else
|
15606 |
+
{
|
15607 |
+
var coordinates = [[]];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15608 |
|
15609 |
+
if(options && options.polydata)
|
15610 |
+
{
|
15611 |
+
var paths = this.parseGeometry(options.polydata);
|
15612 |
+
|
15613 |
+
// NB: We have to close the polygon in OpenLayers for the edit interaction to pick up on the last edge
|
15614 |
+
for(var i = 0; i <= paths.length; i++)
|
15615 |
+
coordinates[0].push(ol.proj.fromLonLat([
|
15616 |
+
parseFloat(paths[i % paths.length].lng),
|
15617 |
+
parseFloat(paths[i % paths.length].lat)
|
15618 |
+
]));
|
15619 |
+
}
|
15620 |
|
15621 |
+
this.olFeature = new ol.Feature({
|
15622 |
+
geometry: new ol.geom.Polygon(coordinates)
|
15623 |
+
});
|
15624 |
+
}
|
15625 |
+
|
15626 |
+
this.layer = new ol.layer.Vector({
|
15627 |
+
source: new ol.source.Vector({
|
15628 |
+
features: [this.olFeature]
|
15629 |
+
})
|
15630 |
});
|
15631 |
+
|
15632 |
+
this.layer.getSource().getFeatures()[0].setProperties({
|
15633 |
+
wpgmzaPolygon: this,
|
15634 |
+
wpgmzaFeature: this
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15635 |
});
|
15636 |
+
|
15637 |
+
if(options)
|
15638 |
+
this.setOptions(options);
|
15639 |
+
}
|
15640 |
+
|
15641 |
+
if(WPGMZA.isProVersion())
|
15642 |
+
Parent = WPGMZA.ProPolygon;
|
15643 |
+
else
|
15644 |
+
Parent = WPGMZA.Polygon;
|
15645 |
+
|
15646 |
+
WPGMZA.OLPolygon.prototype = Object.create(Parent.prototype);
|
15647 |
+
WPGMZA.OLPolygon.prototype.constructor = WPGMZA.OLPolygon;
|
15648 |
+
|
15649 |
+
WPGMZA.OLPolygon.prototype.getGeometry = function()
|
15650 |
+
{
|
15651 |
+
var coordinates = this.olFeature.getGeometry().getCoordinates()[0];
|
15652 |
+
var result = [];
|
15653 |
+
|
15654 |
+
for(var i = 0; i < coordinates.length; i++)
|
15655 |
+
{
|
15656 |
+
var lonLat = ol.proj.toLonLat(coordinates[i]);
|
15657 |
+
var latLng = {
|
15658 |
+
lat: lonLat[1],
|
15659 |
+
lng: lonLat[0]
|
15660 |
+
};
|
15661 |
+
result.push(latLng);
|
15662 |
+
}
|
15663 |
+
|
15664 |
+
return result;
|
15665 |
+
}
|
15666 |
+
|
15667 |
+
WPGMZA.OLPolygon.prototype.setOptions = function(options)
|
15668 |
+
{
|
15669 |
+
Parent.prototype.setOptions.apply(this, arguments);
|
15670 |
+
|
15671 |
+
if("editable" in options)
|
15672 |
+
WPGMZA.OLFeature.setInteractionsOnFeature(this, options.editable);
|
15673 |
+
}
|
15674 |
+
|
15675 |
+
});
|
15676 |
+
|
15677 |
+
// js/v8/open-layers/ol-polyline.js
|
15678 |
+
/**
|
15679 |
+
* @namespace WPGMZA
|
15680 |
+
* @module OLPolyline
|
15681 |
+
* @requires WPGMZA.Polyline
|
15682 |
+
*/
|
15683 |
+
jQuery(function($) {
|
15684 |
+
|
15685 |
+
var Parent;
|
15686 |
+
|
15687 |
+
WPGMZA.OLPolyline = function(options, olFeature)
|
15688 |
+
{
|
15689 |
+
var self = this;
|
15690 |
+
|
15691 |
+
WPGMZA.Polyline.call(this, options);
|
15692 |
+
|
15693 |
+
if(olFeature)
|
15694 |
+
{
|
15695 |
+
this.olFeature = olFeature;
|
15696 |
+
}
|
15697 |
+
else
|
15698 |
+
{
|
15699 |
+
var coordinates = [];
|
15700 |
|
15701 |
+
if(options && options.polydata)
|
15702 |
+
{
|
15703 |
+
var path = this.parseGeometry(options.polydata);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15704 |
|
15705 |
+
for(var i = 0; i < path.length; i++)
|
15706 |
+
{
|
15707 |
+
if(!($.isNumeric(path[i].lat)))
|
15708 |
+
throw new Error("Invalid latitude");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15709 |
|
15710 |
+
if(!($.isNumeric(path[i].lng)))
|
15711 |
+
throw new Error("Invalid longitude");
|
15712 |
+
|
15713 |
+
coordinates.push(ol.proj.fromLonLat([
|
15714 |
+
parseFloat(path[i].lng),
|
15715 |
+
parseFloat(path[i].lat)
|
15716 |
+
]));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15717 |
}
|
15718 |
}
|
15719 |
+
|
15720 |
+
this.olFeature = new ol.Feature({
|
15721 |
+
geometry: new ol.geom.LineString(coordinates)
|
15722 |
+
});
|
15723 |
+
}
|
15724 |
+
|
15725 |
+
this.layer = new ol.layer.Vector({
|
15726 |
+
source: new ol.source.Vector({
|
15727 |
+
features: [this.olFeature]
|
15728 |
+
})
|
15729 |
});
|
15730 |
+
|
15731 |
+
this.layer.getSource().getFeatures()[0].setProperties({
|
15732 |
+
wpgmzaPolyline: this,
|
15733 |
+
wpgmzaFeature: this
|
|
|
15734 |
});
|
15735 |
|
15736 |
+
if(options)
|
15737 |
+
this.setOptions(options);
|
15738 |
+
}
|
15739 |
+
|
15740 |
+
Parent = WPGMZA.Polyline;
|
15741 |
|
15742 |
+
WPGMZA.OLPolyline.prototype = Object.create(Parent.prototype);
|
15743 |
+
WPGMZA.OLPolyline.prototype.constructor = WPGMZA.OLPolyline;
|
15744 |
+
|
15745 |
+
WPGMZA.OLPolyline.prototype.getGeometry = function()
|
15746 |
+
{
|
15747 |
+
var result = [];
|
15748 |
+
var coordinates = this.olFeature.getGeometry().getCoordinates();
|
15749 |
|
15750 |
+
for(var i = 0; i < coordinates.length; i++)
|
15751 |
+
{
|
15752 |
+
var lonLat = ol.proj.toLonLat(coordinates[i]);
|
15753 |
+
var latLng = {
|
15754 |
+
lat: lonLat[1],
|
15755 |
+
lng: lonLat[0]
|
15756 |
+
};
|
15757 |
+
result.push(latLng);
|
15758 |
+
}
|
15759 |
|
15760 |
+
return result;
|
15761 |
+
}
|
15762 |
+
|
15763 |
+
WPGMZA.OLPolyline.prototype.setOptions = function(options)
|
15764 |
+
{
|
15765 |
+
Parent.prototype.setOptions.apply(this, arguments);
|
15766 |
+
|
15767 |
+
if("editable" in options)
|
15768 |
+
WPGMZA.OLFeature.setInteractionsOnFeature(this, options.editable);
|
15769 |
+
}
|
15770 |
+
|
15771 |
+
});
|
15772 |
+
|
15773 |
+
// js/v8/open-layers/ol-rectangle.js
|
15774 |
+
/**
|
15775 |
+
* @namespace WPGMZA
|
15776 |
+
* @module OLRectangle
|
15777 |
+
* @requires WPGMZA.Rectangle
|
15778 |
+
*/
|
15779 |
+
jQuery(function($) {
|
15780 |
+
|
15781 |
+
var Parent = WPGMZA.Rectangle;
|
15782 |
+
|
15783 |
+
WPGMZA.OLRectangle = function(options, olFeature)
|
15784 |
+
{
|
15785 |
+
var self = this;
|
15786 |
|
15787 |
+
Parent.apply(this, arguments);
|
15788 |
+
|
15789 |
+
if(olFeature)
|
|
|
|
|
|
|
15790 |
{
|
15791 |
+
this.olFeature = olFeature;
|
15792 |
+
}
|
15793 |
+
else
|
15794 |
+
{
|
15795 |
+
var coordinates = [[]];
|
15796 |
|
15797 |
+
if(options.cornerA && options.cornerB)
|
15798 |
+
{
|
15799 |
+
coordinates[0].push(ol.proj.fromLonLat([
|
15800 |
+
parseFloat(options.cornerA.lng),
|
15801 |
+
parseFloat(options.cornerA.lat)
|
15802 |
+
]));
|
15803 |
+
|
15804 |
+
coordinates[0].push(ol.proj.fromLonLat([
|
15805 |
+
parseFloat(options.cornerB.lng),
|
15806 |
+
parseFloat(options.cornerA.lat)
|
15807 |
+
]));
|
15808 |
+
|
15809 |
+
coordinates[0].push(ol.proj.fromLonLat([
|
15810 |
+
parseFloat(options.cornerB.lng),
|
15811 |
+
parseFloat(options.cornerB.lat)
|
15812 |
+
]));
|
15813 |
+
|
15814 |
+
coordinates[0].push(ol.proj.fromLonLat([
|
15815 |
+
parseFloat(options.cornerA.lng),
|
15816 |
+
parseFloat(options.cornerB.lat)
|
15817 |
+
]));
|
15818 |
+
|
15819 |
+
coordinates[0].push(ol.proj.fromLonLat([
|
15820 |
+
parseFloat(options.cornerA.lng),
|
15821 |
+
parseFloat(options.cornerA.lat)
|
15822 |
+
]));
|
15823 |
+
}
|
15824 |
|
15825 |
+
this.olFeature = new ol.Feature({
|
15826 |
+
geometry: new ol.geom.Polygon(coordinates)
|
15827 |
});
|
15828 |
}
|
15829 |
|
15830 |
+
this.layer = new ol.layer.Vector({
|
15831 |
+
source: new ol.source.Vector({
|
15832 |
+
features: [this.olFeature]
|
15833 |
+
}),
|
15834 |
+
style: this.olStyle
|
|
|
|
|
|
|
|
|
|
|
15835 |
});
|
15836 |
|
15837 |
+
this.layer.getSource().getFeatures()[0].setProperties({
|
15838 |
+
wpgmzaRectangle: this,
|
15839 |
+
wpgmzaFeature: this
|
15840 |
});
|
15841 |
|
15842 |
+
if(options)
|
15843 |
+
this.setOptions(options);
|
|
|
|
|
|
|
|
|
|
|
|
|
15844 |
}
|
15845 |
|
15846 |
+
WPGMZA.extend(WPGMZA.OLRectangle, WPGMZA.Rectangle);
|
15847 |
|
15848 |
+
// NB: Would be nice to move this onto OLFeature
|
15849 |
+
WPGMZA.OLRectangle.prototype.getBounds = function()
|
15850 |
{
|
15851 |
+
var extent = this.olFeature.getGeometry().getExtent();
|
15852 |
+
var topLeft = ol.extent.getTopLeft(extent);
|
15853 |
+
var bottomRight = ol.extent.getBottomRight(extent);
|
15854 |
|
15855 |
+
var topLeftLonLat = ol.proj.toLonLat(topLeft);
|
15856 |
+
var bottomRightLonLat = ol.proj.toLonLat(bottomRight);
|
15857 |
+
|
15858 |
+
var topLeftLatLng = new WPGMZA.LatLng(topLeftLonLat[1], topLeftLonLat[0]);
|
15859 |
+
var bottomRightLatLng = new WPGMZA.LatLng(bottomRightLonLat[1], bottomRightLonLat[0]);
|
15860 |
+
|
15861 |
+
return new WPGMZA.LatLngBounds(
|
15862 |
+
topLeftLatLng,
|
15863 |
+
bottomRightLatLng
|
15864 |
+
);
|
15865 |
}
|
15866 |
|
15867 |
+
WPGMZA.OLRectangle.prototype.setOptions = function(options)
|
15868 |
{
|
15869 |
+
Parent.prototype.setOptions.apply(this, arguments);
|
15870 |
|
15871 |
+
if("editable" in options)
|
15872 |
+
WPGMZA.OLFeature.setInteractionsOnFeature(this, options.editable);
|
|
|
|
|
|
|
|
|
|
|
15873 |
}
|
15874 |
|
15875 |
+
});
|
15876 |
+
|
15877 |
+
// js/v8/open-layers/ol-text.js
|
15878 |
+
/**
|
15879 |
+
* @namespace WPGMZA
|
15880 |
+
* @module OLText
|
15881 |
+
* @requires WPGMZA.Text
|
15882 |
+
*/
|
15883 |
+
jQuery(function($) {
|
15884 |
+
|
15885 |
+
WPGMZA.OLText = function()
|
15886 |
{
|
|
|
15887 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15888 |
}
|
15889 |
|
15890 |
+
});
|
15891 |
+
|
15892 |
+
// js/v8/tables/datatable.js
|
15893 |
+
/**
|
15894 |
+
* @namespace WPGMZA
|
15895 |
+
* @module DataTable
|
15896 |
+
* @requires WPGMZA
|
15897 |
+
*/
|
15898 |
+
jQuery(function($) {
|
15899 |
+
|
15900 |
+
WPGMZA.DataTable = function(element)
|
15901 |
+
{
|
15902 |
+
var self = this;
|
15903 |
+
if(!$.fn.dataTable)
|
15904 |
+
{
|
15905 |
+
console.warn("The dataTables library is not loaded. Cannot create a dataTable. Did you enable 'Do not enqueue dataTables'?");
|
15906 |
+
|
15907 |
+
if(WPGMZA.settings.wpgmza_do_not_enqueue_datatables && WPGMZA.getCurrentPage() == WPGMZA.PAGE_MAP_EDIT)
|
15908 |
+
alert("You have selected 'Do not enqueue DataTables' in WP Google Maps' settings. No 3rd party software is loading the DataTables library. Because of this, the marker table cannot load. Please uncheck this option to use the marker table.");
|
15909 |
+
|
15910 |
+
return;
|
15911 |
+
}
|
15912 |
+
|
15913 |
+
if($.fn.dataTable.ext){
|
15914 |
+
$.fn.dataTable.ext.errMode = "throw";
|
15915 |
+
} else {
|
15916 |
+
var version = $.fn.dataTable.version ? $.fn.dataTable.version : "unknown";
|
15917 |
+
console.warn("You appear to be running an outdated or modified version of the dataTables library. This may cause issues with table functionality. This is usually caused by 3rd party software loading an older version of DataTables. The loaded version is " + version + ", we recommend version 1.10.12 or above.");
|
15918 |
+
}
|
15919 |
+
|
15920 |
+
if($.fn.dataTable.Api){
|
15921 |
+
$.fn.dataTable.Api.register( 'processing()', function ( show ) {
|
15922 |
+
return this.iterator( 'table', function ( ctx ) {
|
15923 |
+
ctx.oApi._fnProcessingDisplay( ctx, show );
|
15924 |
+
} );
|
15925 |
+
} );
|
15926 |
+
}
|
15927 |
+
|
15928 |
+
this.element = element;
|
15929 |
+
this.element.wpgmzaDataTable = this;
|
15930 |
+
this.dataTableElement = this.getDataTableElement();
|
15931 |
+
|
15932 |
+
var settings = this.getDataTableSettings();
|
15933 |
+
|
15934 |
+
|
15935 |
+
this.phpClass = $(element).attr("data-wpgmza-php-class");
|
15936 |
+
// this.dataTable = $(this.dataTableElement).DataTable(settings);
|
15937 |
+
this.wpgmzaDataTable = this;
|
15938 |
+
|
15939 |
+
this.useCompressedPathVariable = (WPGMZA.restAPI.isCompressedPathVariableSupported && WPGMZA.settings.enable_compressed_path_variables);
|
15940 |
+
this.method = (this.useCompressedPathVariable ? "GET" : "POST");
|
15941 |
+
|
15942 |
+
if(this.getLanguageURL() == undefined || this.getLanguageURL() == "//cdn.datatables.net/plug-ins/1.10.12/i18n/English.json") {
|
15943 |
+
this.dataTable = $(this.dataTableElement).DataTable(settings);
|
15944 |
+
this.dataTable.ajax.reload();
|
15945 |
+
}
|
15946 |
+
else {
|
15947 |
+
|
15948 |
+
$.ajax(this.getLanguageURL(), {
|
15949 |
+
|
15950 |
+
success: function(response, status, xhr){
|
15951 |
+
self.languageJSON = response;
|
15952 |
+
self.dataTable = $(self.dataTableElement).DataTable(settings);
|
15953 |
+
self.dataTable.ajax.reload();
|
15954 |
+
}
|
15955 |
+
|
15956 |
+
});
|
15957 |
+
}
|
15958 |
+
}
|
15959 |
+
|
15960 |
+
WPGMZA.DataTable.prototype.getDataTableElement = function()
|
15961 |
+
{
|
15962 |
+
return $(this.element).find("table");
|
15963 |
+
}
|
15964 |
+
|
15965 |
+
/**
|
15966 |
+
* This function wraps the request so it doesn't collide with WP query vars,
|
15967 |
+
* it also adds the PHP class so that the controller knows which class to
|
15968 |
+
* instantiate
|
15969 |
+
* @return object
|
15970 |
+
*/
|
15971 |
+
WPGMZA.DataTable.prototype.onAJAXRequest = function(data, settings)
|
15972 |
+
{
|
15973 |
+
// TODO: Move this to the REST API module and add useCompressedPathVariable
|
15974 |
+
var params = {
|
15975 |
+
"phpClass": this.phpClass
|
15976 |
+
};
|
15977 |
+
|
15978 |
+
var attr = $(this.element).attr("data-wpgmza-ajax-parameters");
|
15979 |
+
if(attr)
|
15980 |
+
$.extend(params, JSON.parse(attr));
|
15981 |
+
|
15982 |
+
return $.extend(data, params);
|
15983 |
+
}
|
15984 |
+
|
15985 |
+
WPGMZA.DataTable.prototype.onDataTableAjaxRequest = function(data, callback, settings)
|
15986 |
+
{
|
15987 |
+
var self = this;
|
15988 |
+
var element = this.element;
|
15989 |
+
var route = $(element).attr("data-wpgmza-rest-api-route");
|
15990 |
+
var params = this.onAJAXRequest(data, settings);
|
15991 |
+
var draw = params.draw;
|
15992 |
+
|
15993 |
+
delete params.draw;
|
15994 |
+
|
15995 |
+
if(!route)
|
15996 |
+
throw new Error("No data-wpgmza-rest-api-route attribute specified");
|
15997 |
+
|
15998 |
+
var options = {
|
15999 |
+
method: "POST",
|
16000 |
+
useCompressedPathVariable: true,
|
16001 |
+
data: params,
|
16002 |
+
dataType: "json",
|
16003 |
+
cache: !this.preventCaching,
|
16004 |
+
beforeSend: function(xhr) {
|
16005 |
+
// Put draw in header, for compressed requests
|
16006 |
+
xhr.setRequestHeader("X-DataTables-Draw", draw);
|
16007 |
+
},
|
16008 |
+
success: function(response, status, xhr) {
|
16009 |
+
|
16010 |
+
response.draw = draw;
|
16011 |
+
self.lastResponse = response;
|
16012 |
+
|
16013 |
+
|
16014 |
+
callback(response);
|
16015 |
+
|
16016 |
+
$("[data-marker-icon-src]").each(function(index, element) {
|
16017 |
+
var icon = WPGMZA.MarkerIcon.createInstance(
|
16018 |
+
$(element).attr("data-marker-icon-src")
|
16019 |
+
);
|
16020 |
+
|
16021 |
+
icon.applyToElement(element);
|
16022 |
+
});
|
16023 |
+
|
16024 |
+
}
|
16025 |
+
};
|
16026 |
+
|
16027 |
+
return WPGMZA.restAPI.call(route, options);
|
16028 |
+
}
|
16029 |
+
|
16030 |
+
WPGMZA.DataTable.prototype.getDataTableSettings = function()
|
16031 |
+
{
|
16032 |
+
var self = this;
|
16033 |
+
var element = this.element;
|
16034 |
+
var options = {};
|
16035 |
+
|
16036 |
+
if($(element).attr("data-wpgmza-datatable-options"))
|
16037 |
+
options = JSON.parse($(element).attr("data-wpgmza-datatable-options"));
|
16038 |
+
|
16039 |
+
options.deferLoading = true;
|
16040 |
+
options.processing = true;
|
16041 |
+
options.serverSide = true;
|
16042 |
+
options.ajax = function(data, callback, settings) {
|
16043 |
+
return WPGMZA.DataTable.prototype.onDataTableAjaxRequest.apply(self, arguments);
|
16044 |
+
}
|
16045 |
+
|
16046 |
+
if(WPGMZA.AdvancedTableDataTable && this instanceof WPGMZA.AdvancedTableDataTable && WPGMZA.settings.wpgmza_default_items)
|
16047 |
+
options.iDisplayLength = parseInt(WPGMZA.settings.wpgmza_default_items);
|
16048 |
+
|
16049 |
+
options.aLengthMenu = [[5, 10, 25, 50, 100, -1], ["5", "10", "25", "50", "100", WPGMZA.localized_strings.all]];
|
16050 |
+
|
16051 |
+
var languageURL = this.getLanguageURL();
|
16052 |
+
if(languageURL)
|
16053 |
+
options.language = {
|
16054 |
+
"url": languageURL
|
16055 |
+
};
|
16056 |
+
|
16057 |
+
return options;
|
16058 |
+
}
|
16059 |
+
|
16060 |
+
WPGMZA.DataTable.prototype.getLanguageURL = function()
|
16061 |
+
{
|
16062 |
+
if(!WPGMZA.locale)
|
16063 |
+
return null;
|
16064 |
+
|
16065 |
+
var languageURL;
|
16066 |
+
|
16067 |
+
switch(WPGMZA.locale.substr(0, 2))
|
16068 |
+
{
|
16069 |
+
case "af":
|
16070 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Afrikaans.json";
|
16071 |
+
break;
|
16072 |
+
|
16073 |
+
case "sq":
|
16074 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Albanian.json";
|
16075 |
+
break;
|
16076 |
+
|
16077 |
+
case "am":
|
16078 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Amharic.json";
|
16079 |
+
break;
|
16080 |
+
|
16081 |
+
case "ar":
|
16082 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Arabic.json";
|
16083 |
+
break;
|
16084 |
+
|
16085 |
+
case "hy":
|
16086 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Armenian.json";
|
16087 |
+
break;
|
16088 |
+
|
16089 |
+
case "az":
|
16090 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Azerbaijan.json";
|
16091 |
+
break;
|
16092 |
+
|
16093 |
+
case "bn":
|
16094 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Bangla.json";
|
16095 |
+
break;
|
16096 |
+
|
16097 |
+
case "eu":
|
16098 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Basque.json";
|
16099 |
+
break;
|
16100 |
+
|
16101 |
+
case "be":
|
16102 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Belarusian.json";
|
16103 |
+
break;
|
16104 |
+
|
16105 |
+
case "bg":
|
16106 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Bulgarian.json";
|
16107 |
+
break;
|
16108 |
+
|
16109 |
+
case "ca":
|
16110 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Catalan.json";
|
16111 |
+
break;
|
16112 |
+
|
16113 |
+
case "zh":
|
16114 |
+
if(WPGMZA.locale == "zh_TW")
|
16115 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Chinese-traditional.json";
|
16116 |
+
else
|
16117 |
+
languageURL = "//cdn.datatables.net/plug-ins/1.10.12/i18n/Chinese.json";
|
16118 |
+
break;
|
16119 |
+
|
16120 |
+
case "hr":
|
16121 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Croatian.json";
|
16122 |
+
break;
|
16123 |
+
|
16124 |
+
case "cs":
|
16125 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Czech.json";
|
16126 |
+
break;
|
16127 |
+
|
16128 |
+
case "da":
|
16129 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Danish.json";
|
16130 |
+
break;
|
16131 |
+
|
16132 |
+
case "nl":
|
16133 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Dutch.json";
|
16134 |
+
break;
|
16135 |
+
|
16136 |
+
/*case "en":
|
16137 |
+
languageURL = "//cdn.datatables.net/plug-ins/1.10.12/i18n/English.json";
|
16138 |
+
break;*/
|
16139 |
+
|
16140 |
+
case "et":
|
16141 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Estonian.json";
|
16142 |
+
break;
|
16143 |
+
|
16144 |
+
case "fi":
|
16145 |
+
if(WPGMZA.locale.match(/^fil/))
|
16146 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Filipino.json";
|
16147 |
+
else
|
16148 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Finnish.json";
|
16149 |
+
break;
|
16150 |
+
|
16151 |
+
case "fr":
|
16152 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/French.json";
|
16153 |
+
break;
|
16154 |
+
|
16155 |
+
case "gl":
|
16156 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Galician.json";
|
16157 |
+
break;
|
16158 |
+
|
16159 |
+
case "ka":
|
16160 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Georgian.json";
|
16161 |
+
break;
|
16162 |
+
|
16163 |
+
case "de":
|
16164 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/German.json";
|
16165 |
+
break;
|
16166 |
+
|
16167 |
+
case "el":
|
16168 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Greek.json";
|
16169 |
+
break;
|
16170 |
+
|
16171 |
+
case "gu":
|
16172 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Gujarati.json";
|
16173 |
+
break;
|
16174 |
+
|
16175 |
+
case "he":
|
16176 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Hebrew.json";
|
16177 |
+
break;
|
16178 |
+
|
16179 |
+
case "hi":
|
16180 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Hindi.json";
|
16181 |
+
break;
|
16182 |
+
|
16183 |
+
case "hu":
|
16184 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Hungarian.json";
|
16185 |
+
break;
|
16186 |
+
|
16187 |
+
case "is":
|
16188 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Icelandic.json";
|
16189 |
+
break;
|
16190 |
+
|
16191 |
+
/*case "id":
|
16192 |
+
languageURL = "//cdn.datatables.net/plug-ins/1.10.12/i18n/Indonesian-Alternative.json";
|
16193 |
+
break;*/
|
16194 |
+
|
16195 |
+
case "id":
|
16196 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Indonesian.json";
|
16197 |
+
break;
|
16198 |
+
|
16199 |
+
case "ga":
|
16200 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Irish.json";
|
16201 |
+
break;
|
16202 |
+
|
16203 |
+
case "it":
|
16204 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Italian.json";
|
16205 |
+
break;
|
16206 |
+
|
16207 |
+
case "ja":
|
16208 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Japanese.json";
|
16209 |
+
break;
|
16210 |
+
|
16211 |
+
case "kk":
|
16212 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Kazakh.json";
|
16213 |
+
break;
|
16214 |
+
|
16215 |
+
case "ko":
|
16216 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Korean.json";
|
16217 |
+
break;
|
16218 |
+
|
16219 |
+
case "ky":
|
16220 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Kyrgyz.json";
|
16221 |
+
break;
|
16222 |
+
|
16223 |
+
case "lv":
|
16224 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Latvian.json";
|
16225 |
+
break;
|
16226 |
+
|
16227 |
+
case "lt":
|
16228 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Lithuanian.json";
|
16229 |
+
break;
|
16230 |
+
|
16231 |
+
case "mk":
|
16232 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Macedonian.json";
|
16233 |
+
break;
|
16234 |
+
|
16235 |
+
case "ml":
|
16236 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Malay.json";
|
16237 |
+
break;
|
16238 |
+
|
16239 |
+
case "mn":
|
16240 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Mongolian.json";
|
16241 |
+
break;
|
16242 |
+
|
16243 |
+
case "ne":
|
16244 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Nepali.json";
|
16245 |
+
break;
|
16246 |
+
|
16247 |
+
case "nb":
|
16248 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Norwegian-Bokmal.json";
|
16249 |
+
break;
|
16250 |
+
|
16251 |
+
case "nn":
|
16252 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Norwegian-Nynorsk.json";
|
16253 |
+
break;
|
16254 |
+
|
16255 |
+
case "ps":
|
16256 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Pashto.json";
|
16257 |
+
break;
|
16258 |
+
|
16259 |
+
case "fa":
|
16260 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Persian.json";
|
16261 |
+
break;
|
16262 |
+
|
16263 |
+
case "pl":
|
16264 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Polish.json";
|
16265 |
+
break;
|
16266 |
+
|
16267 |
+
case "pt":
|
16268 |
+
if(WPGMZA.locale == "pt_BR")
|
16269 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Portuguese-Brasil.json";
|
16270 |
+
else
|
16271 |
+
languageURL = "//cdn.datatables.net/plug-ins/1.10.12/i18n/Portuguese.json";
|
16272 |
+
break;
|
16273 |
+
|
16274 |
+
case "ro":
|
16275 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Romanian.json";
|
16276 |
+
break;
|
16277 |
+
|
16278 |
+
case "ru":
|
16279 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Russian.json";
|
16280 |
+
break;
|
16281 |
+
|
16282 |
+
case "sr":
|
16283 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Serbian.json";
|
16284 |
+
break;
|
16285 |
+
|
16286 |
+
case "si":
|
16287 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Sinhala.json";
|
16288 |
+
break;
|
16289 |
+
|
16290 |
+
case "sk":
|
16291 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Slovak.json";
|
16292 |
+
break;
|
16293 |
+
|
16294 |
+
case "sl":
|
16295 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Slovenian.json";
|
16296 |
+
break;
|
16297 |
+
|
16298 |
+
case "es":
|
16299 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Spanish.json";
|
16300 |
+
break;
|
16301 |
+
|
16302 |
+
case "sw":
|
16303 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Swahili.json";
|
16304 |
+
break;
|
16305 |
+
|
16306 |
+
case "sv":
|
16307 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Swedish.json";
|
16308 |
+
break;
|
16309 |
+
|
16310 |
+
case "ta":
|
16311 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Tamil.json";
|
16312 |
+
break;
|
16313 |
+
|
16314 |
+
case "te":
|
16315 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/telugu.json";
|
16316 |
+
break;
|
16317 |
+
|
16318 |
+
case "th":
|
16319 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Thai.json";
|
16320 |
+
break;
|
16321 |
+
|
16322 |
+
case "tr":
|
16323 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Turkish.json";
|
16324 |
+
break;
|
16325 |
+
|
16326 |
+
case "uk":
|
16327 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Ukrainian.json";
|
16328 |
+
break;
|
16329 |
+
|
16330 |
+
case "ur":
|
16331 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Urdu.json";
|
16332 |
+
break;
|
16333 |
+
|
16334 |
+
case "uz":
|
16335 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Uzbek.json";
|
16336 |
+
break;
|
16337 |
+
|
16338 |
+
case "vi":
|
16339 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Vietnamese.json";
|
16340 |
+
break;
|
16341 |
+
|
16342 |
+
case "cy":
|
16343 |
+
languageURL = WPGMZA.pluginDirURL + "languages/datatables/Welsh.json";
|
16344 |
+
break;
|
16345 |
+
}
|
16346 |
+
|
16347 |
+
return languageURL;
|
16348 |
+
}
|
16349 |
+
|
16350 |
+
WPGMZA.DataTable.prototype.onAJAXResponse = function(response)
|
16351 |
+
{
|
16352 |
+
|
16353 |
+
}
|
16354 |
+
|
16355 |
+
WPGMZA.DataTable.prototype.reload = function()
|
16356 |
+
{
|
16357 |
+
this.dataTable.ajax.reload(null, false); // null callback, false for resetPaging
|
16358 |
+
}
|
16359 |
+
|
16360 |
+
});
|
16361 |
+
|
16362 |
+
// js/v8/tables/admin-feature-datatable.js
|
16363 |
+
/**
|
16364 |
+
* @namespace WPGMZA
|
16365 |
+
* @module AdminFeatureDataTable
|
16366 |
+
* @requires WPGMZA.DataTable
|
16367 |
+
*/
|
16368 |
+
jQuery(function($) {
|
16369 |
+
|
16370 |
+
WPGMZA.AdminFeatureDataTable = function(element)
|
16371 |
{
|
16372 |
var self = this;
|
16373 |
+
|
16374 |
+
this.allSelected = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16375 |
|
16376 |
+
WPGMZA.DataTable.call(this, element);
|
|
|
16377 |
|
16378 |
+
$(element).on("click", ".wpgmza.bulk_delete", function(event) {
|
16379 |
+
self.onBulkDelete(event);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16380 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16381 |
|
16382 |
+
$(element).on("click", ".wpgmza.select_all_markers", function(event) {
|
16383 |
+
self.onSelectAll(event);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16384 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16385 |
|
16386 |
+
// TODO: Move to dedicated marker class, or center feature ID instead
|
16387 |
+
$(element).on("click", "[data-center-marker-id]",
|
16388 |
+
function(event) {
|
16389 |
+
self.onCenterMarker(event);
|
16390 |
+
});
|
|
|
|
|
16391 |
}
|
16392 |
|
16393 |
+
WPGMZA.extend(WPGMZA.AdminFeatureDataTable, WPGMZA.DataTable);
|
|
|
|
|
|
|
|
|
16394 |
|
16395 |
+
Object.defineProperty(WPGMZA.AdminFeatureDataTable.prototype, "featureType", {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16396 |
|
16397 |
+
"get": function() {
|
16398 |
+
return $(this.element).attr("data-wpgmza-feature-type");
|
|
|
|
|
|
|
|
|
|
|
16399 |
}
|
16400 |
|
16401 |
+
});
|
16402 |
+
|
16403 |
+
Object.defineProperty(WPGMZA.AdminFeatureDataTable.prototype, "featurePanel", {
|
16404 |
|
16405 |
+
"get": function() {
|
16406 |
+
return WPGMZA.mapEditPage[this.featureType + "Panel"];
|
16407 |
+
}
|
16408 |
|
16409 |
+
});
|
|
|
16410 |
|
16411 |
+
WPGMZA.AdminFeatureDataTable.prototype.getDataTableSettings = function()
|
16412 |
{
|
16413 |
+
var self = this;
|
16414 |
+
var options = WPGMZA.DataTable.prototype.getDataTableSettings.call(this);
|
|
|
|
|
|
|
|
|
|
|
16415 |
|
16416 |
+
options.createdRow = function(row, data, index)
|
16417 |
+
{
|
16418 |
+
var meta = self.lastResponse.meta[index];
|
16419 |
+
row.wpgmzaFeatureData = meta;
|
16420 |
+
}
|
16421 |
+
|
16422 |
+
return options;
|
|
|
16423 |
}
|
16424 |
|
16425 |
+
WPGMZA.AdminFeatureDataTable.prototype.onBulkDelete = function(event)
|
16426 |
{
|
16427 |
+
var self = this;
|
16428 |
+
var ids = [];
|
16429 |
+
var map = WPGMZA.maps[0];
|
16430 |
+
var plural = this.featureType + "s";
|
|
|
|
|
|
|
16431 |
|
16432 |
+
$(this.element).find("input[name='mark']:checked").each(function(index, el) {
|
16433 |
+
var row = $(el).closest("tr")[0];
|
16434 |
+
ids.push(row.wpgmzaFeatureData.id);
|
16435 |
+
});
|
16436 |
+
|
16437 |
+
ids.forEach(function(marker_id) {
|
16438 |
+
var marker = map.getMarkerByID(marker_id);
|
16439 |
|
16440 |
+
if(marker)
|
16441 |
+
map.removeMarker(marker);
|
16442 |
+
});
|
16443 |
+
|
16444 |
+
WPGMZA.restAPI.call("/" + plural + "/", {
|
16445 |
+
method: "DELETE",
|
16446 |
+
data: {
|
16447 |
+
ids: ids
|
16448 |
+
},
|
16449 |
+
complete: function() {
|
16450 |
+
self.reload();
|
16451 |
+
}
|
16452 |
+
});
|
16453 |
+
}
|
16454 |
+
|
16455 |
+
WPGMZA.AdminFeatureDataTable.prototype.onSelectAll = function(event){
|
16456 |
+
this.allSelected = !this.allSelected;
|
16457 |
+
|
16458 |
+
var self = this;
|
16459 |
+
|
16460 |
+
$(this.element).find("input[name='mark']").each(function(){
|
16461 |
+
if(self.allSelected){
|
16462 |
+
$(this).prop("checked", true);
|
16463 |
+
} else {
|
16464 |
+
$(this).prop("checked", false);
|
16465 |
+
}
|
16466 |
});
|
16467 |
}
|
16468 |
|
16469 |
+
// TODO: Move to dedicated marker class, or center feature ID instead
|
16470 |
+
WPGMZA.AdminFeatureDataTable.prototype.onCenterMarker = function(event)
|
16471 |
{
|
16472 |
+
var id;
|
16473 |
+
|
16474 |
+
//Check if we have selected the center on marker button or called this function elsewhere
|
16475 |
+
if(event.currentTarget == undefined)
|
16476 |
+
{
|
16477 |
+
id = event;
|
16478 |
+
}
|
16479 |
+
else{
|
16480 |
+
id = $(event.currentTarget).attr("data-center-marker-id");
|
16481 |
+
}
|
16482 |
+
|
16483 |
+
var marker = WPGMZA.mapEditPage.map.getMarkerByID(id);
|
16484 |
|
16485 |
+
if(marker){
|
16486 |
+
var latLng = new WPGMZA.LatLng({
|
16487 |
+
lat: marker.lat,
|
16488 |
+
lng: marker.lng
|
16489 |
+
});
|
16490 |
|
16491 |
+
//Set a static zoom level
|
16492 |
+
var zoom_value = 6;
|
16493 |
+
WPGMZA.mapEditPage.map.setCenter(latLng);
|
16494 |
+
//WPGMZA.mapEditPage.map.setZoom(zoom_value);
|
16495 |
+
WPGMZA.animateScroll("#wpgmaps_tabs_markers");
|
16496 |
+
}
|
16497 |
+
|
16498 |
+
|
16499 |
}
|
16500 |
|
16501 |
+
});
|
16502 |
+
|
16503 |
+
// js/v8/tables/admin-map-datatable.js
|
16504 |
+
/**
|
16505 |
+
* @namespace WPGMZA
|
16506 |
+
* @module AdminDataTable
|
16507 |
+
* @requires WPGMZA.DataTable
|
16508 |
+
*/
|
16509 |
+
jQuery(function($) {
|
16510 |
+
|
16511 |
+
WPGMZA.AdminMapDataTable = function(element)
|
16512 |
+
{
|
16513 |
+
var self = this;
|
16514 |
+
|
16515 |
+
WPGMZA.DataTable.call(this, element);
|
16516 |
+
|
16517 |
+
$(element).on("mousedown", "button[data-action='edit']", function(event){
|
16518 |
+
switch (event.which) {
|
16519 |
+
case 1:
|
16520 |
+
var map_id = $(event.target).attr("data-map-id");
|
16521 |
+
window.location.href = window.location.href + "&action=edit&map_id=" + map_id;
|
16522 |
+
break;
|
16523 |
+
case 2:
|
16524 |
+
var map_id = $(event.target).attr("data-map-id");
|
16525 |
+
window.open(window.location.href + "&action=edit&map_id=" + map_id);
|
16526 |
+
break;
|
16527 |
+
}
|
16528 |
+
});
|
16529 |
+
|
16530 |
+
$(element).find(".wpgmza.select_all_maps").on("click", function(event) {
|
16531 |
+
self.onSelectAll(event);
|
16532 |
+
});
|
16533 |
|
16534 |
+
$(element).find(".wpgmza.bulk_delete_maps").on("click", function(event) {
|
16535 |
+
self.onBulkDelete(event);
|
16536 |
+
});
|
|
|
|
|
16537 |
|
16538 |
+
$(element).on("click", "button[data-action='duplicate']", function(event) {
|
16539 |
+
|
16540 |
+
var map_id = $(event.target).attr('data-map-id');
|
|
|
16541 |
|
16542 |
+
WPGMZA.restAPI.call("/maps/", {
|
16543 |
+
method: "POST",
|
16544 |
+
data: {
|
16545 |
+
id: map_id,
|
16546 |
+
action: "duplicate"
|
16547 |
+
},
|
16548 |
+
success: function(response, status, xhr) {
|
16549 |
+
self.reload();
|
16550 |
+
}
|
16551 |
});
|
16552 |
|
16553 |
+
});
|
16554 |
+
|
16555 |
+
$(element).on("click", "button[data-action='trash']", function(event) {
|
16556 |
+
|
16557 |
+
var result = confirm(WPGMZA.localized_strings.map_delete_prompt_text);
|
16558 |
+
|
16559 |
+
if (result) {
|
16560 |
+
|
16561 |
+
var map_id = $(event.target).attr('data-map-id');
|
16562 |
+
|
16563 |
+
WPGMZA.restAPI.call("/maps/", {
|
16564 |
+
method: "DELETE",
|
16565 |
+
data: {
|
16566 |
+
id: map_id
|
16567 |
+
},
|
16568 |
+
success: function(response, status, xhr) {
|
16569 |
+
self.reload();
|
16570 |
+
}
|
16571 |
+
})
|
16572 |
+
}
|
16573 |
+
|
16574 |
+
});
|
16575 |
+
}
|
16576 |
+
|
16577 |
+
WPGMZA.extend(WPGMZA.AdminMapDataTable, WPGMZA.DataTable);
|
16578 |
+
|
16579 |
+
WPGMZA.AdminMapDataTable.prototype.getDataTableSettings = function()
|
16580 |
{
|
16581 |
+
var self = this;
|
16582 |
+
var options = WPGMZA.DataTable.prototype.getDataTableSettings.call(this);
|
16583 |
|
16584 |
+
options.createdRow = function(row, data, index)
|
16585 |
+
{
|
16586 |
+
var meta = self.lastResponse.meta[index];
|
16587 |
+
row.wpgmzaMapData = meta;
|
16588 |
+
}
|
16589 |
+
|
16590 |
+
return options;
|
16591 |
+
}
|
16592 |
+
|
16593 |
+
WPGMZA.AdminMapDataTable.prototype.onSelectAll = function(event)
|
16594 |
+
{
|
16595 |
+
$(this.element).find("input[name='mark']").prop("checked", true);
|
16596 |
+
}
|
16597 |
+
|
16598 |
+
WPGMZA.AdminMapDataTable.prototype.onBulkDelete = function(event)
|
16599 |
+
{
|
16600 |
+
var self = this;
|
16601 |
+
var ids = [];
|
16602 |
|
16603 |
+
$(this.element).find("input[name='mark']:checked").each(function(index, el) {
|
16604 |
+
var row = $(el).closest("tr")[0];
|
16605 |
+
ids.push(row.wpgmzaMapData.id);
|
16606 |
+
});
|
16607 |
+
|
16608 |
+
var result = confirm(WPGMZA.localized_strings.map_bulk_delete_prompt_text);
|
16609 |
|
16610 |
+
if (result) {
|
16611 |
+
WPGMZA.restAPI.call("/maps/", {
|
16612 |
+
method: "DELETE",
|
16613 |
+
data: {
|
16614 |
+
ids: ids
|
16615 |
+
},
|
16616 |
+
complete: function() {
|
16617 |
+
self.reload();
|
16618 |
}
|
16619 |
+
});
|
16620 |
+
}
|
16621 |
+
}
|
16622 |
|
16623 |
+
$(document).ready(function(event){
|
16624 |
|
16625 |
+
$("[data-wpgmza-admin-map-datatable]").each(function(index, el) {
|
16626 |
+
WPGMZA.AdminMapDataTable = new WPGMZA.AdminMapDataTable(el);
|
16627 |
+
});
|
16628 |
+
|
16629 |
+
});
|
16630 |
+
|
16631 |
+
});
|
|
|
|
|
|
|
16632 |
|
16633 |
+
|
16634 |
+
// js/v8/tables/admin-marker-datatable.js
|
16635 |
/**
|
16636 |
* @namespace WPGMZA
|
16637 |
+
* @module AdminMarkerDataTable
|
16638 |
+
* @requires WPGMZA.DataTable
|
16639 |
*/
|
16640 |
jQuery(function($) {
|
16641 |
|
16642 |
+
WPGMZA.AdminMarkerDataTable = function(element)
|
16643 |
{
|
16644 |
+
var self = this;
|
16645 |
+
|
16646 |
+
this.preventCaching = true;
|
16647 |
+
|
16648 |
+
WPGMZA.DataTable.call(this, element);
|
16649 |
+
|
16650 |
+
// NB: Pro marker panel currently manages edit marker buttons
|
16651 |
+
|
16652 |
+
$(element).on("click", "[data-delete-marker-id]", function(event) {
|
16653 |
+
self.onDeleteMarker(event);
|
16654 |
+
});
|
16655 |
+
|
16656 |
+
$(element).find(".wpgmza.select_all_markers").on("click", function(event) {
|
16657 |
+
self.onSelectAll(event);
|
16658 |
+
});
|
16659 |
+
|
16660 |
+
$(element).find(".wpgmza.bulk_delete").on("click", function(event) {
|
16661 |
+
self.onBulkDelete(event);
|
16662 |
+
});
|
16663 |
+
|
16664 |
+
$(element).on("click", "[data-center-marker-id]", function(event) {
|
16665 |
+
self.onCenterMarker(event);
|
16666 |
+
});
|
16667 |
}
|
16668 |
|
16669 |
+
WPGMZA.AdminMarkerDataTable.prototype = Object.create(WPGMZA.DataTable.prototype);
|
16670 |
+
WPGMZA.AdminMarkerDataTable.prototype.constructor = WPGMZA.AdminMarkerDataTable;
|
16671 |
|
16672 |
+
WPGMZA.AdminMarkerDataTable.createInstance = function(element)
|
16673 |
{
|
16674 |
+
return new WPGMZA.AdminMarkerDataTable(element);
|
|
|
|
|
|
|
16675 |
}
|
16676 |
|
16677 |
+
WPGMZA.AdminMarkerDataTable.prototype.getDataTableSettings = function()
|
16678 |
+
{
|
16679 |
+
var self = this;
|
16680 |
+
var options = WPGMZA.DataTable.prototype.getDataTableSettings.call(this);
|
16681 |
|
16682 |
+
options.createdRow = function(row, data, index)
|
16683 |
+
{
|
16684 |
+
var meta = self.lastResponse.meta[index];
|
16685 |
+
row.wpgmzaMarkerData = meta;
|
16686 |
}
|
16687 |
|
16688 |
+
return options;
|
16689 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16690 |
|
16691 |
+
WPGMZA.AdminMarkerDataTable.prototype.onEditMarker = function(event)
|
16692 |
{
|
16693 |
+
WPGMZA.animatedScroll("#wpgmaps_tabs_markers");
|
16694 |
}
|
16695 |
|
16696 |
+
WPGMZA.AdminMarkerDataTable.prototype.onDeleteMarker = function(event)
|
|
|
|
|
16697 |
{
|
16698 |
+
var self = this;
|
16699 |
+
var id = $(event.currentTarget).attr("data-delete-marker-id");
|
16700 |
|
16701 |
+
var data = {
|
16702 |
+
action: 'delete_marker',
|
16703 |
+
security: WPGMZA.legacyajaxnonce,
|
16704 |
+
map_id: WPGMZA.mapEditPage.map.id,
|
16705 |
+
marker_id: id
|
16706 |
+
};
|
16707 |
+
|
16708 |
+
$.post(ajaxurl, data, function(response) {
|
16709 |
+
|
16710 |
+
WPGMZA.mapEditPage.map.removeMarkerByID(id);
|
16711 |
+
self.reload();
|
16712 |
+
|
16713 |
+
});
|
16714 |
}
|
16715 |
|
16716 |
+
// NB: Move this to UGM
|
16717 |
+
WPGMZA.AdminMarkerDataTable.prototype.onApproveMarker = function(event)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16718 |
{
|
16719 |
+
var self = this;
|
16720 |
+
var cur_id = $(this).attr("id");
|
16721 |
+
|
16722 |
+
var data = {
|
16723 |
+
action: 'approve_marker',
|
16724 |
+
security: WPGMZA.legacyajaxnonce,
|
16725 |
+
map_id: WPGMZA.mapEditPage.map.id,
|
16726 |
+
marker_id: cur_id
|
16727 |
+
};
|
16728 |
+
$.post(ajaxurl, data, function (response) {
|
16729 |
+
|
16730 |
+
|
16731 |
+
wpgmza_InitMap();
|
16732 |
+
wpgmza_reinitialisetbl();
|
16733 |
+
|
16734 |
+
});
|
16735 |
}
|
16736 |
|
16737 |
+
WPGMZA.AdminMarkerDataTable.prototype.onSelectAll = function(event)
|
|
|
|
|
16738 |
{
|
16739 |
+
$(this.element).find("input[name='mark']").prop("checked", true);
|
|
|
|
|
|
|
16740 |
}
|
16741 |
|
16742 |
+
WPGMZA.AdminMarkerDataTable.prototype.onBulkDelete = function(event)
|
16743 |
{
|
16744 |
+
var self = this;
|
16745 |
+
var ids = [];
|
16746 |
+
var map = WPGMZA.maps[0];
|
16747 |
+
|
16748 |
+
$(this.element).find("input[name='mark']:checked").each(function(index, el) {
|
16749 |
+
var row = $(el).closest("tr")[0];
|
16750 |
+
ids.push(row.wpgmzaMarkerData.id);
|
16751 |
+
});
|
16752 |
+
|
16753 |
+
ids.forEach(function(marker_id) {
|
16754 |
+
var marker = map.getMarkerByID(marker_id);
|
16755 |
+
|
16756 |
+
if(marker)
|
16757 |
+
map.removeMarker(marker);
|
16758 |
+
});
|
16759 |
+
|
16760 |
+
WPGMZA.restAPI.call("/markers/", {
|
16761 |
+
method: "DELETE",
|
16762 |
+
data: {
|
16763 |
+
ids: ids
|
16764 |
+
},
|
16765 |
+
complete: function() {
|
16766 |
+
self.reload();
|
16767 |
+
}
|
16768 |
+
});
|
16769 |
}
|
16770 |
|
16771 |
+
WPGMZA.AdminMarkerDataTable.prototype.onCenterMarker = function(event)
|
16772 |
+
{
|
16773 |
+
var id;
|
16774 |
|
16775 |
+
//Check if we have selected the center on marker button or called this function elsewhere
|
16776 |
+
if(event.currentTarget == undefined)
|
16777 |
+
{
|
16778 |
+
id = event;
|
16779 |
}
|
16780 |
+
else{
|
16781 |
+
id = $(event.currentTarget).attr("data-center-marker-id");
|
16782 |
+
}
|
16783 |
+
|
16784 |
+
var marker = WPGMZA.mapEditPage.map.getMarkerByID(id);
|
16785 |
|
16786 |
+
if(marker){
|
16787 |
+
var latLng = new WPGMZA.LatLng({
|
16788 |
+
lat: marker.lat,
|
16789 |
+
lng: marker.lng
|
16790 |
+
});
|
16791 |
+
|
16792 |
+
//Set a static zoom level
|
16793 |
+
var zoom_value = 6;
|
16794 |
+
WPGMZA.mapEditPage.map.setCenter(latLng);
|
16795 |
+
WPGMZA.mapEditPage.map.setZoom(zoom_value);
|
16796 |
+
WPGMZA.animateScroll("#wpgmaps_tabs_markers");
|
16797 |
+
}
|
16798 |
+
|
16799 |
+
|
16800 |
}
|
16801 |
|
16802 |
+
/*$(document).ready(function(event) {
|
16803 |
+
|
16804 |
+
$("[data-wpgmza-admin-marker-datatable]").each(function(index, el) {
|
16805 |
+
WPGMZA.adminMarkerDataTable = WPGMZA.AdminMarkerDataTable.createInstance(el);
|
16806 |
+
});
|
16807 |
+
|
16808 |
+
});*/
|
16809 |
|
16810 |
});
|
js/v8/wp-google-maps.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function($){var core={MARKER_PULL_DATABASE:"0",MARKER_PULL_XML:"1",PAGE_MAP_LIST:"map-list",PAGE_MAP_EDIT:"map-edit",PAGE_SETTINGS:"map-settings",PAGE_SUPPORT:"map-support",PAGE_CATEGORIES:"categories",PAGE_ADVANCED:"advanced",PAGE_CUSTOM_FIELDS:"custom-fields",maps:[],events:null,settings:null,restAPI:null,localized_strings:null,loadingHTML:'<div class="wpgmza-preloader"><div class="wpgmza-loader">...</div></div>',preloaderHTML:"<div class='wpgmza-preloader'><div></div><div></div><div></div><div></div></div>",getCurrentPage:function(){switch(WPGMZA.getQueryParamValue("page")){case"wp-google-maps-menu":return window.location.href.match(/action=edit/)&&window.location.href.match(/map_id=\d+/)?WPGMZA.PAGE_MAP_EDIT:WPGMZA.PAGE_MAP_LIST;case"wp-google-maps-menu-settings":return WPGMZA.PAGE_SETTINGS;case"wp-google-maps-menu-support":return WPGMZA.PAGE_SUPPORT;case"wp-google-maps-menu-categories":return WPGMZA.PAGE_CATEGORIES;case"wp-google-maps-menu-advanced":return WPGMZA.PAGE_ADVANCED;case"wp-google-maps-menu-custom-fields":return WPGMZA.PAGE_CUSTOM_FIELDS;default:return null}},getScrollAnimationOffset:function(){return(WPGMZA.settings.scroll_animation_offset||0)+$("#wpadminbar").height()},getScrollAnimationDuration:function(){return WPGMZA.settings.scroll_animation_milliseconds?WPGMZA.settings.scroll_animation_milliseconds:500},animateScroll:function(element,milliseconds){var offset=WPGMZA.getScrollAnimationOffset();milliseconds=milliseconds||WPGMZA.getScrollAnimationDuration(),$("html, body").animate({scrollTop:$(element).offset().top-offset},milliseconds)},extend:function(child,parent){var constructor=child;child.prototype=Object.create(parent.prototype),child.prototype.constructor=constructor},guid:function(){var d=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(d+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=(d+16*Math.random())%16|0;return d=Math.floor(d/16),("x"===c?r:3&r|8).toString(16)})},hexOpacityToRGBA:function(colour,opacity){var hex=parseInt(colour.replace(/^#/,""),16);return[(16711680&hex)>>16,(65280&hex)>>8,255&hex,parseFloat(opacity)]},hexOpacityToString:function(colour,opacity){var arr=WPGMZA.hexOpacityToRGBA(colour,opacity);return"rgba("+arr[0]+", "+arr[1]+", "+arr[2]+", "+arr[3]+")"},hexToRgba:function(hex){var c;return/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)?(3==(c=hex.substring(1).split("")).length&&(c=[c[0],c[0],c[1],c[1],c[2],c[2]]),{r:(c="0x"+c.join(""))>>16&255,g:c>>8&255,b:255&c,a:1}):0},rgbaToString:function(rgba){return"rgba("+rgba.r+", "+rgba.g+", "+rgba.b+", "+rgba.a+")"},latLngRegexp:/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/,isLatLngString:function(str){if("string"!=typeof str)return null;str.match(/^\(.+\)$/)&&(str=str.replace(/^\(|\)$/,""));var m=str.match(WPGMZA.latLngRegexp);return m?new WPGMZA.LatLng({lat:parseFloat(m[1]),lng:parseFloat(m[3])}):null},stringToLatLng:function(str){var result=WPGMZA.isLatLngString(str);if(!result)throw new Error("Not a valid latLng");return result},isHexColorString:function(str){return"string"==typeof str&&!!str.match(/#[0-9A-F]{6}/i)},imageDimensionsCache:{},getImageDimensions:function(src,callback){if(WPGMZA.imageDimensionsCache[src])callback(WPGMZA.imageDimensionsCache[src]);else{var img=document.createElement("img");img.onload=function(event){var result={width:img.width,height:img.height};WPGMZA.imageDimensionsCache[src]=result,callback(result)},img.src=src}},decodeEntities:function(input){return input.replace(/&(nbsp|amp|quot|lt|gt);/g,function(m,e){return m[e]}).replace(/&#(\d+);/gi,function(m,e){return String.fromCharCode(parseInt(e,10))})},isDeveloperMode:function(){return this.settings.developer_mode||window.Cookies&&window.Cookies.get("wpgmza-developer-mode")},isProVersion:function(){return"1"==this._isProVersion},openMediaDialog:function(callback){var file_frame;if(file_frame)return file_frame.uploader.uploader.param("post_id",set_to_post_id),void file_frame.open();(file_frame=wp.media.frames.file_frame=wp.media({title:"Select a image to upload",button:{text:"Use this image"},multiple:!1})).on("select",function(){attachment=file_frame.state().get("selection").first().toJSON(),callback(attachment.id,attachment.url)}),file_frame.open()},getCurrentPosition:function(callback,error,watch){var nativeFunction="getCurrentPosition";if(WPGMZA.userLocationDenied)error&&error({code:1,message:"Location unavailable"});else if(watch&&(nativeFunction="watchPosition"),navigator.geolocation){var options={enableHighAccuracy:!0};navigator.geolocation[nativeFunction]?navigator.geolocation[nativeFunction](function(position){callback&&callback(position),WPGMZA.events.trigger("userlocationfound")},function(err){options.enableHighAccuracy=!1,navigator.geolocation[nativeFunction](function(position){callback&&callback(position),WPGMZA.events.trigger("userlocationfound")},function(err){console.warn(err.code,err.message),1==err.code&&(WPGMZA.userLocationDenied=!0),error&&error(err)},options)},options):console.warn(nativeFunction+" is not available")}else console.warn("No geolocation available on this device")},watchPosition:function(callback,error){return WPGMZA.getCurrentPosition(callback,error,!0)},runCatchableTask:function(callback,friendlyErrorContainer){if(WPGMZA.isDeveloperMode())callback();else try{callback()}catch(e){var friendlyError=new WPGMZA.FriendlyError(e);$(friendlyErrorContainer).html(""),$(friendlyErrorContainer).append(friendlyError.element),$(friendlyErrorContainer).show()}},capitalizeWords:function(string){return(string+"").replace(/^(.)|\s+(.)/g,function(m){return m.toUpperCase()})},pluralize:function(string){return WPGMZA.singularize(string)+"s"},singularize:function(string){return string.replace(/s$/,"")},assertInstanceOf:function(instance,instanceName){var engine,fullInstanceName,pro=WPGMZA.isProVersion()?"Pro":"";switch(WPGMZA.settings.engine){case"open-layers":engine="OL";break;default:engine="Google"}if("OLFeature"!=(fullInstanceName=WPGMZA[engine+pro+instanceName]&&engine+instanceName!="OLFeature"?engine+pro+instanceName:WPGMZA[pro+instanceName]?pro+instanceName:WPGMZA[engine+instanceName]&&WPGMZA[engine+instanceName].prototype?engine+instanceName:instanceName)&&!(instance instanceof WPGMZA[fullInstanceName]))throw new Error("Object must be an instance of "+fullInstanceName+" (did you call a constructor directly, rather than createInstance?)")},getMapByID:function(id){for(var i=0;i<WPGMZA.maps.length;i++)if(WPGMZA.maps[i].id==id)return WPGMZA.maps[i];return null},isGoogleAutocompleteSupported:function(){return!!window.google&&(!!google.maps&&(!!google.maps.places&&(!!google.maps.places.Autocomplete&&(!WPGMZA.CloudAPI||!WPGMZA.CloudAPI.isBeingUsed))))},googleAPIStatus:window.wpgmza_google_api_status,isSafari:function(){var ua=navigator.userAgent.toLowerCase();return ua.match(/safari/i)&&!ua.match(/chrome/i)},isTouchDevice:function(){return"ontouchstart"in window},isDeviceiOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},isModernComponentStyleAllowed:function(){return!WPGMZA.settings.user_interface_style||"legacy"==WPGMZA.settings.user_interface_style||"modern"==WPGMZA.settings.user_interface_style},isElementInView:function(element){var pageTop=$(window).scrollTop(),pageBottom=pageTop+$(window).height(),elementTop=$(element).offset().top,elementBottom=elementTop+$(element).height();return elementTop<pageTop&&pageBottom<elementBottom||(pageTop<=elementTop&&elementTop<=pageBottom||pageTop<=elementBottom&&elementBottom<=pageBottom)},isFullScreen:function(){return wpgmzaisFullScreen},getQueryParamValue:function(name){var m,regex=new RegExp(name+"=([^&#]*)");return(m=window.location.href.match(regex))?decodeURIComponent(m[1]):null},notification:function(text,time){switch(arguments.length){case 0:text="",time=4e3;break;case 1:time=4e3}var html='<div class="wpgmza-popup-notification">'+text+"</div>";jQuery("body").append(html),setTimeout(function(){jQuery("body").find(".wpgmza-popup-notification").remove()},time)}},wpgmzaisFullScreen=!1;for(var key in[]){console.warn("It appears that the built in JavaScript Array has been extended, this can create issues with for ... in loops, which may cause failure.");break}for(var key in window.WPGMZA?window.WPGMZA=$.extend(window.WPGMZA,core):window.WPGMZA=core,window.uc&&window.uc.reloadOnOptIn&&(window.uc.reloadOnOptIn("S1pcEj_jZX"),window.uc.reloadOnOptOut("S1pcEj_jZX")),WPGMZA_localized_data){var value=WPGMZA_localized_data[key];WPGMZA[key]=value}function onScroll(event){$(".wpgmza_map").each(function(index,el){var isInView=WPGMZA.isElementInView(el);el.wpgmzaScrollIntoViewTriggerFlag?isInView||(el.wpgmzaScrollIntoViewTriggerFlag=!1):isInView&&($(el).trigger("mapscrolledintoview.wpgmza"),el.wpgmzaScrollIntoViewTriggerFlag=!0)})}WPGMZA.settings.useLegacyGlobals=!0,jQuery(function($){$(window).trigger("ready.wpgmza"),$("script[src*='wp-google-maps.combined.js'], script[src*='wp-google-maps-pro.combined.js']").length&&console.warn("Minified script is out of date, using combined script instead.");var elements=$("script[src]").filter(function(){return this.src.match(/(^|\/)jquery\.(min\.)?js(\?|$)/i)});1<elements.length&&console.warn("Multiple jQuery versions detected: ",elements),WPGMZA.restAPI=WPGMZA.RestAPI.createInstance(),WPGMZA.CloudAPI&&(WPGMZA.cloudAPI=WPGMZA.CloudAPI.createInstance()),$(document).on("fullscreenchange",function(){wpgmzaisFullScreen=!!document.fullscreenElement}),$("body").on("click","#wpgmzaCloseChat",function(e){e.preventDefault(),$.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_hide_chat",nonce:WPGMZA_localized_data.ajaxnonce}}),$(".wpgmza-chat-help").remove()})}),$(document).ready(function(event){for(var key in[]){console.warn("The Array object has been extended incorrectly by your theme or another plugin. This can cause issues with functionality.");break}if("https:"!=window.location.protocol){var warning='<div class="notice notice-warning"><p>'+WPGMZA.localized_strings.unsecure_geolocation+"</p></div>";$(".wpgmza-geolocation-setting").first().after($(warning))}}),$(window).on("scroll",onScroll),$(document).ready(onScroll),$(function(){WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code?jQuery(".wpgmza-gdpr-compliance").length<=0&&($("#wpgmza_map, .wpgmza_map").each(function(index,el){$(el).append($(WPGMZA.api_consent_html)),$(el).css({height:"auto"})}),$("button.wpgmza-api-consent").on("click",function(event){Cookies.set("wpgmza-api-consent-given",!0),window.location.reload()})):function initMaps(){$(document.body).find(".wpgmza_map:not(.wpgmza-initialized)").each(function(index,el){el.wpgmzaMap?console.warn("Element missing class wpgmza-initialized but does have wpgmzaMap property. No new instance will be created"):el.wpgmzaMap=WPGMZA.Map.createInstance(el)}),WPGMZA.Map.nextInitTimeoutID=setTimeout(initMaps,3e3)}()}),$(document.body).on("click","button.wpgmza-api-consent",function(event){Cookies.set("wpgmza-api-consent-given",!0),window.location.reload()}),$(document.body).on("keydown",function(event){event.altKey&&(WPGMZA.altKeyDown=!0)}),$(document.body).on("keyup",function(event){event.altKey||(WPGMZA.altKeyDown=!1)})}),jQuery(function($){WPGMZA.Compatibility=function(){this.preventDocumentWriteGoogleMapsAPI()},WPGMZA.Compatibility.prototype.preventDocumentWriteGoogleMapsAPI=function(){var old=document.write;document.write=function(content){content.match&&content.match(/maps\.google/)||old.call(document,content)}},WPGMZA.compatiblityModule=new WPGMZA.Compatibility}),function(root,factory){"object"==typeof exports?module.exports=factory(root):"function"==typeof define&&define.amd?define([],factory.bind(root,root)):factory(root)}("undefined"!=typeof global?global:this,function(root){if(root.CSS&&root.CSS.escape)return root.CSS.escape;function cssEscape(value){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var codeUnit,string=String(value),length=string.length,index=-1,result="",firstCodeUnit=string.charCodeAt(0);++index<length;)0!=(codeUnit=string.charCodeAt(index))?result+=1<=codeUnit&&codeUnit<=31||127==codeUnit||0==index&&48<=codeUnit&&codeUnit<=57||1==index&&48<=codeUnit&&codeUnit<=57&&45==firstCodeUnit?"\\"+codeUnit.toString(16)+" ":(0!=index||1!=length||45!=codeUnit)&&(128<=codeUnit||45==codeUnit||95==codeUnit||48<=codeUnit&&codeUnit<=57||65<=codeUnit&&codeUnit<=90||97<=codeUnit&&codeUnit<=122)?string.charAt(index):"\\"+string.charAt(index):result+="�";return result}return root.CSS||(root.CSS={}),root.CSS.escape=cssEscape}),jQuery(function($){Math.PI;function deg2rad(deg){return deg*(Math.PI/180)}WPGMZA.Distance={MILES:!0,KILOMETERS:!1,MILES_PER_KILOMETER:.621371,KILOMETERS_PER_MILE:1.60934,uiToMeters:function(uiDistance){return parseFloat(uiDistance)/(WPGMZA.settings.distance_units==WPGMZA.Distance.MILES?WPGMZA.Distance.MILES_PER_KILOMETER:1)*1e3},uiToKilometers:function(uiDistance){return.001*WPGMZA.Distance.uiToMeters(uiDistance)},uiToMiles:function(uiDistance){return WPGMZA.Distance.uiToKilometers(uiDistance)*WPGMZA.Distance.MILES_PER_KILOMETER},kilometersToUI:function(km){return WPGMZA.settings.distance_units==WPGMZA.Distance.MILES?km*WPGMZA.Distance.MILES_PER_KILOMETER:km},between:function(a,b){if(!(a instanceof WPGMZA.LatLng||"lat"in a&&"lng"in a))throw new Error("First argument must be an instance of WPGMZA.LatLng or a literal");if(!(b instanceof WPGMZA.LatLng||"lat"in b&&"lng"in b))throw new Error("Second argument must be an instance of WPGMZA.LatLng or a literal");if(a===b)return 0;var lat1=a.lat,lon1=a.lng,lat2=b.lat,lon2=b.lng,dLat=deg2rad(lat2-lat1),dLon=deg2rad(lon2-lon1);a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(deg2rad(lat1))*Math.cos(deg2rad(lat2))*Math.sin(dLon/2)*Math.sin(dLon/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}}}),jQuery(function($){WPGMZA.EliasFano=function(){if(!WPGMZA.EliasFano.isSupported)throw new Error("Elias Fano encoding is not supported on browsers without Uint8Array");WPGMZA.EliasFano.decodingTablesInitialised||WPGMZA.EliasFano.createDecodingTable()},WPGMZA.EliasFano.isSupported="Uint8Array"in window,WPGMZA.EliasFano.decodingTableHighBits=[],WPGMZA.EliasFano.decodingTableDocIDNumber=null,WPGMZA.EliasFano.decodingTableHighBitsCarryover=null,WPGMZA.EliasFano.createDecodingTable=function(){WPGMZA.EliasFano.decodingTableDocIDNumber=new Uint8Array(256),WPGMZA.EliasFano.decodingTableHighBitsCarryover=new Uint8Array(256);for(var decodingTableHighBits=WPGMZA.EliasFano.decodingTableHighBits,decodingTableDocIDNumber=WPGMZA.EliasFano.decodingTableDocIDNumber,decodingTableHighBitsCarryover=WPGMZA.EliasFano.decodingTableHighBitsCarryover,i=0;i<256;i++){var zeroCount=0;decodingTableHighBits[i]=[];for(var j=7;0<=j;j--)zeroCount=0<(i&1<<j)?(decodingTableHighBits[i][decodingTableDocIDNumber[i]]=zeroCount,decodingTableDocIDNumber[i]++,0):(zeroCount+1)%255;decodingTableHighBitsCarryover[i]=zeroCount}WPGMZA.EliasFano.decodingTablesInitialised=!0},WPGMZA.EliasFano.prototype.encode=function(list){var lastDocID=0,buffer1=0,bufferLength1=0,buffer2=0,bufferLength2=0;if(0==list.length)return result;function toByte(n){return 255&n}var compressedBufferPointer1=0,compressedBufferPointer2=0,averageDelta=list[list.length-1]/list.length,averageDeltaLog=Math.log2(averageDelta),lowBitsLength=Math.floor(averageDeltaLog),lowBitsMask=(1<<lowBitsLength)-1,prev=null,maxCompressedSize=Math.floor((2+Math.ceil(Math.log2(averageDelta)))*list.length/8)+6,compressedBuffer=new Uint8Array(maxCompressedSize);lowBitsLength<0&&(lowBitsLength=0),compressedBufferPointer2=Math.floor(lowBitsLength*list.length/8+6),compressedBuffer[compressedBufferPointer1++]=toByte(list.length),compressedBuffer[compressedBufferPointer1++]=toByte(list.length>>8),compressedBuffer[compressedBufferPointer1++]=toByte(list.length>>16),compressedBuffer[compressedBufferPointer1++]=toByte(list.length>>24),compressedBuffer[compressedBufferPointer1++]=toByte(lowBitsLength),list.forEach(function(docID){var docIDDelta=docID-lastDocID-1;if(!$.isNumeric(docID))throw new Error("Value is not numeric");if(docID=parseInt(docID),null!==prev&&docID<=prev)throw new Error("Elias Fano encoding can only be used on a sorted, ascending list of unique integers.");for(prev=docID,buffer1<<=lowBitsLength,buffer1|=docIDDelta&lowBitsMask,bufferLength1+=lowBitsLength;7<bufferLength1;)bufferLength1-=8,compressedBuffer[compressedBufferPointer1++]=toByte(buffer1>>bufferLength1);var unaryCodeLength=1+(docIDDelta>>lowBitsLength);for(buffer2<<=unaryCodeLength,buffer2|=1,bufferLength2+=unaryCodeLength;7<bufferLength2;)bufferLength2-=8,compressedBuffer[compressedBufferPointer2++]=toByte(buffer2>>bufferLength2);lastDocID=docID}),0<bufferLength1&&(compressedBuffer[compressedBufferPointer1++]=toByte(buffer1<<8-bufferLength1)),0<bufferLength2&&(compressedBuffer[compressedBufferPointer2++]=toByte(buffer2<<8-bufferLength2));var result=new Uint8Array(compressedBuffer);return result.pointer=compressedBufferPointer2,result},WPGMZA.EliasFano.prototype.decode=function(compressedBuffer){var resultPointer=0,list=[],decodingTableHighBits=WPGMZA.EliasFano.decodingTableHighBits,decodingTableDocIDNumber=WPGMZA.EliasFano.decodingTableDocIDNumber,decodingTableHighBitsCarryover=WPGMZA.EliasFano.decodingTableHighBitsCarryover,lowBitsPointer=0,lastDocID=0,docID=0,docIDNumber=0,listCount=compressedBuffer[lowBitsPointer++];listCount|=compressedBuffer[lowBitsPointer++]<<8,listCount|=compressedBuffer[lowBitsPointer++]<<16,listCount|=compressedBuffer[lowBitsPointer++]<<24;var highBitsPointer,lowBitsLength=compressedBuffer[lowBitsPointer++],lowBitsCount=0,lowBits=0,cb=1;for(highBitsPointer=Math.floor(lowBitsLength*listCount/8+6);highBitsPointer<compressedBuffer.pointer;highBitsPointer++){docID+=decodingTableHighBitsCarryover[cb],docIDNumber=decodingTableDocIDNumber[cb=compressedBuffer[highBitsPointer]];for(var i=0;i<docIDNumber;i++){for(docID<<=lowBitsCount,docID|=lowBits&(1<<lowBitsCount)-1;lowBitsCount<lowBitsLength;)docID<<=8,docID|=lowBits=compressedBuffer[lowBitsPointer++],lowBitsCount+=8;docID>>=lowBitsCount-=lowBitsLength,docID+=(decodingTableHighBits[cb][i]<<lowBitsLength)+lastDocID+1,lastDocID=list[resultPointer++]=docID,docID=0}}return list}}),jQuery(function($){WPGMZA.EventDispatcher=function(){WPGMZA.assertInstanceOf(this,"EventDispatcher"),this._listenersByType={}},WPGMZA.EventDispatcher.prototype.addEventListener=function(type,listener,thisObject,useCapture){var types=type.split(/\s+/);if(1<types.length)for(var i=0;i<types.length;i++)this.addEventListener(types[i],listener,thisObject,useCapture);else{if(!(listener instanceof Function))throw new Error("Listener must be a function");var target;target=this._listenersByType.hasOwnProperty(type)?this._listenersByType[type]:this._listenersByType[type]=[];var obj={listener:listener,thisObject:thisObject||this,useCapture:!!useCapture};target.push(obj)}},WPGMZA.EventDispatcher.prototype.on=WPGMZA.EventDispatcher.prototype.addEventListener,WPGMZA.EventDispatcher.prototype.removeEventListener=function(type,listener,thisObject,useCapture){var arr,obj;if(arr=this._listenersByType[type]){thisObject=thisObject||this,useCapture=!!useCapture;for(var i=0;i<arr.length;i++)if(obj=arr[i],(1==arguments.length||obj.listener==listener)&&obj.thisObject==thisObject&&obj.useCapture==useCapture)return void arr.splice(i,1)}},WPGMZA.EventDispatcher.prototype.off=WPGMZA.EventDispatcher.prototype.removeEventListener,WPGMZA.EventDispatcher.prototype.hasEventListener=function(type){return!!_listenersByType[type]},WPGMZA.EventDispatcher.prototype.dispatchEvent=function(event){if(!(event instanceof WPGMZA.Event))if("string"==typeof event)event=new WPGMZA.Event(event);else{var src=event;for(var name in event=new WPGMZA.Event,src)event[name]=src[name]}for(var path=[],obj=(event.target=this).parent;null!=obj;obj=obj.parent)path.unshift(obj);event.phase=WPGMZA.Event.CAPTURING_PHASE;for(var i=0;i<path.length&&!event._cancelled;i++)path[i]._triggerListeners(event);if(!event._cancelled){for(event.phase=WPGMZA.Event.AT_TARGET,this._triggerListeners(event),event.phase=WPGMZA.Event.BUBBLING_PHASE,i=path.length-1;0<=i&&!event._cancelled;i--)path[i]._triggerListeners(event);var topMostElement=this.element;for(obj=this.parent;null!=obj;obj=obj.parent)obj.element&&(topMostElement=obj.element);if(topMostElement){var customEvent={};for(var key in event){var value=event[key];"type"==key&&(value+=".wpgmza"),customEvent[key]=value}$(topMostElement).trigger(customEvent)}}},WPGMZA.EventDispatcher.prototype.trigger=WPGMZA.EventDispatcher.prototype.dispatchEvent,WPGMZA.EventDispatcher.prototype._triggerListeners=function(event){var arr,obj;if(arr=this._listenersByType[event.type])for(var i=0;i<arr.length;i++)obj=arr[i],event.phase==WPGMZA.Event.CAPTURING_PHASE&&!obj.useCapture||obj.listener.call(arr[i].thisObject,event)},WPGMZA.events=new WPGMZA.EventDispatcher}),jQuery(function($){WPGMZA.AddressInput=function(element,map){if(!(element instanceof HTMLInputElement))throw new Error("Element is not an instance of HTMLInputElement");var json;this.element=element;var options={fields:["name","formatted_address"],types:["geocode","establishment"]};(json=$(element).attr("data-autocomplete-options"))&&(options=$.extend(options,JSON.parse(json))),map&&map.settings.wpgmza_store_locator_restrict&&(options.country=map.settings.wpgmza_store_locator_restrict),WPGMZA.isGoogleAutocompleteSupported()?"wpgmza_add_address_map_editor"!=this.id&&WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey&&(element.googleAutoComplete=new google.maps.places.Autocomplete(element,options),options.country&&element.googleAutoComplete.setComponentRestrictions({country:options.country})):WPGMZA.CloudAPI&&WPGMZA.CloudAPI.isBeingUsed&&(element.cloudAutoComplete=new WPGMZA.CloudAutocomplete(element,options))},WPGMZA.extend(WPGMZA.AddressInput,WPGMZA.EventDispatcher),WPGMZA.AddressInput.createInstance=function(element,map){return new WPGMZA.AddressInput(element,map)}}),jQuery(function($){WPGMZA.DrawingManager=function(map){WPGMZA.assertInstanceOf(this,"DrawingManager"),WPGMZA.EventDispatcher.call(this),this.map=map,this.mode=WPGMZA.DrawingManager.MODE_NONE},WPGMZA.DrawingManager.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.DrawingManager.prototype.constructor=WPGMZA.DrawingManager,WPGMZA.DrawingManager.MODE_NONE=null,WPGMZA.DrawingManager.MODE_MARKER="marker",WPGMZA.DrawingManager.MODE_POLYGON="polygon",WPGMZA.DrawingManager.MODE_POLYLINE="polyline",WPGMZA.DrawingManager.MODE_CIRCLE="circle",WPGMZA.DrawingManager.MODE_RECTANGLE="rectangle",WPGMZA.DrawingManager.MODE_HEATMAP="heatmap",WPGMZA.DrawingManager.getConstructor=function(){switch(WPGMZA.settings.engine){case"google-maps":return WPGMZA.GoogleDrawingManager;default:return WPGMZA.OLDrawingManager}},WPGMZA.DrawingManager.createInstance=function(map){return new(WPGMZA.DrawingManager.getConstructor())(map)},WPGMZA.DrawingManager.prototype.setDrawingMode=function(mode){this.mode=mode,this.trigger("drawingmodechanged")}}),jQuery(function($){WPGMZA.Event=function(options){if("string"==typeof options&&(this.type=options),this.bubbles=!0,this.cancelable=!0,this.phase=WPGMZA.Event.PHASE_CAPTURE,this.target=null,this._cancelled=!1,"object"==typeof options)for(var name in options)this[name]=options[name]},WPGMZA.Event.CAPTURING_PHASE=0,WPGMZA.Event.AT_TARGET=1,WPGMZA.Event.BUBBLING_PHASE=2,WPGMZA.Event.prototype.stopPropagation=function(){this._cancelled=!0}}),jQuery(function($){WPGMZA.FancyControls={formatToggleSwitch:function(el){var div=$("<div class='switch'></div>"),input=el,container=el.parentNode,text=$(container).text().trim(),label=$("<label></label>");$(input).addClass("cmn-toggle cmn-toggle-round-flat"),$(input).attr("id",$(input).attr("name")),$(label).attr("for",$(input).attr("name")),$(div).append(input),$(div).append(label),$(container).replaceWith(div),$(div).wrap($("<div></div>")),$(div).after(text)},formatToggleButton:function(el){var div=$("<div class='switch'></div>"),input=el,container=el.parentNode,text=$(container).text().trim(),label=$("<label></label>");$(input).addClass("cmn-toggle cmn-toggle-yes-no"),$(input).attr("id",$(input).attr("name")),$(label).attr("for",$(input).attr("name")),$(label).attr("data-on",WPGMZA.localized_strings.yes),$(label).attr("data-off",WPGMZA.localized_strings.no),$(div).append(input),$(div).append(label),$(container).replaceWith(div),$(div).wrap($("<div></div>")),$(div).after(text)}},$(".wpgmza-fancy-toggle-switch").each(function(index,el){WPGMZA.FancyControls.formatToggleSwitch(el)}),$(".wpgmza-fancy-toggle-button").each(function(index,el){WPGMZA.FancyControls.formatToggleButton(el)})}),jQuery(function($){WPGMZA.Feature=function(options){for(var key in WPGMZA.assertInstanceOf(this,"Feature"),WPGMZA.EventDispatcher.call(this),this.id=-1,options)this[key]=options[key]},WPGMZA.extend(WPGMZA.Feature,WPGMZA.EventDispatcher),WPGMZA.MapObject=WPGMZA.Feature,WPGMZA.Feature.prototype.parseGeometry=function(subject){if("string"==typeof subject&&subject.match(/^\[/))try{subject=JSON.parse(subject)}catch(e){}if("object"==typeof subject){for(var arr=subject,i=0;i<arr.length;i++)arr[i].lat=parseFloat(arr[i].lat),arr[i].lng=parseFloat(arr[i].lng);return arr}if("string"!=typeof subject)throw new Error("Invalid geometry");var pairs,coords,results=[];pairs=subject.replace(/[^ ,\d\.\-+e]/g,"").split(",");for(i=0;i<pairs.length;i++)coords=pairs[i].split(" "),results.push({lat:parseFloat(coords[1]),lng:parseFloat(coords[0])});return results},WPGMZA.Feature.prototype.setOptions=function(options){for(var key in options)this[key]=options[key];this.updateNativeFeature()},WPGMZA.Feature.prototype.setEditable=function(editable){this.setOptions({editable:editable})},WPGMZA.Feature.prototype.setDraggable=function(draggable){this.setOptions({draggable:draggable})},WPGMZA.Feature.prototype.getScalarProperties=function(){var options={};for(var key in this)switch(typeof this[key]){case"number":options[key]=parseFloat(this[key]);break;case"boolean":case"string":options[key]=this[key]}return options},WPGMZA.Feature.prototype.updateNativeFeature=function(){var props=this.getScalarProperties();switch(WPGMZA.settings.engine){case"open-layers":this.layer&&this.layer.setStyle(WPGMZA.OLFeature.getOLStyle(props));break;default:this.googleFeature.setOptions(props)}}}),jQuery(function($){var Parent=WPGMZA.Feature;WPGMZA.Circle=function(options,engineCircle){WPGMZA.assertInstanceOf(this,"Circle"),this.center=new WPGMZA.LatLng,this.radius=100,Parent.apply(this,arguments)},WPGMZA.extend(WPGMZA.Circle,WPGMZA.Feature),Object.defineProperty(WPGMZA.Circle.prototype,"fillColor",{enumerable:!0,get:function(){return this.color&&this.color.length?this.color:"#ff0000"},set:function(a){this.color=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity||0==this.opacity?parseFloat(this.opacity):.5},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"strokeColor",{enumerable:!0,get:function(){return this.lineColor?this.lineColor:"#000000"},set:function(a){this.lineColor=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.lineOpacity||0==this.lineOpacity?parseFloat(this.lineOpacity):0},set:function(a){this.lineOpacity=a}}),WPGMZA.Circle.createInstance=function(options,engineCircle){var constructor;switch(WPGMZA.settings.engine){case"open-layers":constructor=WPGMZA.OLCircle;break;default:constructor=WPGMZA.GoogleCircle}return new constructor(options,engineCircle)},WPGMZA.Circle.prototype.getCenter=function(){return this.center.clone()},WPGMZA.Circle.prototype.setCenter=function(latLng){this.center.lat=latLng.lat,this.center.lng=latLng.lng},WPGMZA.Circle.prototype.getRadius=function(){return this.radius},WPGMZA.Circle.prototype.setRadius=function(radius){this.radius=radius},WPGMZA.Circle.prototype.getMap=function(){return this.map},WPGMZA.Circle.prototype.setMap=function(map){this.map&&this.map.removeCircle(this),map&&map.addCircle(this)}}),jQuery(function($){WPGMZA.FriendlyError=function(){}}),jQuery(function($){WPGMZA.Geocoder=function(){WPGMZA.assertInstanceOf(this,"Geocoder")},WPGMZA.Geocoder.SUCCESS="success",WPGMZA.Geocoder.ZERO_RESULTS="zero-results",WPGMZA.Geocoder.FAIL="fail",WPGMZA.Geocoder.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.OLGeocoder;default:return WPGMZA.GoogleGeocoder}},WPGMZA.Geocoder.createInstance=function(){return new(WPGMZA.Geocoder.getConstructor())},WPGMZA.Geocoder.prototype.getLatLngFromAddress=function(options,callback){if(WPGMZA.isLatLngString(options.address)){var parts=options.address.split(/,\s*/),latLng=new WPGMZA.LatLng({lat:parseFloat(parts[0]),lng:parseFloat(parts[1])});callback([latLng.latLng=latLng],WPGMZA.Geocoder.SUCCESS)}},WPGMZA.Geocoder.prototype.getAddressFromLatLng=function(options,callback){callback([new WPGMZA.LatLng(options.latLng).toString()],WPGMZA.Geocoder.SUCCESS)},WPGMZA.Geocoder.prototype.geocode=function(options,callback){if("address"in options)return this.getLatLngFromAddress(options,callback);if("latLng"in options)return this.getAddressFromLatLng(options,callback);throw new Error("You must supply either a latLng or address")}}),jQuery(function($){WPGMZA.GoogleAPIErrorHandler=function(){var self=this;if("google-maps"==WPGMZA.settings.engine&&("map-edit"==WPGMZA.currentPage||0==WPGMZA.is_admin&&1==WPGMZA.userCanAdministrator)){this.element=$(WPGMZA.html.googleMapsAPIErrorDialog),1==WPGMZA.is_admin&&this.element.find(".wpgmza-front-end-only").remove(),this.errorMessageList=this.element.find(".wpgmza-google-api-error-list"),this.templateListItem=this.element.find("li.template").remove(),this.messagesAlreadyDisplayed={};var _error=console.error;console.error=function(message){self.onErrorMessage(message),_error.apply(this,arguments)},"google-maps"!=WPGMZA.settings.engine||WPGMZA.settings.wpgmza_google_maps_api_key&&WPGMZA.settings.wpgmza_google_maps_api_key.length||WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_EDIT||this.addErrorMessage(WPGMZA.localized_strings.no_google_maps_api_key,["https://www.wpgmaps.com/documentation/creating-a-google-maps-api-key/"])}},WPGMZA.GoogleAPIErrorHandler.prototype.onErrorMessage=function(message){var m;if(message)if((m=message.match(/You have exceeded your (daily )?request quota for this API/))||(m=message.match(/This API project is not authorized to use this API/))||(m=message.match(/^Geocoding Service: .+/))){var urls=message.match(/http(s)?:\/\/[^\s]+/gm);this.addErrorMessage(m[0],urls)}else(m=message.match(/^Google Maps.+error: (.+)\s+(http(s?):\/\/.+)/m))&&this.addErrorMessage(m[1].replace(/([A-Z])/g," $1"),[m[2]])},WPGMZA.GoogleAPIErrorHandler.prototype.addErrorMessage=function(message,urls){var self=this;if(!this.messagesAlreadyDisplayed[message]){var li=this.templateListItem.clone();$(li).find(".wpgmza-message").html(message);var buttonContainer=$(li).find(".wpgmza-documentation-buttons"),buttonTemplate=$(li).find(".wpgmza-documentation-buttons>a");if(buttonTemplate.remove(),urls&&urls.length){for(var i=0;i<urls.length;i++){urls[i];var button=buttonTemplate.clone(),text=WPGMZA.localized_strings.documentation;button.attr("href",urls[i]),$(button).find("i").addClass("fa-external-link"),$(button).append(text)}buttonContainer.append(button)}$(this.errorMessageList).append(li),$("#wpgmza_map, .wpgmza_map").each(function(index,el){var container=$(el).find(".wpgmza-google-maps-api-error-overlay");0==container.length&&(container=$("<div class='wpgmza-google-maps-api-error-overlay'></div>")).html(self.element.html()),setTimeout(function(){$(el).append(container)},1e3)}),$(".gm-err-container").parent().css({"z-index":1}),this.messagesAlreadyDisplayed[message]=!0}},WPGMZA.googleAPIErrorHandler=new WPGMZA.GoogleAPIErrorHandler}),jQuery(function($){WPGMZA.InfoWindow=function(feature){var self=this;WPGMZA.EventDispatcher.call(this),WPGMZA.assertInstanceOf(this,"InfoWindow"),this.on("infowindowopen",function(event){self.onOpen(event)}),feature&&(this.feature=feature,this.state=WPGMZA.InfoWindow.STATE_CLOSED,feature.map?setTimeout(function(){self.onFeatureAdded(event)},100):feature.addEventListener("added",function(event){self.onFeatureAdded(event)}))},WPGMZA.InfoWindow.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.InfoWindow.prototype.constructor=WPGMZA.InfoWindow,WPGMZA.InfoWindow.OPEN_BY_CLICK=1,WPGMZA.InfoWindow.OPEN_BY_HOVER=2,WPGMZA.InfoWindow.STATE_OPEN="open",WPGMZA.InfoWindow.STATE_CLOSED="closed",WPGMZA.InfoWindow.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.isProVersion()?WPGMZA.OLProInfoWindow:WPGMZA.OLInfoWindow;default:return WPGMZA.isProVersion()?WPGMZA.GoogleProInfoWindow:WPGMZA.GoogleInfoWindow}},WPGMZA.InfoWindow.createInstance=function(feature){return new(this.getConstructor())(feature)},Object.defineProperty(WPGMZA.InfoWindow.prototype,"content",{get:function(){return this.getContent()},set:function(value){this.contentHtml=value}}),WPGMZA.InfoWindow.prototype.addEditButton=function(){return"map-edit"==WPGMZA.currentPage?' <a title="Edit this marker" style="width:15px;" class="wpgmza_edit_btn" data-edit-marker-id="'+this.feature.id+'"><i class="fa fa-edit"></i></a>':""},WPGMZA.InfoWindow.prototype.workOutDistanceBetweenTwoMarkers=function(location1,location2){if(location1&&location2){var distanceToDisplay=WPGMZA.Distance.between(location1,location2);return this.distanceUnits==WPGMZA.Distance.MILES&&(distanceToDisplay/=WPGMZA.Distance.KILOMETERS_PER_MILE),Math.round(distanceToDisplay,2)}},WPGMZA.InfoWindow.prototype.getContent=function(callback){var html="",extra_html="";if(this.feature instanceof WPGMZA.Marker){if(this.feature.map.settings.store_locator_show_distance&&this.feature.map.storeLocator&&this.feature.map.storeLocator.state==WPGMZA.StoreLocator.STATE_APPLIED){var currentLatLng=this.feature.getPosition(),distance=this.workOutDistanceBetweenTwoMarkers(this.feature.map.storeLocator.center,currentLatLng);extra_html+="<p>"+(this.feature.map.settings.store_locator_distance==WPGMZA.Distance.KILOMETERS?distance+WPGMZA.localized_strings.kilometers_away:distance+" "+WPGMZA.localized_strings.miles_away)+"</p>"}html=this.feature.address+extra_html}return this.contentHtml&&(html=this.contentHtml),callback&&callback(html),html},WPGMZA.InfoWindow.prototype.open=function(map,feature){return this.feature=feature,!WPGMZA.settings.disable_infowindows&&"1"!=WPGMZA.settings.wpgmza_settings_disable_infowindows&&(!this.feature.disableInfoWindow&&(this.state=WPGMZA.InfoWindow.STATE_OPEN,!0))},WPGMZA.InfoWindow.prototype.close=function(){this.state!=WPGMZA.InfoWindow.STATE_CLOSED&&(this.state=WPGMZA.InfoWindow.STATE_CLOSED,this.trigger("infowindowclose"))},WPGMZA.InfoWindow.prototype.setContent=function(options){},WPGMZA.InfoWindow.prototype.setOptions=function(options){},WPGMZA.InfoWindow.prototype.onFeatureAdded=function(){1==this.feature.settings.infoopen&&this.open()},WPGMZA.InfoWindow.prototype.onOpen=function(){}}),jQuery(function($){WPGMZA.LatLng=function(arg,lng){if(this._lat=0,(this._lng=0)!=arguments.length)if(1==arguments.length){if("string"==typeof arg){var m;if(!(m=arg.match(WPGMZA.LatLng.REGEXP)))throw new Error("Invalid LatLng string");arg={lat:m[1],lng:m[3]}}if("object"!=typeof arg||!("lat"in arg&&"lng"in arg))throw new Error("Argument must be a LatLng literal");this.lat=arg.lat,this.lng=arg.lng}else this.lat=arg,this.lng=lng},WPGMZA.LatLng.REGEXP=/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/,WPGMZA.LatLng.isValid=function(obj){return"object"==typeof obj&&("lat"in obj&&"lng"in obj)},WPGMZA.LatLng.isLatLngString=function(str){return"string"==typeof str&&!!str.match(WPGMZA.LatLng.REGEXP)},Object.defineProperty(WPGMZA.LatLng.prototype,"lat",{get:function(){return this._lat},set:function(val){if(!$.isNumeric(val))throw new Error("Latitude must be numeric");this._lat=parseFloat(val)}}),Object.defineProperty(WPGMZA.LatLng.prototype,"lng",{get:function(){return this._lng},set:function(val){if(!$.isNumeric(val))throw new Error("Longitude must be numeric");this._lng=parseFloat(val)}}),WPGMZA.LatLng.fromString=function(string){if(!WPGMZA.LatLng.isLatLngString(string))throw new Error("Not a valid latlng string");var m=string.match(WPGMZA.LatLng.REGEXP);return new WPGMZA.LatLng({lat:parseFloat(m[1]),lng:parseFloat(m[3])})},WPGMZA.LatLng.prototype.toString=function(){return this._lat+", "+this._lng},WPGMZA.LatLng.fromCurrentPosition=function(callback,options){options=options||{},callback&&WPGMZA.getCurrentPosition(function(position){var latLng=new WPGMZA.LatLng({lat:position.coords.latitude,lng:position.coords.longitude});options.geocodeAddress?WPGMZA.Geocoder.createInstance().getAddressFromLatLng({latLng:latLng},function(results){results.length&&(latLng.address=results[0]),callback(latLng)}):callback(latLng)})},WPGMZA.LatLng.fromGoogleLatLng=function(googleLatLng){return new WPGMZA.LatLng(googleLatLng.lat(),googleLatLng.lng())},WPGMZA.LatLng.toGoogleLatLngArray=function(arr){var result=[];return arr.forEach(function(nativeLatLng){if(!(nativeLatLng instanceof WPGMZA.LatLng||"lat"in nativeLatLng&&"lng"in nativeLatLng))throw new Error("Unexpected input");result.push(new google.maps.LatLng({lat:parseFloat(nativeLatLng.lat),lng:parseFloat(nativeLatLng.lng)}))}),result},WPGMZA.LatLng.prototype.toGoogleLatLng=function(){return new google.maps.LatLng({lat:this.lat,lng:this.lng})},WPGMZA.LatLng.prototype.toLatLngLiteral=function(){return{lat:this.lat,lng:this.lng}},WPGMZA.LatLng.prototype.moveByDistance=function(kilometers,heading){var delta=parseFloat(kilometers)/6371,theta=parseFloat(heading)/180*Math.PI,phi1=this.lat/180*Math.PI,lambda1=this.lng/180*Math.PI,sinPhi1=Math.sin(phi1),cosPhi1=Math.cos(phi1),sinDelta=Math.sin(delta),cosDelta=Math.cos(delta),sinTheta=Math.sin(theta),sinPhi2=sinPhi1*cosDelta+cosPhi1*sinDelta*Math.cos(theta),phi2=Math.asin(sinPhi2),y=sinTheta*sinDelta*cosPhi1,x=cosDelta-sinPhi1*sinPhi2,lambda2=lambda1+Math.atan2(y,x);this.lat=180*phi2/Math.PI,this.lng=180*lambda2/Math.PI},WPGMZA.LatLng.prototype.getGreatCircleDistance=function(arg1,arg2){var other,lat1=this.lat,lon1=this.lng;if(1==arguments.length)other=new WPGMZA.LatLng(arg1);else{if(2!=arguments.length)throw new Error("Invalid number of arguments");other=new WPGMZA.LatLng(arg1,arg2)}var lat2=other.lat,lon2=other.lng,phi1=lat1.toRadians(),phi2=lat2.toRadians(),deltaPhi=(lat2-lat1).toRadians(),deltaLambda=(lon2-lon1).toRadians(),a=Math.sin(deltaPhi/2)*Math.sin(deltaPhi/2)+Math.cos(phi1)*Math.cos(phi2)*Math.sin(deltaLambda/2)*Math.sin(deltaLambda/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}}),jQuery(function($){WPGMZA.LatLngBounds=function(southWest,northEast){if(southWest instanceof WPGMZA.LatLngBounds){var other=southWest;this.south=other.south,this.north=other.north,this.west=other.west,this.east=other.east}else southWest&&northEast&&(this.south=southWest.lat,this.north=northEast.lat,this.west=southWest.lng,this.east=northEast.lng)},WPGMZA.LatLngBounds.fromGoogleLatLngBounds=function(googleLatLngBounds){if(!(googleLatLngBounds instanceof google.maps.LatLngBounds))throw new Error("Argument must be an instance of google.maps.LatLngBounds");var result=new WPGMZA.LatLngBounds,southWest=googleLatLngBounds.getSouthWest(),northEast=googleLatLngBounds.getNorthEast();return result.north=northEast.lat(),result.south=southWest.lat(),result.west=southWest.lng(),result.east=northEast.lng(),result},WPGMZA.LatLngBounds.fromGoogleLatLngBoundsLiteral=function(obj){var result=new WPGMZA.LatLngBounds,southWest=obj.southwest,northEast=obj.northeast;return result.north=northEast.lat,result.south=southWest.lat,result.west=southWest.lng,result.east=northEast.lng,result},WPGMZA.LatLngBounds.prototype.isInInitialState=function(){return null==this.north&&null==this.south&&null==this.west&&null==this.east},WPGMZA.LatLngBounds.prototype.extend=function(latLng){if(latLng instanceof WPGMZA.LatLng||(latLng=new WPGMZA.LatLng(latLng)),this.isInInitialState())return this.north=this.south=latLng.lat,void(this.west=this.east=latLng.lng);latLng.lat<this.north&&(this.north=latLng.lat),latLng.lat>this.south&&(this.south=latLng.lat),latLng.lng<this.west&&(this.west=latLng.lng),latLng.lng>this.east&&(this.east=latLng.lng)},WPGMZA.LatLngBounds.prototype.extendByPixelMargin=function(map,x,arg){var y=x;if(!(map instanceof WPGMZA.Map))throw new Error("First argument must be an instance of WPGMZA.Map");if(this.isInInitialState())throw new Error("Cannot extend by pixels in initial state");3<=arguments.length&&(y=arg);var southWest=new WPGMZA.LatLng(this.south,this.west),northEast=new WPGMZA.LatLng(this.north,this.east);southWest=map.latLngToPixels(southWest),northEast=map.latLngToPixels(northEast),southWest.x-=x,southWest.y+=y,northEast.x+=x,northEast.y-=y,southWest=map.pixelsToLatLng(southWest.x,southWest.y),northEast=map.pixelsToLatLng(northEast.x,northEast.y);this.toString();this.north=northEast.lat,this.south=southWest.lat,this.west=southWest.lng,this.east=northEast.lng},WPGMZA.LatLngBounds.prototype.contains=function(latLng){if(!(latLng instanceof WPGMZA.LatLng))throw new Error("Argument must be an instance of WPGMZA.LatLng");return!(latLng.lat<Math.min(this.north,this.south))&&(!(latLng.lat>Math.max(this.north,this.south))&&(this.west<this.east?latLng.lng>=this.west&&latLng.lng<=this.east:latLng.lng<=this.west||latLng.lng>=this.east))},WPGMZA.LatLngBounds.prototype.toString=function(){return this.north+"N "+this.south+"S "+this.west+"W "+this.east+"E"},WPGMZA.LatLngBounds.prototype.toLiteral=function(){return{north:this.north,south:this.south,west:this.west,east:this.east}}}),jQuery(function($){var legacyGlobals={marker_pull:"0",marker_array:[],MYMAP:[],infoWindow_poly:[],markerClusterer:[],heatmap:[],WPGM_Path:[],WPGM_Path_Polygon:[],WPGM_PathLine:[],WPGM_PathLineData:[],WPGM_PathData:[],original_iw:null,wpgmza_user_marker:null,wpgmaps_localize_marker_data:[],wpgmaps_localize_polygon_settings:[],wpgmaps_localize_heatmap_settings:[],wpgmaps_localize_polyline_settings:[],wpgmza_cirtcle_data_array:[],wpgmza_rectangle_data_array:[],wpgmzaForceLegacyMarkerClusterer:!1};function bindLegacyGlobalProperty(key){key in window?console.warn("Cannot redefine legacy global "+key):Object.defineProperty(window,key,{get:function(){return console.warn("This property is deprecated and should no longer be used"),legacyGlobals[key]},set:function(value){console.warn("This property is deprecated and should no longer be used"),legacyGlobals[key]=value}})}for(var key in legacyGlobals)bindLegacyGlobalProperty(key);WPGMZA.legacyGlobals=legacyGlobals,window.InitMap=window.resetLocations=window.searchLocations=window.fillInAddress=window.searchLocationsNear=function(){console.warn("This function is deprecated and should no longer be used")}}),jQuery(function($){WPGMZA.MapListPage=function(){$("body").on("click",".wpgmza_copy_shortcode",function(){var $temp=jQuery("<input>");jQuery('<span id="wpgmza_tmp" style="display:none; width:100%; text-align:center;">');jQuery("body").append($temp),$temp.val(jQuery(this).val()).select(),document.execCommand("copy"),$temp.remove(),WPGMZA.notification("Shortcode Copied")})},WPGMZA.MapListPage.createInstance=function(){return new WPGMZA.MapListPage},$(document).ready(function(event){WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_LIST&&(WPGMZA.mapListPage=WPGMZA.MapListPage.createInstance())})}),jQuery(function($){WPGMZA.MapSettings=function(element){var json,self=this,str=element.getAttribute("data-settings");try{json=JSON.parse(str)}catch(e){str=(str=str.replace(/\\%/g,"%")).replace(/\\\\"/g,'\\"');try{json=JSON.parse(str)}catch(e){json={},console.warn("Failed to parse map settings JSON")}}function addSettings(input){if(input)for(var key in input)if("other_settings"!=key){var value=input[key];String(value).match(/^-?\d+$/)&&(value=parseInt(value)),self[key]=value}}WPGMZA.assertInstanceOf(this,"MapSettings"),addSettings(WPGMZA.settings),addSettings(json),json&&json.other_settings&&addSettings(json.other_settings)},WPGMZA.MapSettings.prototype.toOLViewOptions=function(){var self=this,options={center:ol.proj.fromLonLat([-119.4179,36.7783]),zoom:4};function empty(name){return"object"!=typeof self[name]&&(!self[name]||!self[name].length)}if("string"==typeof this.start_location){var coords=this.start_location.replace(/^\(|\)$/g,"").split(",");WPGMZA.isLatLngString(this.start_location)?options.center=ol.proj.fromLonLat([parseFloat(coords[1]),parseFloat(coords[0])]):console.warn("Invalid start location")}return this.center&&(options.center=ol.proj.fromLonLat([parseFloat(this.center.lng),parseFloat(this.center.lat)])),empty("map_start_lat")||empty("map_start_lng")||(options.center=ol.proj.fromLonLat([parseFloat(this.map_start_lng),parseFloat(this.map_start_lat)])),this.zoom&&(options.zoom=parseInt(this.zoom)),this.start_zoom&&(options.zoom=parseInt(this.start_zoom)),this.map_start_zoom&&(options.zoom=parseInt(this.map_start_zoom)),this.map_min_zoom&&this.map_max_zoom&&(options.minZoom=Math.min(this.map_min_zoom,this.map_max_zoom),options.maxZoom=Math.max(this.map_min_zoom,this.map_max_zoom)),options},WPGMZA.MapSettings.prototype.toGoogleMapsOptions=function(){var self=this,latLngCoords=this.start_location&&this.start_location.length?this.start_location.split(","):[36.7783,-119.4179];function empty(name){return"object"!=typeof self[name]&&(!self[name]||!self[name].length)}function formatCoord(coord){return $.isNumeric(coord)?coord:parseFloat(String(coord).replace(/[\(\)\s]/,""))}var latLng=new google.maps.LatLng(formatCoord(latLngCoords[0]),formatCoord(latLngCoords[1])),zoom=this.start_zoom?parseInt(this.start_zoom):4;!this.start_zoom&&this.zoom&&(zoom=parseInt(this.zoom)),this.map_start_zoom&&(zoom=parseInt(this.map_start_zoom));var options={zoom:zoom,center:latLng};function isSettingDisabled(value){return"yes"===value||!!value}switch(empty("center")||(options.center=new google.maps.LatLng({lat:parseFloat(this.center.lat),lng:parseFloat(this.center.lng)})),empty("map_start_lat")||empty("map_start_lng")||(options.center=new google.maps.LatLng({lat:parseFloat(this.map_start_lat),lng:parseFloat(this.map_start_lng)})),this.map_min_zoom&&this.map_max_zoom&&(options.minZoom=Math.min(this.map_min_zoom,this.map_max_zoom),options.maxZoom=Math.max(this.map_min_zoom,this.map_max_zoom)),options.zoomControl=!isSettingDisabled(this.wpgmza_settings_map_zoom),options.panControl=!isSettingDisabled(this.wpgmza_settings_map_pan),options.mapTypeControl=!isSettingDisabled(this.wpgmza_settings_map_type),options.streetViewControl=!isSettingDisabled(this.wpgmza_settings_map_streetview),options.fullscreenControl=!isSettingDisabled(this.wpgmza_settings_map_full_screen_control),options.draggable=!isSettingDisabled(this.wpgmza_settings_map_draggable),options.disableDoubleClickZoom=isSettingDisabled(this.wpgmza_settings_map_clickzoom),this.wpgmza_settings_map_scroll&&(options.scrollwheel=!1),"greedy"==this.wpgmza_force_greedy_gestures||"yes"==this.wpgmza_force_greedy_gestures||1==this.wpgmza_force_greedy_gestures?(options.gestureHandling="greedy",!this.wpgmza_settings_map_scroll&&"scrollwheel"in options&&delete options.scrollwheel):options.gestureHandling="cooperative",parseInt(this.type)){case 2:options.mapTypeId=google.maps.MapTypeId.SATELLITE;break;case 3:options.mapTypeId=google.maps.MapTypeId.HYBRID;break;case 4:options.mapTypeId=google.maps.MapTypeId.TERRAIN;break;default:options.mapTypeId=google.maps.MapTypeId.ROADMAP}return this.wpgmza_theme_data&&this.wpgmza_theme_data.length&&(options.styles=WPGMZA.GoogleMap.parseThemeData(this.wpgmza_theme_data)),options}}),jQuery(function($){WPGMZA.Map=function(element,options){var self=this;if(WPGMZA.assertInstanceOf(this,"Map"),WPGMZA.EventDispatcher.call(this),!(element instanceof HTMLElement))throw new Error("Argument must be a HTMLElement");if(element.hasAttribute("data-map-id")?this.id=element.getAttribute("data-map-id"):this.id=1,!/\d+/.test(this.id))throw new Error("Map ID must be an integer");if(WPGMZA.maps.push(this),this.element=element,this.element.wpgmzaMap=this,$(this.element).addClass("wpgmza-initialized"),this.engineElement=element,this.markers=[],this.polygons=[],this.polylines=[],this.circles=[],this.rectangles=[],this.loadSettings(options),this.shortcodeAttributes={},$(this.element).attr("data-shortcode-attributes"))try{this.shortcodeAttributes=JSON.parse($(this.element).attr("data-shortcode-attributes")),this.shortcodeAttributes.zoom&&(this.settings.map_start_zoom=parseInt(this.shortcodeAttributes.zoom))}catch(e){console.warn("Error parsing shortcode attributes")}WPGMZA.getCurrentPage()!=WPGMZA.PAGE_MAP_EDIT&&this.initStoreLocator(),this.setDimensions(),this.setAlignment(),this.markerFilter=WPGMZA.MarkerFilter.createInstance(this),WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code&&($(element).append($(WPGMZA.api_consent_html)),$(element).css({height:"auto"})),this.on("init",function(event){self.onInit(event)}),this.on("click",function(event){self.onClick(event)}),WPGMZA.useLegacyGlobals&&(wpgmzaLegacyGlobals.MYMAP[this.id]={map:null,bounds:null,mc:null},wpgmzaLegacyGlobals.MYMAP.init=wpgmzaLegacyGlobals.MYMAP[this.id].init=wpgmzaLegacyGlobals.MYMAP.placeMarkers=wpgmzaLegacyGlobals.MYMAP[this.id].placeMarkers=function(){console.warn("This function is deprecated and should no longer be used")})},WPGMZA.Map.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.Map.prototype.constructor=WPGMZA.Map,WPGMZA.Map.nightTimeThemeData=[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"landscape",elementType:"geometry.fill",stylers:[{color:"#575663"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#80823e"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"geometry.fill",stylers:[{color:"#1b737a"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}],WPGMZA.Map.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.isProVersion()?WPGMZA.OLProMap:WPGMZA.OLMap;default:return WPGMZA.isProVersion()?WPGMZA.GoogleProMap:WPGMZA.GoogleMap}},WPGMZA.Map.createInstance=function(element,options){return new(WPGMZA.Map.getConstructor())(element,options)},Object.defineProperty(WPGMZA.Map.prototype,"markersPlaced",{get:function(){return this._markersPlaced},set:function(value){throw new Error("Value is read only")}}),Object.defineProperty(WPGMZA.Map.prototype,"lat",{get:function(){return this.getCenter().lat},set:function(value){var center=this.getCenter();center.lat=value,this.setCenter(center)}}),Object.defineProperty(WPGMZA.Map.prototype,"lng",{get:function(){return this.getCenter().lng},set:function(value){var center=this.getCenter();center.lng=value,this.setCenter(center)}}),Object.defineProperty(WPGMZA.Map.prototype,"zoom",{get:function(){return this.getZoom()},set:function(value){this.setZoom(value)}}),WPGMZA.Map.prototype.onInit=function(event){this.initPreloader(),"autoFetchFeatures"in this.settings&&!1===this.settings.autoFetchFeatures||this.fetchFeatures()},WPGMZA.Map.prototype.initPreloader=function(){this.preloader=$(WPGMZA.preloaderHTML),$(this.preloader).hide(),$(this.element).append(this.preloader)},WPGMZA.Map.prototype.showPreloader=function(show){show?$(this.preloader).show():$(this.preloader).hide()},WPGMZA.Map.prototype.loadSettings=function(options){var settings=new WPGMZA.MapSettings(this.element);settings.other_settings;if(delete settings.other_settings,options)for(var key in options)settings[key]=options[key];this.settings=settings},WPGMZA.Map.prototype.initStoreLocator=function(){var storeLocatorElement=$(".wpgmza_sl_main_div");storeLocatorElement.length&&(this.storeLocator=WPGMZA.StoreLocator.createInstance(this,storeLocatorElement[0]))},WPGMZA.Map.prototype.getFeatureArrays=function(){var arrays=WPGMZA.Map.prototype.getFeatureArrays.call(this);return arrays.heatmaps=this.heatmaps,arrays},WPGMZA.Map.prototype.setOptions=function(options){for(var name in options)this.settings[name]=options[name]},WPGMZA.Map.prototype.getRESTParameters=function(options){var defaults={};return options&&options.filter||(defaults.filter=JSON.stringify(this.markerFilter.getFilteringParameters())),$.extend(!0,defaults,options)},WPGMZA.Map.prototype.fetchFeaturesViaREST=function(){var data,self=this,filter=this.markerFilter.getFilteringParameters();if("1"==WPGMZA.is_admin&&(filter.includeUnapproved=!0,filter.excludeIntegrated=!0),this.shortcodeAttributes.acf_post_id&&(filter.acfPostID=this.shortcodeAttributes.acf_post_id),this.showPreloader(!0),this.fetchFeaturesXhr&&this.fetchFeaturesXhr.abort(),WPGMZA.settings.fetchMarkersBatchSize){var offset=0,limit=WPGMZA.settings.fetchMarkersBatchSize;!function fetchNextBatch(){filter.offset=offset,filter.limit=limit,data=this.getRESTParameters({filter:JSON.stringify(filter)}),self.fetchFeaturesXhr=WPGMZA.restAPI.call("/markers/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){result.length?(self.onMarkersFetched(result,!0),offset+=limit,fetchNextBatch()):(self.onMarkersFetched(result),data.exclude="markers",WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}}))}})}()}else data=this.getRESTParameters({filter:JSON.stringify(filter)}),this.fetchFeaturesXhr=WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}})},WPGMZA.Map.prototype.fetchFeaturesViaXML=function(){var self=this,urls=[WPGMZA.markerXMLPathURL+this.id+"markers.xml"];function fetchFeaturesExcludingMarkersViaREST(){var filter={map_id:this.id,mashup_ids:this.mashupIDs},data={filter:JSON.stringify(filter),exclude:"markers"};WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}})}if(this.mashupIDs&&this.mashupIDs.forEach(function(id){urls.push(WPGMZA.markerXMLPathURL+id+"markers.xml")}),urls=urls.filter(function(item,index){return urls.indexOf(item)==index}),window.Worker&&window.Blob&&window.URL&&WPGMZA.settings.enable_asynchronous_xml_parsing){var source=WPGMZA.loadXMLAsWebWorker.toString().replace(/function\(\)\s*{([\s\S]+)}/,"$1"),blob=new Blob([source],{type:"text/javascript"}),worker=new Worker(URL.createObjectURL(blob));worker.onmessage=function(event){self.onMarkersFetched(event.data),fetchFeaturesExcludingMarkersViaREST()},worker.postMessage({command:"load",protocol:window.location.protocol,urls:urls})}else for(var filesLoaded=0,converter=new WPGMZA.XMLCacheConverter,converted=[],i=0;i<urls.length;i++)$.ajax(urls[i],{success:function(response,status,xhr){converted=converted.concat(converter.convert(response)),++filesLoaded==urls.length&&(self.onMarkersFetched(converted),fetchFeaturesExcludingMarkersViaREST())}})},WPGMZA.Map.prototype.fetchFeatures=function(){WPGMZA.settings.wpgmza_settings_marker_pull!=WPGMZA.MARKER_PULL_XML||"1"==WPGMZA.is_admin?this.fetchFeaturesViaREST():this.fetchFeaturesViaXML()},WPGMZA.Map.prototype.onFeaturesFetched=function(data){for(var type in data.markers&&this.onMarkersFetched(data.markers),data)if("markers"!=type)for(var module=type.substr(0,1).toUpperCase()+type.substr(1).replace(/s$/,""),i=0;i<data[type].length;i++){var instance=WPGMZA[module].createInstance(data[type][i]);this["add"+module](instance)}},WPGMZA.Map.prototype.onMarkersFetched=function(data,expectMoreBatches){for(var self=this,startFiltered=this.shortcodeAttributes.cat&&this.shortcodeAttributes.cat.length,i=0;i<data.length;i++){var obj=data[i],marker=WPGMZA.Marker.createInstance(obj);startFiltered&&(marker.isFiltered=!0,marker.setVisible(!1)),this.addMarker(marker)}if(!expectMoreBatches){this.showPreloader(!1);var triggerEvent=function(){self._markersPlaced=!0,self.trigger("markersplaced"),self.off("filteringcomplete",triggerEvent)};if(this.shortcodeAttributes.cat){var categories=this.shortcodeAttributes.cat.split(","),select=$("select[mid='"+this.id+"'][name='wpgmza_filter_select']");for(i=0;i<categories.length;i++)$("input[type='checkbox'][mid='"+this.id+"'][value='"+categories[i]+"']").prop("checked",!0),select.val(categories[i]);this.on("filteringcomplete",triggerEvent),this.markerFilter.update({categories:categories})}else triggerEvent();if(this.shortcodeAttributes.markers){var arr=this.shortcodeAttributes.markers.split(","),markers=[];for(i=0;i<arr.length;i++){var id=arr[i];id=id.replace(" ","");marker=this.getMarkerByID(id);markers.push(marker)}this.fitMapBoundsToMarkers(markers)}}},WPGMZA.Map.prototype.fetchFeaturesViaXML=function(){var self=this,urls=[WPGMZA.markerXMLPathURL+this.id+"markers.xml"];function fetchFeaturesExcludingMarkersViaREST(){var filter={map_id:this.id,mashup_ids:this.mashupIDs},data={filter:JSON.stringify(filter),exclude:"markers"};WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}})}if(this.mashupIDs&&this.mashupIDs.forEach(function(id){urls.push(WPGMZA.markerXMLPathURL+id+"markers.xml")}),urls=urls.filter(function(item,index){return urls.indexOf(item)==index}),window.Worker&&window.Blob&&window.URL&&WPGMZA.settings.enable_asynchronous_xml_parsing){var source=WPGMZA.loadXMLAsWebWorker.toString().replace(/function\(\)\s*{([\s\S]+)}/,"$1"),blob=new Blob([source],{type:"text/javascript"}),worker=new Worker(URL.createObjectURL(blob));worker.onmessage=function(event){self.onMarkersFetched(event.data),fetchFeaturesExcludingMarkersViaREST()},worker.postMessage({command:"load",protocol:window.location.protocol,urls:urls})}else for(var filesLoaded=0,converter=new WPGMZA.XMLCacheConverter,converted=[],i=0;i<urls.length;i++)$.ajax(urls[i],{success:function(response,status,xhr){converted=converted.concat(converter.convert(response)),++filesLoaded==urls.length&&(self.onMarkersFetched(converted),fetchFeaturesExcludingMarkersViaREST())}})},WPGMZA.Map.prototype.fetchFeatures=function(){WPGMZA.settings.wpgmza_settings_marker_pull!=WPGMZA.MARKER_PULL_XML||"1"==WPGMZA.is_admin?this.fetchFeaturesViaREST():this.fetchFeaturesViaXML()},WPGMZA.Map.prototype.onFeaturesFetched=function(data){for(var type in data.markers&&this.onMarkersFetched(data.markers),data)if("markers"!=type)for(var module=type.substr(0,1).toUpperCase()+type.substr(1).replace(/s$/,""),i=0;i<data[type].length;i++){var instance=WPGMZA[module].createInstance(data[type][i]);this["add"+module](instance)}},WPGMZA.Map.prototype.onMarkersFetched=function(data,expectMoreBatches){for(var self=this,startFiltered=this.shortcodeAttributes.cat&&this.shortcodeAttributes.cat.length,i=0;i<data.length;i++){var obj=data[i],marker=WPGMZA.Marker.createInstance(obj);startFiltered&&(marker.isFiltered=!0,marker.setVisible(!1)),this.addMarker(marker)}if(!expectMoreBatches){this.showPreloader(!1);var triggerEvent=function(){self._markersPlaced=!0,self.trigger("markersplaced"),self.off("filteringcomplete",triggerEvent)};if(this.shortcodeAttributes.cat){var categories=this.shortcodeAttributes.cat.split(","),select=$("select[mid='"+this.id+"'][name='wpgmza_filter_select']");for(i=0;i<categories.length;i++)$("input[type='checkbox'][mid='"+this.id+"'][value='"+categories[i]+"']").prop("checked",!0),select.val(categories[i]);this.on("filteringcomplete",triggerEvent),this.markerFilter.update({categories:categories})}else triggerEvent();if(this.shortcodeAttributes.markers){var arr=this.shortcodeAttributes.markers.split(","),markers=[];for(i=0;i<arr.length;i++){var id=arr[i];id=id.replace(" ","");marker=this.getMarkerByID(id);markers.push(marker)}this.fitMapBoundsToMarkers(markers)}}};Math.PI;function deg2rad(deg){return deg*(Math.PI/180)}WPGMZA.Map.getGeographicDistance=function(lat1,lon1,lat2,lon2){var dLat=deg2rad(lat2-lat1),dLon=deg2rad(lon2-lon1),a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(deg2rad(lat1))*Math.cos(deg2rad(lat2))*Math.sin(dLon/2)*Math.sin(dLon/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))},WPGMZA.Map.prototype.setCenter=function(latLng){if(!("lat"in latLng&&"lng"in latLng))throw new Error("Argument is not an object with lat and lng")},WPGMZA.Map.prototype.setDimensions=function(width,height){0==arguments.length&&(width=this.settings.map_width?this.settings.map_width:"100",this.settings.map_width_type?width+=this.settings.map_width_type.replace("\\",""):width+="%",height=this.settings.map_height?this.settings.map_height:"400",this.settings.map_height_type?height+=this.settings.map_height_type.replace("\\",""):height+="px"),$(this.engineElement).css({width:width,height:height})},WPGMZA.Map.prototype.setAlignment=function(){switch(parseInt(this.settings.wpgmza_map_align)){case 1:$(this.element).css({float:"left"});break;case 2:$(this.element).css({"margin-left":"auto","margin-right":"auto"});break;case 3:$(this.element).css({float:"right"})}},WPGMZA.Map.prototype.addMarker=function(marker){if(!(marker instanceof WPGMZA.Marker))throw new Error("Argument must be an instance of WPGMZA.Marker");marker.map=this,(marker.parent=this).markers.push(marker),this.dispatchEvent({type:"markeradded",marker:marker}),marker.dispatchEvent({type:"added"})},WPGMZA.Map.prototype.removeMarker=function(marker){if(!(marker instanceof WPGMZA.Marker))throw new Error("Argument must be an instance of WPGMZA.Marker");if(marker.map!==this)throw new Error("Wrong map error");marker.infoWindow&&marker.infoWindow.close(),marker.map=null,marker.parent=null;var index=this.markers.indexOf(marker);if(-1==index)throw new Error("Marker not found in marker array");this.markers.splice(index,1),this.dispatchEvent({type:"markerremoved",marker:marker}),marker.dispatchEvent({type:"removed"})},WPGMZA.Map.prototype.removeAllMarkers=function(options){for(var i=this.markers.length-1;0<=i;i--)this.removeMarker(this.markers[i])},WPGMZA.Map.prototype.getMarkerByID=function(id){for(var i=0;i<this.markers.length;i++)if(this.markers[i].id==id)return this.markers[i];return null},WPGMZA.Map.prototype.getMarkerByTitle=function(title){if("string"==typeof title){for(var i=0;i<this.markers.length;i++)if(this.markers[i].title==title)return this.markers[i]}else{if(!(title instanceof RegExp))throw new Error("Invalid argument");for(i=0;i<this.markers.length;i++)if(title.test(this.markers[i].title))return this.markers[i]}return null},WPGMZA.Map.prototype.removeMarkerByID=function(id){var marker=this.getMarkerByID(id);marker&&this.removeMarker(marker)},WPGMZA.Map.prototype.addPolygon=function(polygon){if(!(polygon instanceof WPGMZA.Polygon))throw new Error("Argument must be an instance of WPGMZA.Polygon");(polygon.map=this).polygons.push(polygon),this.dispatchEvent({type:"polygonadded",polygon:polygon})},WPGMZA.Map.prototype.removePolygon=function(polygon){if(!(polygon instanceof WPGMZA.Polygon))throw new Error("Argument must be an instance of WPGMZA.Polygon");if(polygon.map!==this)throw new Error("Wrong map error");polygon.map=null,this.polygons.splice(this.polygons.indexOf(polygon),1),this.dispatchEvent({type:"polygonremoved",polygon:polygon})},WPGMZA.Map.prototype.getPolygonByID=function(id){for(var i=0;i<this.polygons.length;i++)if(this.polygons[i].id==id)return this.polygons[i];return null},WPGMZA.Map.prototype.removePolygonByID=function(id){var polygon=this.getPolygonByID(id);polygon&&this.removePolygon(polygon)},WPGMZA.Map.prototype.getPolylineByID=function(id){for(var i=0;i<this.polylines.length;i++)if(this.polylines[i].id==id)return this.polylines[i];return null},WPGMZA.Map.prototype.addPolyline=function(polyline){if(!(polyline instanceof WPGMZA.Polyline))throw new Error("Argument must be an instance of WPGMZA.Polyline");(polyline.map=this).polylines.push(polyline),this.dispatchEvent({type:"polylineadded",polyline:polyline})},WPGMZA.Map.prototype.removePolyline=function(polyline){if(!(polyline instanceof WPGMZA.Polyline))throw new Error("Argument must be an instance of WPGMZA.Polyline");if(polyline.map!==this)throw new Error("Wrong map error");polyline.map=null,this.polylines.splice(this.polylines.indexOf(polyline),1),this.dispatchEvent({type:"polylineremoved",polyline:polyline})},WPGMZA.Map.prototype.getPolylineByID=function(id){for(var i=0;i<this.polylines.length;i++)if(this.polylines[i].id==id)return this.polylines[i];return null},WPGMZA.Map.prototype.removePolylineByID=function(id){var polyline=this.getPolylineByID(id);polyline&&this.removePolyline(polyline)},WPGMZA.Map.prototype.addCircle=function(circle){if(!(circle instanceof WPGMZA.Circle))throw new Error("Argument must be an instance of WPGMZA.Circle");(circle.map=this).circles.push(circle),this.dispatchEvent({type:"circleadded",circle:circle})},WPGMZA.Map.prototype.removeCircle=function(circle){if(!(circle instanceof WPGMZA.Circle))throw new Error("Argument must be an instance of WPGMZA.Circle");if(circle.map!==this)throw new Error("Wrong map error");circle.map=null,this.circles.splice(this.circles.indexOf(circle),1),this.dispatchEvent({type:"circleremoved",circle:circle})},WPGMZA.Map.prototype.getCircleByID=function(id){for(var i=0;i<this.circles.length;i++)if(this.circles[i].id==id)return this.circles[i];return null},WPGMZA.Map.prototype.removeCircleByID=function(id){var circle=this.getCircleByID(id);circle&&this.removeCircle(circle)},WPGMZA.Map.prototype.addRectangle=function(rectangle){if(!(rectangle instanceof WPGMZA.Rectangle))throw new Error("Argument must be an instance of WPGMZA.Rectangle");(rectangle.map=this).rectangles.push(rectangle),this.dispatchEvent({type:"rectangleadded",rectangle:rectangle})},WPGMZA.Map.prototype.removeRectangle=function(rectangle){if(!(rectangle instanceof WPGMZA.Rectangle))throw new Error("Argument must be an instance of WPGMZA.Rectangle");if(rectangle.map!==this)throw new Error("Wrong map error");rectangle.map=null,this.rectangles.splice(this.rectangles.indexOf(rectangle),1),this.dispatchEvent({type:"rectangleremoved",rectangle:rectangle})},WPGMZA.Map.prototype.getRectangleByID=function(id){for(var i=0;i<this.rectangles.length;i++)if(this.rectangles[i].id==id)return this.rectangles[i];return null},WPGMZA.Map.prototype.removeRectangleByID=function(id){var rectangle=this.getRectangleByID(id);rectangle&&this.removeRectangle(rectangle)},WPGMZA.Map.prototype.resetBounds=function(){var latlng=new WPGMZA.LatLng(this.settings.map_start_lat,this.settings.map_start_lng);this.panTo(latlng),this.setZoom(this.settings.map_start_zoom)},WPGMZA.Map.prototype.nudge=function(x,y){var nudged=this.nudgeLatLng(this.getCenter(),x,y);this.setCenter(nudged)},WPGMZA.Map.prototype.nudgeLatLng=function(latLng,x,y){var pixels=this.latLngToPixels(latLng);if(pixels.x+=parseFloat(x),pixels.y+=parseFloat(y),isNaN(pixels.x)||isNaN(pixels.y))throw new Error("Invalid coordinates supplied");return this.pixelsToLatLng(pixels)},WPGMZA.Map.prototype.animateNudge=function(x,y,origin,milliseconds){var nudged;if(origin){if(!(origin instanceof WPGMZA.LatLng))throw new Error("Origin must be an instance of WPGMZA.LatLng")}else origin=this.getCenter();nudged=this.nudgeLatLng(origin,x,y),milliseconds=milliseconds||WPGMZA.getScrollAnimationDuration(),$(this).animate({lat:nudged.lat,lng:nudged.lng},milliseconds)},WPGMZA.Map.prototype.onWindowResize=function(event){},WPGMZA.Map.prototype.onElementResized=function(event){},WPGMZA.Map.prototype.onBoundsChanged=function(event){this.trigger("boundschanged"),this.trigger("bounds_changed")},WPGMZA.Map.prototype.onIdle=function(event){this.trigger("idle")},WPGMZA.Map.prototype.onClick=function(event){},WPGMZA.Map.prototype.hasVisibleMarkers=function(){for(var marker,length=this.markers.length,i=0;i<length;i++)if((marker=this.markers[i]).isFilterable&&marker.getVisible())return!0;return!1},WPGMZA.Map.prototype.closeAllInfoWindows=function(){this.markers.forEach(function(marker){marker.infoWindow&&marker.infoWindow.close()})},$(document).ready(function(event){if(!WPGMZA.visibilityWorkaroundIntervalID){var invisibleMaps=jQuery(".wpgmza_map:hidden");WPGMZA.visibilityWorkaroundIntervalID=setInterval(function(){jQuery(invisibleMaps).each(function(index,el){if(jQuery(el).is(":visible")){var id=jQuery(el).attr("data-map-id");WPGMZA.getMapByID(id).onElementResized(),invisibleMaps.splice(invisibleMaps.toArray().indexOf(el),1)}})},1e3)}})}),jQuery(function($){WPGMZA.MapsEngineDialog=function(element){var self=this;this.element=element,window.wpgmzaUnbindSaveReminder&&window.wpgmzaUnbindSaveReminder(),$(element).show(),$(element).remodal().open(),$(element).find("input:radio").on("change",function(event){$("#wpgmza-confirm-engine").prop("disabled",!1),$("#wpgmza-confirm-engine").click()}),$("#wpgmza-confirm-engine").on("click",function(event){self.onButtonClicked(event)})},WPGMZA.MapsEngineDialog.prototype.onButtonClicked=function(event){$(event.target).prop("disabled",!0),$.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_maps_engine_dialog_set_engine",engine:$("[name='wpgmza_maps_engine']:checked").val(),nonce:$("#wpgmza-maps-engine-dialog").attr("data-ajax-nonce")},success:function(response,status,xhr){window.location.reload()}})},$(document).ready(function(event){var element=$("#wpgmza-maps-engine-dialog");element.length&&(WPGMZA.settings.wpgmza_maps_engine_dialog_done||WPGMZA.settings.wpgmza_google_maps_api_key&&WPGMZA.settings.wpgmza_google_maps_api_key.length||(WPGMZA.mapsEngineDialog=new WPGMZA.MapsEngineDialog(element)))})}),jQuery(function($){WPGMZA.MarkerFilter=function(map){WPGMZA.EventDispatcher.call(this),this.map=map},WPGMZA.MarkerFilter.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.MarkerFilter.prototype.constructor=WPGMZA.MarkerFilter,WPGMZA.MarkerFilter.createInstance=function(map){return new WPGMZA.MarkerFilter(map)},WPGMZA.MarkerFilter.prototype.getFilteringParameters=function(){var params={map_id:this.map.id};return this.map.storeLocator&&(params=$.extend(params,this.map.storeLocator.getFilteringParameters())),params},WPGMZA.MarkerFilter.prototype.update=function(params,source){var self=this;function dispatchEvent(result){var event=new WPGMZA.Event("filteringcomplete");event.map=self.map,event.source=source,event.filteredMarkers=result,event.filteringParams=params,self.onFilteringComplete(event),self.trigger(event),self.map.trigger(event)}this.updateTimeoutID||(params=params||{},this.xhr&&(this.xhr.abort(),delete this.xhr),this.updateTimeoutID=setTimeout(function(){if((params=$.extend(self.getFilteringParameters(),params)).center instanceof WPGMZA.LatLng&&(params.center=params.center.toLatLngLiteral()),params.hideAll)return dispatchEvent([]),void delete self.updateTimeoutID;self.map.showPreloader(!0),self.xhr=WPGMZA.restAPI.call("/markers",{data:{fields:["id"],filter:JSON.stringify(params)},success:function(result,status,xhr){self.map.showPreloader(!1),dispatchEvent(result)},useCompressedPathVariable:!0}),delete self.updateTimeoutID},0))},WPGMZA.MarkerFilter.prototype.onFilteringComplete=function(event){var map=[];event.filteredMarkers.forEach(function(data){map[data.id]=!0}),this.map.markers.forEach(function(marker){if(marker.isFilterable){var allowByFilter=!!map[marker.id];marker.isFiltered=!allowByFilter,marker.setVisible(allowByFilter)}})}}),jQuery(function($){WPGMZA.Marker=function(row){var self=this;this._offset={x:0,y:0},WPGMZA.assertInstanceOf(this,"Marker"),this.lat="36.778261",this.lng="-119.4179323999",this.address="California",this.title=null,this.description="",this.link="",this.icon="",this.approved=1,this.pic=null,this.isFilterable=!0,this.disableInfoWindow=!1,WPGMZA.Feature.apply(this,arguments),row&&row.heatmap||(row&&this.on("init",function(event){row.position&&this.setPosition(row.position),row.map&&row.map.addMarker(this)}),this.addEventListener("added",function(event){self.onAdded(event)}),this.handleLegacyGlobals(row))},WPGMZA.Marker.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Marker.prototype.constructor=WPGMZA.Marker,WPGMZA.Marker.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.isProVersion()?WPGMZA.OLProMarker:WPGMZA.OLMarker;default:return WPGMZA.isProVersion()?WPGMZA.GoogleProMarker:WPGMZA.GoogleMarker}},WPGMZA.Marker.createInstance=function(row){return new(WPGMZA.Marker.getConstructor())(row)},WPGMZA.Marker.ANIMATION_NONE="0",WPGMZA.Marker.ANIMATION_BOUNCE="1",WPGMZA.Marker.ANIMATION_DROP="2",Object.defineProperty(WPGMZA.Marker.prototype,"offsetX",{get:function(){return this._offset.x},set:function(value){this._offset.x=value,this.updateOffset()}}),Object.defineProperty(WPGMZA.Marker.prototype,"offsetY",{get:function(){return this._offset.y},set:function(value){this._offset.y=value,this.updateOffset()}}),WPGMZA.Marker.prototype.onAdded=function(event){var self=this;this.addEventListener("click",function(event){self.onClick(event)}),this.addEventListener("mouseover",function(event){self.onMouseOver(event)}),this.addEventListener("select",function(event){self.onSelect(event)}),this.map.settings.marker==this.id&&self.trigger("select"),"1"==this.infoopen&&this.openInfoWindow(!0)},WPGMZA.Marker.prototype.handleLegacyGlobals=function(row){var m;if(WPGMZA.settings.useLegacyGlobals&&this.map_id&&this.id&&!(WPGMZA.pro_version&&(m=WPGMZA.pro_version.match(/\d+/))&&m[0]<=7)){WPGMZA.legacyGlobals.marker_array[this.map_id]||(WPGMZA.legacyGlobals.marker_array[this.map_id]=[]),WPGMZA.legacyGlobals.marker_array[this.map_id][this.id]=this,WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id]||(WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id]=[]);var cloned=$.extend({marker_id:this.id},row);WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id][this.id]=cloned}},WPGMZA.Marker.prototype.initInfoWindow=function(){this.infoWindow||(this.infoWindow=WPGMZA.InfoWindow.createInstance())},WPGMZA.Marker.prototype.openInfoWindow=function(autoOpen){this.map?(autoOpen||(this.map.lastInteractedMarker&&this.map.lastInteractedMarker.infoWindow.close(),this.map.lastInteractedMarker=this),this.initInfoWindow(),this.infoWindow.open(this.map,this)):console.warn("Cannot open infowindow for marker with no map")},WPGMZA.Marker.prototype.onClick=function(event){},WPGMZA.Marker.prototype.onSelect=function(event){this.openInfoWindow()},WPGMZA.Marker.prototype.onMouseOver=function(event){WPGMZA.settings.wpgmza_settings_map_open_marker_by==WPGMZA.InfoWindow.OPEN_BY_HOVER&&this.openInfoWindow()},WPGMZA.Marker.prototype.getIcon=function(){function stripProtocol(url){return"string"!=typeof url?url:url.replace(/^http(s?):/,"")}return WPGMZA.defaultMarkerIcon?stripProtocol(WPGMZA.defaultMarkerIcon):stripProtocol(WPGMZA.settings.default_marker_icon)},WPGMZA.Marker.prototype.getPosition=function(){return new WPGMZA.LatLng({lat:parseFloat(this.lat),lng:parseFloat(this.lng)})},WPGMZA.Marker.prototype.setPosition=function(latLng){latLng instanceof WPGMZA.LatLng?(this.lat=latLng.lat,this.lng=latLng.lng):(this.lat=parseFloat(latLng.lat),this.lng=parseFloat(latLng.lng))},WPGMZA.Marker.prototype.setOffset=function(x,y){this._offset.x=x,this._offset.y=y,this.updateOffset()},WPGMZA.Marker.prototype.updateOffset=function(){},WPGMZA.Marker.prototype.getAnimation=function(){return this.anim},WPGMZA.Marker.prototype.setAnimation=function(animation){},WPGMZA.Marker.prototype.getVisible=function(){},WPGMZA.Marker.prototype.setVisible=function(visible){!visible&&this.infoWindow&&this.infoWindow.close()},WPGMZA.Marker.prototype.getMap=function(){return this.map},WPGMZA.Marker.prototype.setMap=function(map){map?map.addMarker(this):this.map&&this.map.removeMarker(this),this.map=map},WPGMZA.Marker.prototype.getDraggable=function(){},WPGMZA.Marker.prototype.setDraggable=function(draggable){},WPGMZA.Marker.prototype.setOptions=function(options){},WPGMZA.Marker.prototype.setOpacity=function(opacity){},WPGMZA.Marker.prototype.panIntoView=function(){if(!this.map)throw new Error("Marker hasn't been added to a map");this.map.setCenter(this.getPosition())},WPGMZA.Marker.prototype.toJSON=function(){var result=WPGMZA.Feature.prototype.toJSON.call(this),position=this.getPosition();return $.extend(result,{lat:position.lat,lng:position.lng,address:this.address,title:this.title,description:this.description,link:this.link,icon:this.icon,pic:this.pic,approved:this.approved}),result}}),jQuery(function($){WPGMZA.ModernStoreLocatorCircle=function(map_id,settings){var map;map=WPGMZA.isProVersion()?this.map=WPGMZA.getMapByID(map_id):this.map=WPGMZA.maps[0],this.map_id=map_id,this.mapElement=map.element,this.mapSize={width:$(this.mapElement).width(),height:$(this.mapElement).height()},this.initCanvasLayer(),this.settings={center:new WPGMZA.LatLng(0,0),radius:1,color:"#ff0000",shadowColor:"white",shadowBlur:4,centerRingRadius:10,centerRingLineWidth:3,numInnerRings:9,innerRingLineWidth:1,innerRingFade:!0,numOuterRings:7,ringLineWidth:1,mainRingLineWidth:2,numSpokes:6,spokesStartAngle:Math.PI/2,numRadiusLabels:6,radiusLabelsStartAngle:Math.PI/2,radiusLabelFont:"13px sans-serif",visible:!1},settings&&this.setOptions(settings)},WPGMZA.ModernStoreLocatorCircle.createInstance=function(map,settings){return"google-maps"==WPGMZA.settings.engine?new WPGMZA.GoogleModernStoreLocatorCircle(map,settings):new WPGMZA.OLModernStoreLocatorCircle(map,settings)},WPGMZA.ModernStoreLocatorCircle.prototype.initCanvasLayer=function(){},WPGMZA.ModernStoreLocatorCircle.prototype.onResize=function(event){this.draw()},WPGMZA.ModernStoreLocatorCircle.prototype.onUpdate=function(event){this.draw()},WPGMZA.ModernStoreLocatorCircle.prototype.setOptions=function(options){for(var name in options){var functionName="set"+name.substr(0,1).toUpperCase()+name.substr(1);"function"==typeof this[functionName]?this[functionName](options[name]):this.settings[name]=options[name]}},WPGMZA.ModernStoreLocatorCircle.prototype.getResolutionScale=function(){return window.devicePixelRatio||1},WPGMZA.ModernStoreLocatorCircle.prototype.getCenter=function(){return this.getPosition()},WPGMZA.ModernStoreLocatorCircle.prototype.setCenter=function(value){this.setPosition(value)},WPGMZA.ModernStoreLocatorCircle.prototype.getPosition=function(){return this.settings.center},WPGMZA.ModernStoreLocatorCircle.prototype.setPosition=function(position){this.settings.center=position},WPGMZA.ModernStoreLocatorCircle.prototype.getRadius=function(){return this.settings.radius},WPGMZA.ModernStoreLocatorCircle.prototype.setRadius=function(radius){if(isNaN(radius))throw new Error("Invalid radius");this.settings.radius=radius},WPGMZA.ModernStoreLocatorCircle.prototype.getVisible=function(){return this.settings.visible},WPGMZA.ModernStoreLocatorCircle.prototype.setVisible=function(visible){this.settings.visible=visible},WPGMZA.ModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.getContext=function(type){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.validateSettings=function(){WPGMZA.isHexColorString(this.settings.color)||(this.settings.color="#ff0000")},WPGMZA.ModernStoreLocatorCircle.prototype.draw=function(){this.validateSettings();var settings=this.settings,canvasDimensions=this.getCanvasDimensions(),canvasWidth=canvasDimensions.width,canvasHeight=canvasDimensions.height;this.map,this.getResolutionScale();if(context=this.getContext("2d"),context.clearRect(0,0,canvasWidth,canvasHeight),settings.visible){context.shadowColor=settings.shadowColor,context.shadowBlur=settings.shadowBlur,context.setTransform(1,0,0,1,0,0);var scale=this.getScale();context.scale(scale,scale);var offset=this.getWorldOriginOffset();context.translate(offset.x,offset.y);new WPGMZA.LatLng(this.settings.center);var worldPoint=this.getCenterPixels(),rgba=WPGMZA.hexToRgba(settings.color),ringSpacing=this.getTransformedRadius(settings.radius)/(settings.numInnerRings+1);context.strokeStyle=settings.color,context.lineWidth=1/scale*settings.centerRingLineWidth,context.beginPath(),context.arc(worldPoint.x,worldPoint.y,this.getTransformedRadius(settings.centerRingRadius)/scale,0,2*Math.PI),context.stroke(),context.closePath();var end,radius=this.getTransformedRadius(settings.radius)+ringSpacing*settings.numOuterRings+1,grad=context.createRadialGradient(0,0,0,0,0,radius),start=(rgba=WPGMZA.hexToRgba(settings.color),WPGMZA.rgbaToString(rgba));rgba.a=0,end=WPGMZA.rgbaToString(rgba),grad.addColorStop(0,start),grad.addColorStop(1,end),context.save(),context.translate(worldPoint.x,worldPoint.y),context.strokeStyle=grad,context.lineWidth=2/scale;for(var i=0;i<settings.numSpokes;i++)spokeAngle=settings.spokesStartAngle+2*Math.PI*(i/settings.numSpokes),x=Math.cos(spokeAngle)*radius,y=Math.sin(spokeAngle)*radius,context.setLineDash([2/scale,15/scale]),context.beginPath(),context.moveTo(0,0),context.lineTo(x,y),context.stroke();context.setLineDash([]),context.restore(),context.lineWidth=1/scale*settings.innerRingLineWidth;for(i=1;i<=settings.numInnerRings;i++){radius=i*ringSpacing;settings.innerRingFade&&(rgba.a=1-(i-1)/settings.numInnerRings),context.strokeStyle=WPGMZA.rgbaToString(rgba),context.beginPath(),context.arc(worldPoint.x,worldPoint.y,radius,0,2*Math.PI),context.stroke(),context.closePath()}context.strokeStyle=settings.color,context.lineWidth=1/scale*settings.centerRingLineWidth,context.beginPath(),context.arc(worldPoint.x,worldPoint.y,this.getTransformedRadius(settings.radius),0,2*Math.PI),context.stroke(),context.closePath();for(radius=radius+ringSpacing,i=0;i<settings.numOuterRings;i++)settings.innerRingFade&&(rgba.a=1-i/settings.numOuterRings),context.strokeStyle=WPGMZA.rgbaToString(rgba),context.beginPath(),context.arc(worldPoint.x,worldPoint.y,radius,0,2*Math.PI),context.stroke(),context.closePath(),radius+=ringSpacing;if(0<settings.numRadiusLabels){var m,x,y;radius=this.getTransformedRadius(settings.radius);(m=settings.radiusLabelFont.match(/(\d+)px/))&&parseInt(m[1]),context.font=settings.radiusLabelFont,context.textAlign="center",context.textBaseline="middle",context.fillStyle=settings.color,context.save(),context.translate(worldPoint.x,worldPoint.y);for(i=0;i<settings.numRadiusLabels;i++){var spokeAngle,width,textAngle=(spokeAngle=settings.radiusLabelsStartAngle+2*Math.PI*(i/settings.numRadiusLabels))+Math.PI/2,text=settings.radiusString;0<Math.sin(spokeAngle)&&(textAngle-=Math.PI),x=Math.cos(spokeAngle)*radius,y=Math.sin(spokeAngle)*radius,context.save(),context.translate(x,y),context.rotate(textAngle),context.scale(1/scale,1/scale),width=context.measureText(text).width,height=width/2,context.clearRect(-width,-height,2*width,2*height),context.fillText(settings.radiusString,0,0),context.restore()}context.restore()}}}}),jQuery(function($){WPGMZA.ModernStoreLocator=function(map_id){var original,self=this,map=WPGMZA.getMapByID(map_id);if(WPGMZA.assertInstanceOf(this,"ModernStoreLocator"),(original=WPGMZA.isProVersion()?$(".wpgmza_sl_search_button[mid='"+map_id+"'], .wpgmza_sl_search_button_"+map_id).closest(".wpgmza_sl_main_div"):$(".wpgmza_sl_search_button").closest(".wpgmza_sl_main_div")).length){this.element=$("<div class='wpgmza-modern-store-locator'><div class='wpgmza-inner wpgmza-modern-hover-opaque'/></div>")[0];var addressInput,inner=$(this.element).find(".wpgmza-inner");addressInput=WPGMZA.isProVersion()?$(original).find(".addressInput"):$(original).find("#addressInput"),map.settings.store_locator_query_string&&map.settings.store_locator_query_string.length&&addressInput.attr("placeholder",map.settings.store_locator_query_string),inner.append(addressInput);var button,titleSearch=$(original).find("[id='nameInput_"+map_id+"']");if(titleSearch.length){var placeholder=map.settings.store_locator_name_string;placeholder&&placeholder.length&&titleSearch.attr("placeholder",placeholder),inner.append(titleSearch)}(button=$(original).find("button.wpgmza-use-my-location"))&&inner.append(button),$(addressInput).on("keydown keypress",function(event){13==event.keyCode&&self.searchButton.is(":visible")&&self.searchButton.trigger("click")}),$(addressInput).on("input",function(event){self.searchButton.show(),self.resetButton.hide()}),inner.append($(original).find("select.wpgmza_sl_radius_select")),this.searchButton=$(original).find(".wpgmza_sl_search_button, .wpgmza_sl_search_button_div"),inner.append(this.searchButton),this.resetButton=$(original).find(".wpgmza_sl_reset_button_div"),inner.append(this.resetButton),this.resetButton.on("click",function(event){resetLocations(map_id)}),this.resetButton.hide(),WPGMZA.isProVersion()&&(this.searchButton.on("click",function(event){0!=$("addressInput_"+map_id).val()&&(self.searchButton.hide(),self.resetButton.show(),map.storeLocator.state=WPGMZA.StoreLocator.STATE_APPLIED)}),this.resetButton.on("click",function(event){self.resetButton.hide(),self.searchButton.show(),map.storeLocator.state=WPGMZA.StoreLocator.STATE_INITIAL})),inner.append($("#wpgmza_distance_type_"+map_id));var container=$(original).find(".wpgmza_cat_checkbox_holder"),items=($(container).children("ul"),$(container).find("li")),numCategories=0,icons=[];items.each(function(index,el){var id=$(el).attr("class").match(/\d+/);for(var category_id in wpgmza_category_data)if(id==category_id){var src=wpgmza_category_data[category_id].image,icon=$('<div class="wpgmza-chip-icon"/>');icon.css({"background-image":"url('"+src+"')",width:$("#wpgmza_cat_checkbox_"+category_id+" + label").height()+"px"}),icons.push(icon),null!=src&&""!=src&&$("#wpgmza_cat_checkbox_"+category_id+" + label").prepend(icon),numCategories++;break}}),$(this.element).append(container),numCategories&&(this.optionsButton=$('<span class="wpgmza_store_locator_options_button"><i class="fa fa-list"></i></span>'),$(this.searchButton).before(this.optionsButton)),setInterval(function(){icons.forEach(function(icon){var height=$(icon).height();$(icon).css({width:height+"px"}),$(icon).closest("label").css({"padding-left":height+8+"px"})}),$(container).css("width",$(self.element).find(".wpgmza-inner").outerWidth()+"px")},1e3),$(this.element).find(".wpgmza_store_locator_options_button").on("click",function(event){container.hasClass("wpgmza-open")?container.removeClass("wpgmza-open"):container.addClass("wpgmza-open")}),$(original).remove(),$(this.element).find("input, select").on("focus",function(){$(inner).addClass("active")}),$(this.element).find("input, select").on("blur",function(){$(inner).removeClass("active")}),$(this.element).on("mouseover","li.wpgmza_cat_checkbox_item_holder",function(event){self.onMouseOverCategory(event)}),$(this.element).on("mouseleave","li.wpgmza_cat_checkbox_item_holder",function(event){self.onMouseLeaveCategory(event)}),$("body").on("click",".wpgmza_store_locator_options_button",function(event){setTimeout(function(){if($(".wpgmza_cat_checkbox_holder").hasClass("wpgmza-open")){var p_cat=$(".wpgmza_cat_checkbox_holder"),position_cat=p_cat.position().top+p_cat.outerHeight(!0)+$(".wpgmza-modern-store-locator").height(),$p_map=$(".wpgmza_map");$p_map.position().top+$p_map.outerHeight(!0)<=position_cat&&($(".wpgmza_cat_ul").css("overflow","scroll "),$(".wpgmza_cat_ul").css("height","100%"),$(".wpgmza-modern-store-locator").css("height","100%"),$(".wpgmza_cat_checkbox_holder.wpgmza-open").css({"padding-bottom":"50px",height:"100%"}))}},500)})}},WPGMZA.ModernStoreLocator.createInstance=function(map_id){switch(WPGMZA.settings.engine){case"open-layers":return new WPGMZA.OLModernStoreLocator(map_id);default:return new WPGMZA.GoogleModernStoreLocator(map_id)}},WPGMZA.ModernStoreLocator.prototype.onMouseOverCategory=function(event){var li=event.currentTarget;$(li).children("ul.wpgmza_cat_checkbox_item_holder").stop(!0,!1).fadeIn()},WPGMZA.ModernStoreLocator.prototype.onMouseLeaveCategory=function(event){var li=event.currentTarget;$(li).children("ul.wpgmza_cat_checkbox_item_holder").stop(!0,!1).fadeOut()}}),jQuery(function($){WPGMZA.NativeMapsAppIcon=function(){navigator.userAgent.match(/^Apple|iPhone|iPad|iPod/)?(this.type="apple",this.element=$('<span><i class="fab fa fa-apple" aria-hidden="true"></i></span>')):(this.type="google",this.element=$('<span><i class="fab fa fa-google" aria-hidden="true"></i></span>'))}}),jQuery(function($){Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:function(begin,end){return new Uint8Array(Array.prototype.slice.call(this,begin,end))}}),WPGMZA.isSafari()&&!window.external&&(window.external={})}),jQuery(function($){WPGMZA.Polygon=function(row,enginePolygon){WPGMZA.assertInstanceOf(this,"Polygon"),this.paths=null,WPGMZA.Feature.apply(this,arguments)},WPGMZA.Polygon.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Polygon.prototype.constructor=WPGMZA.Polygon,Object.defineProperty(WPGMZA.Polygon.prototype,"fillColor",{enumerable:!0,get:function(){return this.fillcolor&&this.fillcolor.length?"#"+this.fillcolor.replace(/^#/,""):"#ff0000"},set:function(a){this.fillcolor=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity&&this.opacity.length?this.opacity:.6},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"strokeColor",{enumerable:!0,get:function(){return this.linecolor&&this.linecolor.length?"#"+this.linecolor.replace(/^#/,""):"#ff0000"},set:function(a){this.linecolor=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.lineopacity&&this.lineopacity.length?this.lineopacity:.6},set:function(a){this.lineopacity=a}}),WPGMZA.Polygon.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.isProVersion()?WPGMZA.OLProPolygon:WPGMZA.OLPolygon;default:return WPGMZA.isProVersion()?WPGMZA.GoogleProPolygon:WPGMZA.GooglePolygon}},WPGMZA.Polygon.createInstance=function(row,engineObject){return new(WPGMZA.Polygon.getConstructor())(row,engineObject)}}),jQuery(function($){WPGMZA.Polyline=function(options,googlePolyline){WPGMZA.assertInstanceOf(this,"Polyline"),WPGMZA.Feature.apply(this,arguments)},WPGMZA.Polyline.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Polyline.prototype.constructor=WPGMZA.Polyline,Object.defineProperty(WPGMZA.Polyline.prototype,"strokeColor",{enumerable:!0,get:function(){return this.linecolor&&this.linecolor.length?"#"+this.linecolor.replace(/^#/,""):"#ff0000"},set:function(a){this.linecolor=a}}),Object.defineProperty(WPGMZA.Polyline.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.opacity&&this.opacity.length?this.opacity:.6},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Polyline.prototype,"strokeWeight",{enumerable:!0,get:function(){return this.linethickness&&this.linethickness.length?parseInt(this.linethickness):1},set:function(a){this.linethickness=a}}),WPGMZA.Polyline.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.OLPolyline;default:return WPGMZA.GooglePolyline}},WPGMZA.Polyline.createInstance=function(options,engineObject){return new(WPGMZA.Polyline.getConstructor())(options,engineObject)},WPGMZA.Polyline.prototype.getPoints=function(){return this.toJSON().points},WPGMZA.Polyline.prototype.toJSON=function(){var result=WPGMZA.Feature.prototype.toJSON.call(this);return result.title=this.title,result}}),jQuery(function($){WPGMZA.PopoutPanel=function(element){this.element=element},WPGMZA.PopoutPanel.prototype.open=function(){$(this.element).addClass("wpgmza-open")},WPGMZA.PopoutPanel.prototype.close=function(){$(this.element).removeClass("wpgmza-open")}}),jQuery(function($){var Parent=WPGMZA.Feature;WPGMZA.Rectangle=function(options,engineRectangle){WPGMZA.assertInstanceOf(this,"Rectangle"),this.name="",this.cornerA=new WPGMZA.LatLng,this.cornerB=new WPGMZA.LatLng,this.color="#ff0000",this.opacity=.5,Parent.apply(this,arguments)},WPGMZA.extend(WPGMZA.Rectangle,WPGMZA.Feature),Object.defineProperty(WPGMZA.Rectangle.prototype,"fillColor",{enumerable:!0,get:function(){return this.color&&this.color.length?this.color:"#ff0000"},set:function(a){this.color=a}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity||0==this.opacity?parseFloat(this.opacity):.5},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"strokeColor",{enumerable:!0,get:function(){return"#000000"}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"strokeOpacity",{enumerable:!0,get:function(){return 0}}),WPGMZA.Rectangle.createInstance=function(options,engineRectangle){var constructor;switch(WPGMZA.settings.engine){case"open-layers":constructor=WPGMZA.OLRectangle;break;default:constructor=WPGMZA.GoogleRectangle}return new constructor(options,engineRectangle)}}),jQuery(function($){function sendAJAXFallbackRequest(route,params){if((params=$.extend({},params)).data||(params.data={}),"route"in params.data)throw new Error("Cannot send route through this method");if("action"in params.data)throw new Error("Cannot send action through this method");return params.data.route=route,params.data.action="wpgmza_rest_api_request",WPGMZA.restAPI.addNonce(route,params,WPGMZA.RestAPI.CONTEXT_AJAX),$.ajax(WPGMZA.ajaxurl,params)}WPGMZA.RestAPI=function(){WPGMZA.RestAPI.URL=WPGMZA.resturl,this.useAJAXFallback=!1},WPGMZA.RestAPI.CONTEXT_REST="REST",WPGMZA.RestAPI.CONTEXT_AJAX="AJAX",WPGMZA.RestAPI.createInstance=function(){return new WPGMZA.RestAPI},Object.defineProperty(WPGMZA.RestAPI.prototype,"isCompressedPathVariableSupported",{get:function(){return WPGMZA.serverCanInflate&&"Uint8Array"in window&&"TextEncoder"in window}}),Object.defineProperty(WPGMZA.RestAPI.prototype,"isCompressedPathVariableAllowed",{get:function(){return!WPGMZA.pro_version||WPGMZA.Version.compare(WPGMZA.pro_version,"8.0.0")>=WPGMZA.Version.EQUAL_TO?!WPGMZA.settings.disable_compressed_path_variables:WPGMZA.settings.enable_compressed_path_variables}}),Object.defineProperty(WPGMZA.RestAPI.prototype,"maxURLLength",{get:function(){return 2083}}),WPGMZA.RestAPI.prototype.compressParams=function(params){var suffix="";if(params.markerIDs){var markerIDs=params.markerIDs.split(",");if(1<markerIDs.length){var encoded=(new WPGMZA.EliasFano).encode(markerIDs),compressed=pako.deflate(encoded),string=Array.prototype.map.call(compressed,function(ch){return String.fromCharCode(ch)}).join("");suffix="/"+btoa(string).replace(/\//g,"-").replace(/=+$/,""),params.midcbp=encoded.pointer,delete params.markerIDs}}string=JSON.stringify(params);var input=(new TextEncoder).encode(string),raw=(compressed=pako.deflate(input),Array.prototype.map.call(compressed,function(ch){return String.fromCharCode(ch)}).join(""));return btoa(raw).replace(/\//g,"-").replace(/=+$/,"")+suffix},WPGMZA.RestAPI.prototype.getNonce=function(route){var matches=[];for(var pattern in WPGMZA.restnoncetable){var regex=new RegExp(pattern);route.match(regex)&&matches.push({pattern:pattern,nonce:WPGMZA.restnoncetable[pattern],length:pattern.length})}if(!matches.length)throw new Error("No nonce found for route");return matches.sort(function(a,b){return b.length-a.length}),matches[0].nonce},WPGMZA.RestAPI.prototype.addNonce=function(route,params,context){function setRESTNonce(xhr){context==WPGMZA.RestAPI.CONTEXT_REST&&self.shouldAddNonce(route)&&xhr.setRequestHeader("X-WP-Nonce",WPGMZA.restnonce),params&¶ms.method&&!params.method.match(/^GET$/i)&&xhr.setRequestHeader("X-WPGMZA-Action-Nonce",self.getNonce(route))}var self=this;if(params.beforeSend){var base=params.beforeSend;params.beforeSend=function(xhr){base(xhr),setRESTNonce(xhr)}}else params.beforeSend=setRESTNonce},WPGMZA.RestAPI.prototype.shouldAddNonce=function(route){route=route.replace(/\//g,"");var isAdmin=!1;WPGMZA.is_admin&&1===parseInt(WPGMZA.is_admin)&&(isAdmin=!0);return!(route&&["markers","features","marker-listing","datatables"].includes(route)&&!isAdmin)},WPGMZA.RestAPI.prototype.call=function(route,params){if(this.useAJAXFallback)return sendAJAXFallbackRequest(route,params);var attemptedCompressedPathVariable=!1,fallbackRoute=route,fallbackParams=$.extend({},params);if("string"!=typeof route||!route.match(/^\//)&&!route.match(/^http/))throw new Error("Invalid route");if(WPGMZA.RestAPI.URL.match(/\/$/)&&(route=route.replace(/^\//,"")),params=params||{},this.addNonce(route,params,WPGMZA.RestAPI.CONTEXT_REST),params.error||(params.error=function(xhr,status,message){if("abort"!=status){switch(xhr.status){case 401:case 403:case 405:return($.post(WPGMZA.ajaxurl,{action:"wpgmza_report_rest_api_blocked"},function(response){}),console.warn("The REST API was blocked. This is usually due to security plugins blocking REST requests for non-authenticated users."),"DELETE"===params.method)?(console.warn("The REST API rejected a DELETE request, attempting again with POST fallback"),params.method="POST",params.data||(params.data={}),params.data.simulateDelete="yes",WPGMZA.restAPI.call(route,params)):(this.useAJAXFallback=!0,sendAJAXFallbackRequest(fallbackRoute,fallbackParams));case 414:if(!attemptedCompressedPathVariable)break;return fallbackParams.method="POST",fallbackParams.useCompressedPathVariable=!1,WPGMZA.restAPI.call(fallbackRoute,fallbackParams)}throw new Error(message)}}),params.useCompressedPathVariable&&this.isCompressedPathVariableSupported&&this.isCompressedPathVariableAllowed){var compressedParams=$.extend({},params),data=params.data,base64=this.compressParams(data);WPGMZA.isServerIIS&&(base64=base64.replace(/\+/g,"%20"));var compressedRoute=route.replace(/\/$/,"")+"/base64"+base64;WPGMZA.RestAPI.URL;compressedParams.method="GET",delete compressedParams.data,!1===params.cache&&(compressedParams.data={skip_cache:1}),compressedRoute.length<this.maxURLLength?(attemptedCompressedPathVariable=!0,route=compressedRoute,params=compressedParams):(WPGMZA.RestAPI.compressedPathVariableURLLimitWarningDisplayed||console.warn("Compressed path variable route would exceed URL length limit"),WPGMZA.RestAPI.compressedPathVariableURLLimitWarningDisplayed=!0)}var onSuccess=null;return params.success&&(onSuccess=params.success),params.success=function(result,status,xhr){if("object"!=typeof result){var rawResult=result;try{result=JSON.parse(result)}catch(parseExc){result=rawResult}}onSuccess&&"function"==typeof onSuccess&&onSuccess(result,status,xhr)},WPGMZA.RestAPI.URL.match(/\?/)&&(route=route.replace(/\?/,"&")),$.ajax(WPGMZA.RestAPI.URL+route,params)};var nativeCallFunction=WPGMZA.RestAPI.call;WPGMZA.RestAPI.call=function(){console.warn("WPGMZA.RestAPI.call was called statically, did you mean to call the function on WPGMZA.restAPI?"),nativeCallFunction.apply(this,arguments)},$(document.body).on("click","#wpgmza-rest-api-blocked button.notice-dismiss",function(event){WPGMZA.restAPI.call("/rest-api/",{method:"POST",data:{dismiss_blocked_notice:!0}})})});var $_GET={};if(-1!==document.location.toString().indexOf("?"))for(var query=document.location.toString().replace(/^.*?\?/,"").replace(/#.*$/,"").split("&"),wpgmza_i=0,wpgmza_l=query.length;wpgmza_i<wpgmza_l;wpgmza_i++){var aux=decodeURIComponent(query[wpgmza_i]).split("=");$_GET[aux[0]]=aux[1]}jQuery(function($){WPGMZA.SettingsPage=function(){var self=this;this._keypressHistory=[],this.updateEngineSpecificControls(),this.updateStorageControls(),this.updateGDPRControls(),$(window).on("keypress",function(event){self.onKeyPress(event)}),jQuery("body").on("click",".wpgmza_destroy_data",function(e){e.preventDefault();var ttype=jQuery(this).attr("danger"),warning="Are you sure?";"wpgmza_destroy_all_data"==ttype&&(warning="Are you sure? This will delete ALL data and settings for WP Google Maps!"),window.confirm(warning)&&jQuery.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_maps_settings_danger_zone_delete_data",type:ttype,nonce:wpgmza_dz_nonce},success:function(response,status,xhr){"wpgmza_destroy_all_data"==ttype?window.location.replace("admin.php?page=wp-google-maps-menu&action=welcome_page"):"wpgmza_reset_all_settings"==ttype?window.location.reload():alert("Complete.")}})}),$("select[name='wpgmza_maps_engine']").on("change",function(event){self.updateEngineSpecificControls()}),$('[name="wpgmza_settings_marker_pull"]').on("click",function(event){self.updateStorageControls()}),$("input[name='wpgmza_gdpr_require_consent_before_load'], input[name='wpgmza_gdpr_require_consent_before_vgm_submit'], input[name='wpgmza_gdpr_override_notice']").on("change",function(event){self.updateGDPRControls()}),$('select[name="tile_server_url"]').on("change",function(event){"custom_override"===$('select[name="tile_server_url"]').val()?$(".wpgmza_tile_server_override_component").removeClass("wpgmza-hidden"):$(".wpgmza_tile_server_override_component").addClass("wpgmza-hidden")}),$('select[name="tile_server_url"]').trigger("change"),jQuery("#wpgmza_flush_cache_btn").on("click",function(){jQuery(this).attr("disabled","disabled"),WPGMZA.settingsPage.flushGeocodeCache()}),$("#wpgmza-global-settings").tabs({create:function(event,ui){if(void 0!==$_GET.highlight){var elmnt=document.getElementById($_GET.highlight);elmnt.classList.add("highlight-item"),setTimeout(function(){elmnt.classList.add("highlight-item-step-2")},1e3);var y=elmnt.getBoundingClientRect().top+window.pageYOffset+-100;window.scrollTo({top:y,behavior:"smooth"})}}}),$("#wpgmza-global-setting").bind("create",function(event,ui){alert("now")}),$("#wpgmza-global-settings fieldset").each(function(index,el){$(el).children(":not(legend)").wrapAll("<span class='settings-group'></span>")})},WPGMZA.SettingsPage.createInstance=function(){return new WPGMZA.SettingsPage},WPGMZA.SettingsPage.prototype.updateEngineSpecificControls=function(){var engine=$("select[name='wpgmza_maps_engine']").val();$("[data-required-maps-engine][data-required-maps-engine!='"+engine+"']").hide(),$("[data-required-maps-engine='"+engine+"']").show()},WPGMZA.SettingsPage.prototype.updateStorageControls=function(){$("input[name='wpgmza_settings_marker_pull'][value='1']").is(":checked")?$("#xml-cache-settings").show():$("#xml-cache-settings").hide()},WPGMZA.SettingsPage.prototype.updateGDPRControls=function(){var showNoticeControls=$("input[name='wpgmza_gdpr_require_consent_before_load']").prop("checked"),vgmCheckbox=$("input[name='wpgmza_gdpr_require_consent_before_vgm_submit']");vgmCheckbox.length&&(showNoticeControls=showNoticeControls||vgmCheckbox.prop("checked"));var showOverrideTextarea=showNoticeControls&&$("input[name='wpgmza_gdpr_override_notice']").prop("checked");showNoticeControls?$("#wpgmza-gdpr-compliance-notice").show("slow"):$("#wpgmza-gdpr-compliance-notice").hide("slow"),showOverrideTextarea?$("#wpgmza_gdpr_override_notice_text").show("slow"):$("#wpgmza_gdpr_override_notice_text").hide("slow")},WPGMZA.SettingsPage.prototype.flushGeocodeCache=function(){(new WPGMZA.OLGeocoder).clearCache(function(response){jQuery("#wpgmza_flush_cache_btn").removeAttr("disabled")})},WPGMZA.SettingsPage.prototype.onKeyPress=function(event){this._keypressHistory.push(event.key),9<this._keypressHistory.length&&(this._keypressHistory=this._keypressHistory.slice(this._keypressHistory.length-9)),"codecabin"!=this._keypressHistory.join("")||this._developerModeRevealed||($("fieldset#wpgmza-developer-mode").show(),this._developerModeRevealed=!0)},$(document).ready(function(event){WPGMZA.getCurrentPage()&&(WPGMZA.settingsPage=WPGMZA.SettingsPage.createInstance())})}),jQuery(function($){WPGMZA.StoreLocator=function(map,element){var self=this;WPGMZA.EventDispatcher.call(this),this._center=null,this.map=map,this.element=element,this.state=WPGMZA.StoreLocator.STATE_INITIAL,this.distanceUnits=this.map.settings.store_locator_distance,this.addressInput=WPGMZA.AddressInput.createInstance(this.addressElement,this.map),$(element).find(".wpgmza-not-found-msg").hide(),this.radiusElement&&this.map.settings.wpgmza_store_locator_default_radius&&0<this.radiusElement.find("option[value='"+this.map.settings.wpgmza_store_locator_default_radius+"']").length&&this.radiusElement.val(this.map.settings.wpgmza_store_locator_default_radius),this.map.on("storelocatorgeocodecomplete",function(event){self.onGeocodeComplete(event)}),this.map.on("init",function(event){self.map.markerFilter.on("filteringcomplete",function(event){self.onFilteringComplete(event)}),void 0!==self.map.settings.store_locator_style&&"modern"!=self.map.settings.store_locator_style&&"modern"!==WPGMZA.settings.user_interface_style||"default"!==WPGMZA.settings.user_interface_style&&"modern"!=WPGMZA.settings.user_interface_style&&"legacy"!=WPGMZA.settings.user_interface_style||(self.legacyModernAdapter=WPGMZA.ModernStoreLocator.createInstance(map.id))}),$(document.body).on("click",".wpgmza_sl_search_button_"+map.id+", [data-map-id='"+map.id+"'] .wpgmza_sl_search_button",function(event){self.onSearch(event)}),$(document.body).on("click",".wpgmza_sl_reset_button_"+map.id+", [data-map-id='"+map.id+"'] .wpgmza_sl_reset_button_div",function(event){self.onReset(event)}),$(this.addressElement).on("keypress",function(event){13==event.which&&self.onSearch(event)})},WPGMZA.StoreLocator.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.StoreLocator.prototype.constructor=WPGMZA.StoreLocator,WPGMZA.StoreLocator.STATE_INITIAL="initial",WPGMZA.StoreLocator.STATE_APPLIED="applied",WPGMZA.StoreLocator.createInstance=function(map,element){return new WPGMZA.StoreLocator(map,element)},Object.defineProperty(WPGMZA.StoreLocator.prototype,"address",{get:function(){return $(this.addressElement).val()}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"addressElement",{get:function(){return this.legacyModernAdapter?$(this.legacyModernAdapter.element).find("input.wpgmza-address")[0]:$(this.element).find("input.wpgmza-address")[0]}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"countryRestriction",{get:function(){return this.map.settings.wpgmza_store_locator_restrict}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"radiusElement",{get:function(){return $("#radiusSelect, #radiusSelect_"+this.map.id)}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"radius",{get:function(){return parseFloat(this.radiusElement.val())}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"center",{get:function(){return this._center}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"bounds",{get:function(){return this._bounds}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"marker",{get:function(){if(1!=this.map.settings.store_locator_bounce)return null;if(this._marker)return this._marker;return this._marker=WPGMZA.Marker.createInstance({visible:!1}),this._marker.disableInfoWindow=!0,this._marker.isFilterable=!1,this._marker.setAnimation(WPGMZA.Marker.ANIMATION_BOUNCE),this._marker}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"circle",{get:function(){return this._circle||("modern"!=this.map.settings.wpgmza_store_locator_radius_style||WPGMZA.isDeviceiOS()?this._circle=WPGMZA.Circle.createInstance({strokeColor:"#ff0000",strokeOpacity:"0.25",strokeWeight:2,fillColor:"#ff0000",fillOpacity:"0.15",visible:!1,clickable:!1,center:new WPGMZA.LatLng}):(this._circle=WPGMZA.ModernStoreLocatorCircle.createInstance(this.map.id),this._circle.settings.color=this.circleStrokeColor)),this._circle}}),WPGMZA.StoreLocator.prototype.onGeocodeComplete=function(event){if(!event.results||!event.results.length)return this._center=null,void(this._bounds=null);this._center=new WPGMZA.LatLng(event.results[0].latLng),this._bounds=new WPGMZA.LatLngBounds(event.results[0].bounds),this.map.markerFilter.update({},this)},WPGMZA.StoreLocator.prototype.onSearch=function(event){var self=this;if(this.state=WPGMZA.StoreLocator.STATE_APPLIED,!this.address||!this.address.length)return this.addressElement.focus(),!1;function callback(results,status){self.map.trigger({type:"storelocatorgeocodecomplete",results:results,status:status})}if(void 0!==this.map.settings.store_locator_style&&"modern"!==this.map.settings.store_locator_style&&"modern"!==WPGMZA.settings.user_interface_style&&"default"===WPGMZA.settings.user_interface_style&&WPGMZA.animateScroll(this.map.element),$(this.element).find(".wpgmza-not-found-msg").hide(),WPGMZA.LatLng.isLatLngString(this.address))callback([WPGMZA.LatLng.fromString(this.address)],WPGMZA.Geocoder.SUCCESS);else{var geocoder=WPGMZA.Geocoder.createInstance(),options={address:this.address};this.countryRestriction&&(options.country=this.countryRestriction),geocoder.geocode(options,function(results,status){status==WPGMZA.Geocoder.SUCCESS?callback(results,status):alert(WPGMZA.localized_strings.address_not_found)})}return!0},WPGMZA.StoreLocator.prototype.onReset=function(event){this.state=WPGMZA.StoreLocator.STATE_INITIAL,this._center=null,this._bounds=null,this.map.setZoom(this.map.settings.map_start_zoom),$(this.element).find(".wpgmza-not-found-msg").hide(),this.circle&&this.circle.setVisible(!1),this.marker&&this.marker.map&&this.map.removeMarker(this.marker),this.map.markerFilter.update({},this)},WPGMZA.StoreLocator.prototype.getFilteringParameters=function(){return this.center?{center:this.center,radius:this.radius}:{}},WPGMZA.StoreLocator.prototype.getZoomFromRadius=function(radius){return this.distanceUnits==WPGMZA.Distance.MILES&&(radius*=WPGMZA.Distance.KILOMETERS_PER_MILE),Math.round(14-Math.log(radius)/Math.LN2)},WPGMZA.StoreLocator.prototype.onFilteringComplete=function(event){var params=event.filteringParams,marker=this.marker;marker&&marker.setVisible(!1),params.center&&(this.map.setCenter(params.center),marker&&(marker.setPosition(params.center),marker.setVisible(!0),marker.map!=this.map&&this.map.addMarker(marker))),params.radius&&this.map.setZoom(this.getZoomFromRadius(params.radius));var circle=this.circle;if(circle){circle.setVisible(!1);var factor=this.distanceUnits==WPGMZA.Distance.MILES?WPGMZA.Distance.KILOMETERS_PER_MILE:1;params.center&¶ms.radius&&(circle.setRadius(params.radius*factor),circle.setCenter(params.center),circle.setVisible(!0),circle instanceof WPGMZA.ModernStoreLocatorCircle||circle.map==this.map||this.map.addCircle(circle)),circle instanceof WPGMZA.ModernStoreLocatorCircle&&(circle.settings.radiusString=this.radius)}0==event.filteredMarkers.length&&(0<$(this.element).find(".wpgmza-no-results").length&&"legacy"===WPGMZA.settings.user_interface_style?$(this.element).find(".wpgmza-no-results").show():alert(this.map.settings.store_locator_not_found_message?this.map.settings.store_locator_not_found_message:WPGMZA.localized_strings.zero_results))}}),jQuery(function($){WPGMZA.Text=function(options){if(options)for(var name in options)this[name]=options[name]},WPGMZA.Text.createInstance=function(options){switch(WPGMZA.settings.engine){case"open-layers":return new WPGMZA.OLText(options);default:return new WPGMZA.GoogleText(options)}}}),jQuery(function($){WPGMZA.ThemeEditor=function(){WPGMZA.EventDispatcher.call(this),this.element=$("#wpgmza-theme-editor"),"open-layers"!=WPGMZA.settings.engine?this.element.length?(this.json=[{}],this.mapElement=WPGMZA.maps[0].element,this.element.appendTo("#wpgmza-map-theme-editor__holder"),$(window).on("scroll",function(event){}),setInterval(function(){},200),this.initHTML(),WPGMZA.themeEditor=this):console.warn("No element to initialise theme editor on"):this.element.remove()},WPGMZA.extend(WPGMZA.ThemeEditor,WPGMZA.EventDispatcher),WPGMZA.ThemeEditor.prototype.updatePosition=function(){},WPGMZA.ThemeEditor.features={all:[],administrative:["country","land_parcel","locality","neighborhood","province"],landscape:["man_made","natural","natural.landcover","natural.terrain"],poi:["attraction","business","government","medical","park","place_of_worship","school","sports_complex"],road:["arterial","highway","highway.controlled_access","local"],transit:["line","station","station.airport","station.bus","station.rail"],water:[]},WPGMZA.ThemeEditor.elements={all:[],geometry:["fill","stroke"],labels:["icon","text","text.fill","text.stroke"]},WPGMZA.ThemeEditor.prototype.parse=function(){$("#wpgmza_theme_editor_feature option, #wpgmza_theme_editor_element option").css("font-weight","normal"),$("#wpgmza_theme_editor_error").hide(),$("#wpgmza_theme_editor").show(),$("#wpgmza_theme_editor_do_hue").prop("checked",!1),$("#wpgmza_theme_editor_hue").val("#000000"),$("#wpgmza_theme_editor_lightness").val(""),$("#wpgmza_theme_editor_saturation").val(""),$("#wpgmza_theme_editor_gamma").val(""),$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!1),$("#wpgmza_theme_editor_visibility").val("inherit"),$("#wpgmza_theme_editor_do_color").prop("checked",!1),$("#wpgmza_theme_editor_color").val("#000000"),$("#wpgmza_theme_editor_weight").val("");var textarea=$('textarea[name="wpgmza_theme_data"]');if(!textarea.val()||textarea.val().length<1)this.json=[{}];else{try{this.json=$.parseJSON($('textarea[name="wpgmza_theme_data"]').val())}catch(e){return this.json=[{}],$("#wpgmza_theme_editor").hide(),void $("#wpgmza_theme_editor_error").show()}if(!$.isArray(this.json)){var jsonCopy=this.json;this.json=[],this.json.push(jsonCopy)}this.highlightFeatures(),this.highlightElements(),this.loadElementStylers()}},WPGMZA.ThemeEditor.prototype.highlightFeatures=function(){$("#wpgmza_theme_editor_feature option").css("font-weight","normal"),$.each(this.json,function(i,v){v.hasOwnProperty("featureType")?$('#wpgmza_theme_editor_feature option[value="'+v.featureType+'"]').css("font-weight","bold"):$('#wpgmza_theme_editor_feature option[value="all"]').css("font-weight","bold")})},WPGMZA.ThemeEditor.prototype.highlightElements=function(){var feature=$("#wpgmza_theme_editor_feature").val();$("#wpgmza_theme_editor_element option").css("font-weight","normal"),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")?$('#wpgmza_theme_editor_element option[value="'+v.elementType+'"]').css("font-weight","bold"):$('#wpgmza_theme_editor_element option[value="all"]').css("font-weight","bold"))})},WPGMZA.ThemeEditor.prototype.loadElementStylers=function(){var feature=$("#wpgmza_theme_editor_feature").val(),element=$("#wpgmza_theme_editor_element").val();$("#wpgmza_theme_editor_do_hue").prop("checked",!1),$("#wpgmza_theme_editor_hue").val("#000000"),$("#wpgmza_theme_editor_lightness").val(""),$("#wpgmza_theme_editor_saturation").val(""),$("#wpgmza_theme_editor_gamma").val(""),$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!1),$("#wpgmza_theme_editor_visibility").val("inherit"),$("#wpgmza_theme_editor_do_color").prop("checked",!1),$("#wpgmza_theme_editor_color").val("#000000"),$("#wpgmza_theme_editor_weight").val(""),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")&&v.elementType==element||"all"==element&&!v.hasOwnProperty("elementType"))&&v.hasOwnProperty("stylers")&&$.isArray(v.stylers)&&0<v.stylers.length&&$.each(v.stylers,function(ii,vv){vv.hasOwnProperty("hue")&&($("#wpgmza_theme_editor_do_hue").prop("checked",!0),$("#wpgmza_theme_editor_hue").val(vv.hue)),vv.hasOwnProperty("lightness")&&$("#wpgmza_theme_editor_lightness").val(vv.lightness),vv.hasOwnProperty("saturation")&&$("#wpgmza_theme_editor_saturation").val(vv.xaturation),vv.hasOwnProperty("gamma")&&$("#wpgmza_theme_editor_gamma").val(vv.gamma),vv.hasOwnProperty("invert_lightness")&&$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!0),vv.hasOwnProperty("visibility")&&$("#wpgmza_theme_editor_visibility").val(vv.visibility),vv.hasOwnProperty("color")&&($("#wpgmza_theme_editor_do_color").prop("checked",!0),$("#wpgmza_theme_editor_color").val(vv.color)),vv.hasOwnProperty("weight")&&$("#wpgmza_theme_editor_weight").val(vv.weight)})})},WPGMZA.ThemeEditor.prototype.writeElementStylers=function(){var feature=$("#wpgmza_theme_editor_feature").val(),element=$("#wpgmza_theme_editor_element").val(),indexJSON=null,stylers=[];if("inherit"!=$("#wpgmza_theme_editor_visibility").val()&&stylers.push({visibility:$("#wpgmza_theme_editor_visibility").val()}),!0===$("#wpgmza_theme_editor_do_color").prop("checked")&&stylers.push({color:$("#wpgmza_theme_editor_color").val()}),!0===$("#wpgmza_theme_editor_do_hue").prop("checked")&&stylers.push({hue:$("#wpgmza_theme_editor_hue").val()}),0<$("#wpgmza_theme_editor_gamma").val().length&&stylers.push({gamma:parseFloat($("#wpgmza_theme_editor_gamma").val())}),0<$("#wpgmza_theme_editor_weight").val().length&&stylers.push({weight:parseFloat($("#wpgmza_theme_editor_weight").val())}),0<$("#wpgmza_theme_editor_saturation").val().length&&stylers.push({saturation:parseFloat($("#wpgmza_theme_editor_saturation").val())}),0<$("#wpgmza_theme_editor_lightness").val().length&&stylers.push({lightness:parseFloat($("#wpgmza_theme_editor_lightness").val())}),!0===$("#wpgmza_theme_editor_do_invert_lightness").prop("checked")&&stylers.push({invert_lightness:!0}),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")&&v.elementType==element||"all"==element&&!v.hasOwnProperty("elementType"))&&(indexJSON=i)}),null===indexJSON){if(0<stylers.length){var new_feature_element_stylers={};"all"!=feature&&(new_feature_element_stylers.featureType=feature),"all"!=element&&(new_feature_element_stylers.elementType=element),new_feature_element_stylers.stylers=stylers,this.json.push(new_feature_element_stylers)}}else 0<stylers.length?this.json[indexJSON].stylers=stylers:this.json.splice(indexJSON,1);$('textarea[name="wpgmza_theme_data"]').val(JSON.stringify(this.json).replace(/:/g,": ").replace(/,/g,", ")),this.highlightFeatures(),this.highlightElements(),WPGMZA.themePanel.updateMapTheme()},WPGMZA.ThemeEditor.prototype.initHTML=function(){var self=this;$.each(WPGMZA.ThemeEditor.features,function(i,v){$("#wpgmza_theme_editor_feature").append('<option value="'+i+'">'+i+"</option>"),0<v.length&&$.each(v,function(ii,vv){$("#wpgmza_theme_editor_feature").append('<option value="'+i+"."+vv+'">'+i+"."+vv+"</option>")})}),$.each(WPGMZA.ThemeEditor.elements,function(i,v){$("#wpgmza_theme_editor_element").append('<option value="'+i+'">'+i+"</option>"),0<v.length&&$.each(v,function(ii,vv){$("#wpgmza_theme_editor_element").append('<option value="'+i+"."+vv+'">'+i+"."+vv+"</option>")})}),this.parse(),$('textarea[name="wpgmza_theme_data"]').on("input selectionchange propertychange",function(){self.parse()}),$(".wpgmza_theme_selection").click(function(){setTimeout(function(){$('textarea[name="wpgmza_theme_data"]').trigger("input")},1e3)}),$("#wpgmza-theme-editor__toggle").click(function(){$("#wpgmza-theme-editor").removeClass("active")}),$("#wpgmza_theme_editor_feature").on("change",function(){self.highlightElements(),self.loadElementStylers()}),$("#wpgmza_theme_editor_element").on("change",function(){self.loadElementStylers()}),$("#wpgmza_theme_editor_do_hue, #wpgmza_theme_editor_hue, #wpgmza_theme_editor_lightness, #wpgmza_theme_editor_saturation, #wpgmza_theme_editor_gamma, #wpgmza_theme_editor_do_invert_lightness, #wpgmza_theme_editor_visibility, #wpgmza_theme_editor_do_color, #wpgmza_theme_editor_color, #wpgmza_theme_editor_weight").on("input selectionchange propertychange",function(){self.writeElementStylers()}),"open-layers"==WPGMZA.settings.engine&&$("#wpgmza_theme_editor :input").prop("disabled",!0)}}),jQuery(function($){WPGMZA.ThemePanel=function(){var self=this;this.element=$("#wpgmza-theme-panel"),this.map=WPGMZA.maps[0],"open-layers"!=WPGMZA.settings.engine?this.element.length?($("#wpgmza-theme-presets").owlCarousel({items:6,dots:!0}),this.element.on("click","#wpgmza-theme-presets label",function(event){self.onThemePresetClick(event)}),$("#wpgmza-open-theme-editor").on("click",function(event){$("#wpgmza-map-theme-editor__holder").addClass("active"),$("#wpgmza-theme-editor").addClass("active"),WPGMZA.animateScroll($("#wpgmza-theme-editor"))}),WPGMZA.themePanel=this):console.warn("No element to initialise theme panel on"):this.element.remove()},WPGMZA.ThemePanel.previewImageCenter={lat:33.701806462148646,lng:-118.15949896058983},WPGMZA.ThemePanel.previewImageZoom=11,WPGMZA.ThemePanel.prototype.onThemePresetClick=function(event){var selectedData=$(event.currentTarget).find("[data-theme-json]").attr("data-theme-json"),textarea=$(this.element).find("textarea[name='wpgmza_theme_data']"),existingData=textarea.val(),allPresetData=[];$(this.element).find("[data-theme-json]").each(function(index,el){allPresetData.push($(el).attr("data-theme-json"))}),existingData.length&&-1==allPresetData.indexOf(existingData)&&!confirm(WPGMZA.localized_strings.overwrite_theme_data)||(textarea.val(selectedData),this.updateMapTheme(),WPGMZA.themeEditor.parse())},WPGMZA.ThemePanel.prototype.updateMapTheme=function(){var data;try{data=JSON.parse($("textarea[name='wpgmza_theme_data']").val())}catch(e){return void alert(WPGMZA.localized_strings.invalid_theme_data)}this.map.setOptions({styles:data})}}),jQuery(function($){WPGMZA.Version=function(){},WPGMZA.Version.GREATER_THAN=1,WPGMZA.Version.EQUAL_TO=0,WPGMZA.Version.LESS_THAN=-1,WPGMZA.Version.compare=function(v1,v2){for(var v1parts=v1.match(/\d+/g),v2parts=v2.match(/\d+/g),i=0;i<v1parts.length;++i){if(v2parts.length===i)return 1;if(v1parts[i]!==v2parts[i])return v1parts[i]>v2parts[i]?1:-1}return v1parts.length!=v2parts.length?-1:0}}),jQuery(function($){WPGMZA.XMLCacheConverter=function(){},WPGMZA.XMLCacheConverter.prototype.convert=function(xml){var markers=[],remap={marker_id:"id",linkd:"link"};return $(xml).find("marker").each(function(index,el){var data={};$(el).children().each(function(j,child){var key=child.nodeName;remap[key]&&(key=remap[key]),child.hasAttribute("data-json")?data[key]=JSON.parse($(child).text()):data[key]=$(child).text()}),markers.push(data)}),markers}}),jQuery(function($){WPGMZA.loadXMLAsWebWorker=function(){function tXml(a,d){function c(){for(var l=[];a[b];){if(60==a.charCodeAt(b)){if(47===a.charCodeAt(b+1)){b=a.indexOf(">",b);break}if(33===a.charCodeAt(b+1)){if(45==a.charCodeAt(b+2)){for(;62!==a.charCodeAt(b)||45!=a.charCodeAt(b-1)||45!=a.charCodeAt(b-2)||-1==b;)b=a.indexOf(">",b+1);-1===b&&(b=a.length)}else for(b+=2;62!==a.charCodeAt(b);)b++;b++;continue}var c=f();l.push(c)}else c=b,-2===(b=a.indexOf("<",b)-1)&&(b=a.length),0<(c=a.slice(c,b+1)).trim().length&&l.push(c);b++}return l}function l(){for(var c=b;-1===g.indexOf(a[b]);)b++;return a.slice(c,b)}function f(){var d={};b++,d.tagName=l();for(var f=!1;62!==a.charCodeAt(b);){if(64<(e=a.charCodeAt(b))&&e<91||96<e&&e<123){for(var g=l(),e=a.charCodeAt(b);39!==e&&34!==e&&!(64<e&&e<91||96<e&&e<123)&&62!==e;)b++,e=a.charCodeAt(b);if(f||(d.attributes={},f=!0),39===e||34===e){e=a[b];var h=++b;b=a.indexOf(e,h),e=a.slice(h,b)}else e=null,b--;d.attributes[g]=e}b++}return 47!==a.charCodeAt(b-1)&&("script"==d.tagName?(f=b+1,b=a.indexOf("<\/script>",b),d.children=[a.slice(f,b-1)],b+=8):"style"==d.tagName?(f=b+1,b=a.indexOf("</style>",b),d.children=[a.slice(f,b-1)],b+=7):-1==k.indexOf(d.tagName)&&(b++,d.children=c())),d}var g="\n\t>/= ",k=["img","br","input","meta","link"],h=null;if((d=d||{}).searchId){var b=new RegExp("s*ids*=s*['\"]"+d.searchId+"['\"]").exec(a).index;return-1!==b&&(-1!==(b=a.lastIndexOf("<",b))&&(h=f())),b}return b=0,h=c(),d.filter&&(h=tXml.filter(h,d.filter)),d.simplify&&(h=tXml.simplefy(h)),h}tXml.simplify=function(a){var d={};if(1===a.length&&"string"==typeof a[0])return a[0];for(var c in a.forEach(function(a){if(d[a.tagName]||(d[a.tagName]=[]),"object"==typeof a){var c=tXml.simplefy(a.children);d[a.tagName].push(c),a.attributes&&(c._attributes=a.attributes)}else d[a.tagName].push(a)}),d)1==d[c].length&&(d[c]=d[c][0]);return d},tXml.filter=function(a,d){var c=[];return a.forEach(function(a){"object"==typeof a&&d(a)&&c.push(a),a.children&&(a=tXml.filter(a.children,d),c=c.concat(a))}),c},tXml.domToXml=function(a){var c="";return function d(a){if(a)for(var f=0;f<a.length;f++)if("string"==typeof a[f])c+=a[f].trim();else{var g=a[f];c+="<"+g.tagName;var k=void 0;for(k in g.attributes)c=-1===g.attributes[k].indexOf('"')?c+(" "+k+'="'+g.attributes[k].trim())+'"':c+(" "+k+"='"+g.attributes[k].trim())+"'";c+=">",d(g.children),c+="</"+g.tagName+">"}}(O),c},"object"!=typeof window&&(module.exports=tXml);var inputData,totalFiles,worker=self,dataForMainThread=[],filesLoaded=0;function onXMLLoaded(request){if(4==request.readyState&&200==request.status){(new Date).getTime();!function(xml){for(var markers=xml[0].children[0],remap={marker_id:"id",linkd:"link"},i=0;i<markers.children.length;i++){var data={};markers.children[i].children.forEach(function(node){var key=node.tagName;remap[key]&&(key=remap[key]),node.attributes["data-json"]?data[key]=JSON.parse(node.children[0]):node.children.length?data[key]=node.children[0]:data[key]=""}),dataForMainThread.push(data)}}(tXml(request.responseText)),++filesLoaded>=totalFiles?worker.postMessage(dataForMainThread):loadNextFile()}}function loadNextFile(){var url=inputData.urls[filesLoaded],request=new XMLHttpRequest;request.onreadystatechange=function(){onXMLLoaded(this)},request.open("GET",inputData.protocol+url,!0),request.send()}self.addEventListener("message",function(event){var data=event.data;switch(data.command){case"load":dataForMainThread=[],filesLoaded=0,totalFiles=(inputData=data).urls.length,loadNextFile();break;default:throw new Error("Unknown command")}},!1)}}),jQuery(function($){$(document).ready(function(event){var parent=document.body.onclick;parent&&(document.body.onclick=function(event){event.target instanceof WPGMZA.Marker||parent(event)})})}),jQuery(function($){WPGMZA.GoogleUICompatibility=function(){if(!(navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"))){var style=$("<style id='wpgmza-google-ui-compatiblity-fix'/>");style.html(".wpgmza_map img:not(button img) { padding:0 !important; }"),$(document.head).append(style)}},WPGMZA.googleUICompatibility=new WPGMZA.GoogleUICompatibility}),jQuery(function($){WPGMZA.DataTable=function(element){var self=this;if(!$.fn.dataTable)return console.warn("The dataTables library is not loaded. Cannot create a dataTable. Did you enable 'Do not enqueue dataTables'?"),void(WPGMZA.settings.wpgmza_do_not_enqueue_datatables&&WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_EDIT&&alert("You have selected 'Do not enqueue DataTables' in WP Google Maps' settings. No 3rd party software is loading the DataTables library. Because of this, the marker table cannot load. Please uncheck this option to use the marker table."));if($.fn.dataTable.ext)$.fn.dataTable.ext.errMode="throw";else{var version=$.fn.dataTable.version?$.fn.dataTable.version:"unknown";console.warn("You appear to be running an outdated or modified version of the dataTables library. This may cause issues with table functionality. This is usually caused by 3rd party software loading an older version of DataTables. The loaded version is "+version+", we recommend version 1.10.12 or above.")}$.fn.dataTable.Api&&$.fn.dataTable.Api.register("processing()",function(show){return this.iterator("table",function(ctx){ctx.oApi._fnProcessingDisplay(ctx,show)})}),this.element=element,(this.element.wpgmzaDataTable=this).dataTableElement=this.getDataTableElement();var settings=this.getDataTableSettings();this.phpClass=$(element).attr("data-wpgmza-php-class"),(this.wpgmzaDataTable=this).useCompressedPathVariable=WPGMZA.restAPI.isCompressedPathVariableSupported&&WPGMZA.settings.enable_compressed_path_variables,this.method=this.useCompressedPathVariable?"GET":"POST",null==this.getLanguageURL()||"//cdn.datatables.net/plug-ins/1.10.12/i18n/English.json"==this.getLanguageURL()?(this.dataTable=$(this.dataTableElement).DataTable(settings),this.dataTable.ajax.reload()):$.ajax(this.getLanguageURL(),{success:function(response,status,xhr){self.languageJSON=response,self.dataTable=$(self.dataTableElement).DataTable(settings),self.dataTable.ajax.reload()}})},WPGMZA.DataTable.prototype.getDataTableElement=function(){return $(this.element).find("table")},WPGMZA.DataTable.prototype.onAJAXRequest=function(data,settings){var params={phpClass:this.phpClass},attr=$(this.element).attr("data-wpgmza-ajax-parameters");return attr&&$.extend(params,JSON.parse(attr)),$.extend(data,params)},WPGMZA.DataTable.prototype.onDataTableAjaxRequest=function(data,callback,settings){var self=this,element=this.element,route=$(element).attr("data-wpgmza-rest-api-route"),params=this.onAJAXRequest(data,settings),draw=params.draw;if(delete params.draw,!route)throw new Error("No data-wpgmza-rest-api-route attribute specified");var options={method:"POST",useCompressedPathVariable:!0,data:params,dataType:"json",cache:!this.preventCaching,beforeSend:function(xhr){xhr.setRequestHeader("X-DataTables-Draw",draw)},success:function(response,status,xhr){response.draw=draw,self.lastResponse=response,callback(response),$("[data-marker-icon-src]").each(function(index,element){WPGMZA.MarkerIcon.createInstance($(element).attr("data-marker-icon-src")).applyToElement(element)})}};return WPGMZA.restAPI.call(route,options)},WPGMZA.DataTable.prototype.getDataTableSettings=function(){var self=this,element=this.element,options={};$(element).attr("data-wpgmza-datatable-options")&&(options=JSON.parse($(element).attr("data-wpgmza-datatable-options"))),options.deferLoading=!0,options.processing=!0,options.serverSide=!0,options.ajax=function(data,callback,settings){return WPGMZA.DataTable.prototype.onDataTableAjaxRequest.apply(self,arguments)},WPGMZA.AdvancedTableDataTable&&this instanceof WPGMZA.AdvancedTableDataTable&&WPGMZA.settings.wpgmza_default_items&&(options.iDisplayLength=parseInt(WPGMZA.settings.wpgmza_default_items)),options.aLengthMenu=[[5,10,25,50,100,-1],["5","10","25","50","100",WPGMZA.localized_strings.all]];var languageURL=this.getLanguageURL();return languageURL&&(options.language={url:languageURL}),options},WPGMZA.DataTable.prototype.getLanguageURL=function(){if(!WPGMZA.locale)return null;var languageURL;switch(WPGMZA.locale.substr(0,2)){case"af":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Afrikaans.json";break;case"sq":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Albanian.json";break;case"am":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Amharic.json";break;case"ar":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Arabic.json";break;case"hy":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Armenian.json";break;case"az":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Azerbaijan.json";break;case"bn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Bangla.json";break;case"eu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Basque.json";break;case"be":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Belarusian.json";break;case"bg":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Bulgarian.json";break;case"ca":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Catalan.json";break;case"zh":languageURL="zh_TW"==WPGMZA.locale?WPGMZA.pluginDirURL+"languages/datatables/Chinese-traditional.json":"//cdn.datatables.net/plug-ins/1.10.12/i18n/Chinese.json";break;case"hr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Croatian.json";break;case"cs":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Czech.json";break;case"da":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Danish.json";break;case"nl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Dutch.json";break;case"et":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Estonian.json";break;case"fi":languageURL=WPGMZA.locale.match(/^fil/)?WPGMZA.pluginDirURL+"languages/datatables/Filipino.json":WPGMZA.pluginDirURL+"languages/datatables/Finnish.json";break;case"fr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/French.json";break;case"gl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Galician.json";break;case"ka":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Georgian.json";break;case"de":languageURL=WPGMZA.pluginDirURL+"languages/datatables/German.json";break;case"el":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Greek.json";break;case"gu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Gujarati.json";break;case"he":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hebrew.json";break;case"hi":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hindi.json";break;case"hu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hungarian.json";break;case"is":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Icelandic.json";break;case"id":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Indonesian.json";break;case"ga":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Irish.json";break;case"it":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Italian.json";break;case"ja":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Japanese.json";break;case"kk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Kazakh.json";break;case"ko":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Korean.json";break;case"ky":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Kyrgyz.json";break;case"lv":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Latvian.json";break;case"lt":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Lithuanian.json";break;case"mk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Macedonian.json";break;case"ml":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Malay.json";break;case"mn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Mongolian.json";break;case"ne":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Nepali.json";break;case"nb":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Norwegian-Bokmal.json";break;case"nn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Norwegian-Nynorsk.json";break;case"ps":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Pashto.json";break;case"fa":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Persian.json";break;case"pl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Polish.json";break;case"pt":languageURL="pt_BR"==WPGMZA.locale?WPGMZA.pluginDirURL+"languages/datatables/Portuguese-Brasil.json":"//cdn.datatables.net/plug-ins/1.10.12/i18n/Portuguese.json";break;case"ro":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Romanian.json";break;case"ru":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Russian.json";break;case"sr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Serbian.json";break;case"si":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Sinhala.json";break;case"sk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Slovak.json";break;case"sl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Slovenian.json";break;case"es":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Spanish.json";break;case"sw":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Swahili.json";break;case"sv":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Swedish.json";break;case"ta":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Tamil.json";break;case"te":languageURL=WPGMZA.pluginDirURL+"languages/datatables/telugu.json";break;case"th":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Thai.json";break;case"tr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Turkish.json";break;case"uk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Ukrainian.json";break;case"ur":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Urdu.json";break;case"uz":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Uzbek.json";break;case"vi":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Vietnamese.json";break;case"cy":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Welsh.json"}return languageURL},WPGMZA.DataTable.prototype.onAJAXResponse=function(response){},WPGMZA.DataTable.prototype.reload=function(){this.dataTable.ajax.reload(null,!1)}}),jQuery(function($){WPGMZA.AdminFeatureDataTable=function(element){var self=this;this.allSelected=!1,WPGMZA.DataTable.call(this,element),$(element).on("click",".wpgmza.bulk_delete",function(event){self.onBulkDelete(event)}),$(element).on("click",".wpgmza.select_all_markers",function(event){self.onSelectAll(event)}),$(element).on("click","[data-center-marker-id]",function(event){self.onCenterMarker(event)})},WPGMZA.extend(WPGMZA.AdminFeatureDataTable,WPGMZA.DataTable),Object.defineProperty(WPGMZA.AdminFeatureDataTable.prototype,"featureType",{get:function(){return $(this.element).attr("data-wpgmza-feature-type")}}),Object.defineProperty(WPGMZA.AdminFeatureDataTable.prototype,"featurePanel",{get:function(){return WPGMZA.mapEditPage[this.featureType+"Panel"]}}),WPGMZA.AdminFeatureDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,index){var meta=self.lastResponse.meta[index];row.wpgmzaFeatureData=meta},options},WPGMZA.AdminFeatureDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[],map=WPGMZA.maps[0],plural=this.featureType+"s";$(this.element).find("input[name='mark']:checked").each(function(index,el){var row=$(el).closest("tr")[0];ids.push(row.wpgmzaFeatureData.id)}),ids.forEach(function(marker_id){var marker=map.getMarkerByID(marker_id);marker&&map.removeMarker(marker)}),WPGMZA.restAPI.call("/"+plural+"/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},WPGMZA.AdminFeatureDataTable.prototype.onSelectAll=function(event){this.allSelected=!this.allSelected;var self=this;$(this.element).find("input[name='mark']").each(function(){self.allSelected?$(this).prop("checked",!0):$(this).prop("checked",!1)})},WPGMZA.AdminFeatureDataTable.prototype.onCenterMarker=function(event){var id;id=null==event.currentTarget?event:$(event.currentTarget).attr("data-center-marker-id");var marker=WPGMZA.mapEditPage.map.getMarkerByID(id);if(marker){var latLng=new WPGMZA.LatLng({lat:marker.lat,lng:marker.lng});WPGMZA.mapEditPage.map.setCenter(latLng),WPGMZA.animateScroll("#wpgmaps_tabs_markers")}}}),jQuery(function($){WPGMZA.AdminMapDataTable=function(element){var self=this;WPGMZA.DataTable.call(this,element),$(element).on("mousedown","button[data-action='edit']",function(event){switch(event.which){case 1:var map_id=$(event.target).attr("data-map-id");window.location.href=window.location.href+"&action=edit&map_id="+map_id;break;case 2:map_id=$(event.target).attr("data-map-id");window.open(window.location.href+"&action=edit&map_id="+map_id)}}),$(element).find(".wpgmza.select_all_maps").on("click",function(event){self.onSelectAll(event)}),$(element).find(".wpgmza.bulk_delete_maps").on("click",function(event){self.onBulkDelete(event)}),$(element).on("click","button[data-action='duplicate']",function(event){var map_id=$(event.target).attr("data-map-id");WPGMZA.restAPI.call("/maps/",{method:"POST",data:{id:map_id,action:"duplicate"},success:function(response,status,xhr){self.reload()}})}),$(element).on("click","button[data-action='trash']",function(event){if(confirm(WPGMZA.localized_strings.map_delete_prompt_text)){var map_id=$(event.target).attr("data-map-id");WPGMZA.restAPI.call("/maps/",{method:"DELETE",data:{id:map_id},success:function(response,status,xhr){self.reload()}})}})},WPGMZA.extend(WPGMZA.AdminMapDataTable,WPGMZA.DataTable),WPGMZA.AdminMapDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,index){var meta=self.lastResponse.meta[index];row.wpgmzaMapData=meta},options},WPGMZA.AdminMapDataTable.prototype.onSelectAll=function(event){$(this.element).find("input[name='mark']").prop("checked",!0)},WPGMZA.AdminMapDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[];$(this.element).find("input[name='mark']:checked").each(function(index,el){var row=$(el).closest("tr")[0];ids.push(row.wpgmzaMapData.id)}),confirm(WPGMZA.localized_strings.map_bulk_delete_prompt_text)&&WPGMZA.restAPI.call("/maps/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},$(document).ready(function(event){$("[data-wpgmza-admin-map-datatable]").each(function(index,el){WPGMZA.AdminMapDataTable=new WPGMZA.AdminMapDataTable(el)})})}),jQuery(function($){WPGMZA.AdminMarkerDataTable=function(element){var self=this;this.preventCaching=!0,WPGMZA.DataTable.call(this,element),$(element).on("click","[data-delete-marker-id]",function(event){self.onDeleteMarker(event)}),$(element).find(".wpgmza.select_all_markers").on("click",function(event){self.onSelectAll(event)}),$(element).find(".wpgmza.bulk_delete").on("click",function(event){self.onBulkDelete(event)}),$(element).on("click","[data-center-marker-id]",function(event){self.onCenterMarker(event)})},WPGMZA.AdminMarkerDataTable.prototype=Object.create(WPGMZA.DataTable.prototype),WPGMZA.AdminMarkerDataTable.prototype.constructor=WPGMZA.AdminMarkerDataTable,WPGMZA.AdminMarkerDataTable.createInstance=function(element){return new WPGMZA.AdminMarkerDataTable(element)},WPGMZA.AdminMarkerDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,index){var meta=self.lastResponse.meta[index];row.wpgmzaMarkerData=meta},options},WPGMZA.AdminMarkerDataTable.prototype.onEditMarker=function(event){WPGMZA.animatedScroll("#wpgmaps_tabs_markers")},WPGMZA.AdminMarkerDataTable.prototype.onDeleteMarker=function(event){var self=this,id=$(event.currentTarget).attr("data-delete-marker-id"),data={action:"delete_marker",security:WPGMZA.legacyajaxnonce,map_id:WPGMZA.mapEditPage.map.id,marker_id:id};$.post(ajaxurl,data,function(response){WPGMZA.mapEditPage.map.removeMarkerByID(id),self.reload()})},WPGMZA.AdminMarkerDataTable.prototype.onApproveMarker=function(event){var cur_id=$(this).attr("id"),data={action:"approve_marker",security:WPGMZA.legacyajaxnonce,map_id:WPGMZA.mapEditPage.map.id,marker_id:cur_id};$.post(ajaxurl,data,function(response){wpgmza_InitMap(),wpgmza_reinitialisetbl()})},WPGMZA.AdminMarkerDataTable.prototype.onSelectAll=function(event){$(this.element).find("input[name='mark']").prop("checked",!0)},WPGMZA.AdminMarkerDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[],map=WPGMZA.maps[0];$(this.element).find("input[name='mark']:checked").each(function(index,el){var row=$(el).closest("tr")[0];ids.push(row.wpgmzaMarkerData.id)}),ids.forEach(function(marker_id){var marker=map.getMarkerByID(marker_id);marker&&map.removeMarker(marker)}),WPGMZA.restAPI.call("/markers/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},WPGMZA.AdminMarkerDataTable.prototype.onCenterMarker=function(event){var id;id=null==event.currentTarget?event:$(event.currentTarget).attr("data-center-marker-id");var marker=WPGMZA.mapEditPage.map.getMarkerByID(id);if(marker){var latLng=new WPGMZA.LatLng({lat:marker.lat,lng:marker.lng});WPGMZA.mapEditPage.map.setCenter(latLng),WPGMZA.mapEditPage.map.setZoom(6),WPGMZA.animateScroll("#wpgmaps_tabs_markers")}}}),jQuery(function($){WPGMZA.Integration={},WPGMZA.integrationModules={}}),jQuery(function($){if(window.wp&&wp.i18n&&wp.blocks&&wp.editor&&wp.components){var __=wp.i18n.__,registerBlockType=wp.blocks.registerBlockType,_wp$editor=wp.editor,InspectorControls=_wp$editor.InspectorControls,_wp$components=(_wp$editor.BlockControls,wp.components),Dashicon=_wp$components.Dashicon,PanelBody=(_wp$components.Toolbar,_wp$components.Button,_wp$components.Tooltip,_wp$components.PanelBody);_wp$components.TextareaControl,_wp$components.CheckboxControl,_wp$components.TextControl,_wp$components.SelectControl,_wp$components.RichText;WPGMZA.Integration.Gutenberg=function(){registerBlockType("gutenberg-wpgmza/block",this.getBlockDefinition())},WPGMZA.Integration.Gutenberg.prototype.getBlockTitle=function(){return __("WP Google Maps")},WPGMZA.Integration.Gutenberg.prototype.getBlockInspectorControls=function(props){return React.createElement(InspectorControls,{key:"inspector"},React.createElement(PanelBody,{title:__("Map Settings")},React.createElement("p",{class:"map-block-gutenberg-button-container"},React.createElement("a",{href:WPGMZA.adminurl+"admin.php?page=wp-google-maps-menu&action=edit&map_id=1",target:"_blank",class:"button button-primary"},React.createElement("i",{class:"fa fa-pencil-square-o","aria-hidden":"true"}),__("Go to Map Editor"))),React.createElement("p",{class:"map-block-gutenberg-button-container"},React.createElement("a",{href:"https://www.wpgmaps.com/documentation/creating-your-first-map/",target:"_blank",class:"button button-primary"},React.createElement("i",{class:"fa fa-book","aria-hidden":"true"}),__("View Documentation")))))},WPGMZA.Integration.Gutenberg.prototype.getBlockAttributes=function(){return{}},WPGMZA.Integration.Gutenberg.prototype.getBlockDefinition=function(props){var _this=this;return{title:__("WP Google Maps"),description:__("The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss."),category:"common",icon:"location-alt",keywords:[__("Map"),__("Maps"),__("Google")],attributes:this.getBlockAttributes(),edit:function(props){return[!!props.isSelected&&_this.getBlockInspectorControls(props),React.createElement("div",{className:props.className+" wpgmza-gutenberg-block"},React.createElement(Dashicon,{icon:"location-alt"}),React.createElement("span",{class:"wpgmza-gutenberg-block-title"},__("Your map will appear here on your websites front end")))]},save:function(){return null}}},WPGMZA.Integration.Gutenberg.getConstructor=function(){return WPGMZA.Integration.Gutenberg},WPGMZA.Integration.Gutenberg.createInstance=function(){return new(WPGMZA.Integration.Gutenberg.getConstructor())},WPGMZA.isProVersion()||/^6/.test(WPGMZA.pro_version)||(WPGMZA.integrationModules.gutenberg=WPGMZA.Integration.Gutenberg.createInstance())}}),jQuery(function($){var Parent=WPGMZA.Circle;WPGMZA.OLCircle=function(options,olFeature){var geom;if(Parent.call(this,options,olFeature),options=options||{},olFeature){var circle=olFeature.getGeometry(),center=ol.proj.toLonLat(circle.getCenter());geom=circle,options.center=new WPGMZA.LatLng(center[1],center[0]),options.radius=circle.getRadius()/1e3}else geom=new ol.geom.Circle(ol.proj.fromLonLat([parseFloat(options.center.lng),parseFloat(options.center.lat)]),1e3*options.radius);this.layer=new ol.layer.Vector({source:new ol.source.Vector}),this.olFeature=new ol.Feature({geometry:geom}),this.layer.getSource().addFeature(this.olFeature),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaCircle:this,wpgmzaFeature:this}),options&&this.setOptions(options)},WPGMZA.OLCircle.prototype=Object.create(Parent.prototype),WPGMZA.OLCircle.prototype.constructor=WPGMZA.OLCircle,WPGMZA.OLCircle.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)},WPGMZA.OLCircle.prototype.getCenter=function(){var lonLat=ol.proj.toLonLat(this.olFeature.getGeometry().getCenter());return new WPGMZA.LatLng({lat:lonLat[1],lng:lonLat[0]})},WPGMZA.OLCircle.prototype.recreate=function(){if(this.olFeature&&(this.layer.getSource().removeFeature(this.olFeature),delete this.olFeature),this.center&&this.radius){var x,y,radius=1e3*parseFloat(this.radius);x=this.center.lng,y=this.center.lat;var circle3857=ol.geom.Polygon.circular([x,y],radius,64).clone().transform("EPSG:4326","EPSG:3857");this.olFeature=new ol.Feature(circle3857),this.layer.getSource().addFeature(this.olFeature)}},WPGMZA.OLCircle.prototype.setVisible=function(visible){this.layer.setVisible(!!visible)},WPGMZA.OLCircle.prototype.setCenter=function(center){WPGMZA.Circle.prototype.setCenter.apply(this,arguments),this.recreate()},WPGMZA.OLCircle.prototype.getRadius=function(){return this.layer.getSource().getFeatures()[0].getGeometry().getRadius()/1e3},WPGMZA.OLCircle.prototype.setRadius=function(radius){WPGMZA.Circle.prototype.setRadius.apply(this,arguments)},WPGMZA.OLCircle.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){WPGMZA.OLDrawingManager=function(map){WPGMZA.DrawingManager.call(this,map),this.source=new ol.source.Vector({wrapX:!1}),this.layer=new ol.layer.Vector({source:this.source})},WPGMZA.OLDrawingManager.prototype=Object.create(WPGMZA.DrawingManager.prototype),WPGMZA.OLDrawingManager.prototype.constructor=WPGMZA.OLDrawingManager,WPGMZA.OLDrawingManager.prototype.setOptions=function(options){var params={};options.strokeOpacity&&(params.stroke=new ol.style.Stroke({color:WPGMZA.hexOpacityToRGBA(options.strokeColor,options.strokeOpacity)})),options.fillOpacity&&(params.fill=new ol.style.Fill({color:WPGMZA.hexOpacityToRGBA(options.fillColor,options.fillOpacity)})),this.layer.setStyle(new ol.style.Style(params))},WPGMZA.OLDrawingManager.prototype.setDrawingMode=function(mode){var type,endEventType,self=this;switch(WPGMZA.DrawingManager.prototype.setDrawingMode.call(this,mode),this.interaction&&(this.map.olMap.removeInteraction(this.interaction),this.interaction=null),mode){case WPGMZA.DrawingManager.MODE_NONE:case WPGMZA.DrawingManager.MODE_MARKER:return;case WPGMZA.DrawingManager.MODE_POLYGON:type="Polygon",endEventType="polygonclosed";break;case WPGMZA.DrawingManager.MODE_POLYLINE:type="LineString",endEventType="polylinecomplete";break;case WPGMZA.DrawingManager.MODE_CIRCLE:type="Circle",endEventType="circlecomplete";break;case WPGMZA.DrawingManager.MODE_RECTANGLE:type="Circle",endEventType="rectanglecomplete";break;case WPGMZA.DrawingManager.MODE_HEATMAP:return;default:throw new Error("Invalid drawing mode")}WPGMZA.mapEditPage&&WPGMZA.mapEditPage.selectInteraction&&WPGMZA.mapEditPage.map.olMap.removeInteraction(WPGMZA.mapEditPage.selectInteraction);var options={source:this.source,type:type};mode==WPGMZA.DrawingManager.MODE_RECTANGLE&&(options.geometryFunction=ol.interaction.Draw.createBox()),this.interaction=new ol.interaction.Draw(options),this.interaction.on("drawend",function(event){if(endEventType){var WPGMZAEvent=new WPGMZA.Event(endEventType);switch(mode){case WPGMZA.DrawingManager.MODE_POLYGON:WPGMZAEvent.enginePolygon=event.feature;break;case WPGMZA.DrawingManager.MODE_POLYLINE:WPGMZAEvent.enginePolyline=event.feature;break;case WPGMZA.DrawingManager.MODE_CIRCLE:WPGMZAEvent.engineCircle=event.feature;break;case WPGMZA.DrawingManager.MODE_RECTANGLE:WPGMZAEvent.engineRectangle=event.feature;break;default:throw new Error("Drawing mode not implemented")}self.dispatchEvent(WPGMZAEvent)}}),this.map.olMap.addInteraction(this.interaction)}}),jQuery(function($){WPGMZA.OLFeature=function(options){WPGMZA.assertInstangeOf(this,"OLFeature"),WPGMZA.Feature.apply(this,arguments)},WPGMZA.extend(WPGMZA.OLFeature,WPGMZA.Feature),WPGMZA.OLFeature.getOLStyle=function(options){var translated={};if(!options)return new ol.style.Style;options=$.extend({},options);var map={fillcolor:"fillColor",opacity:"fillOpacity",linecolor:"strokeColor",lineopacity:"strokeOpacity",linethickness:"strokeWeight"};for(var name in options)name in map&&(options[map[name]]=options[name]);if(options.strokeColor){var opacity=1,weight=1;"strokeOpacity"in options&&(opacity=options.strokeOpacity),"strokeWeight"in options&&(weight=options.strokeWeight),translated.stroke=new ol.style.Stroke({color:WPGMZA.hexOpacityToString(options.strokeColor,opacity),width:weight})}if(options.fillColor){opacity=1;"fillOpacity"in options&&(opacity=options.fillOpacity);var color=WPGMZA.hexOpacityToString(options.fillColor,opacity);translated.fill=new ol.style.Fill({color:color})}return new ol.style.Style(translated)},WPGMZA.OLFeature.setInteractionsOnFeature=function(feature,enable){if(enable){if(feature.modifyInteraction)return;feature.snapInteraction=new ol.interaction.Snap({source:feature.layer.getSource()}),feature.map.olMap.addInteraction(feature.snapInteraction),feature.modifyInteraction=new ol.interaction.Modify({source:feature.layer.getSource()}),feature.map.olMap.addInteraction(feature.modifyInteraction),feature.modifyInteraction.on("modifyend",function(event){feature.trigger("change")})}else{if(!feature.modifyInteraction)return;feature.map&&(feature.map.olMap.removeInteraction(feature.snapInteraction),feature.map.olMap.removeInteraction(feature.modifyInteraction)),delete feature.snapInteraction,delete feature.modifyInteraction}}}),jQuery(function($){WPGMZA.OLGeocoder=function(){},WPGMZA.OLGeocoder.prototype=Object.create(WPGMZA.Geocoder.prototype),WPGMZA.OLGeocoder.prototype.constructor=WPGMZA.OLGeocoder,WPGMZA.OLGeocoder.prototype.getResponseFromCache=function(query,callback){WPGMZA.restAPI.call("/geocode-cache",{data:{query:JSON.stringify(query)},success:function(response,xhr,status){response.lng=response.lon,callback(response)},useCompressedPathVariable:!0})},WPGMZA.OLGeocoder.prototype.getResponseFromNominatim=function(options,callback){var data={q:options.address,format:"json"};options.componentRestrictions&&options.componentRestrictions.country?data.countrycodes=options.componentRestrictions.country:options.country&&(data.countrycodes=options.country),$.ajax("https://nominatim.openstreetmap.org/search/",{data:data,success:function(response,xhr,status){callback(response)},error:function(response,xhr,status){callback(null,WPGMZA.Geocoder.FAIL)}})},WPGMZA.OLGeocoder.prototype.cacheResponse=function(query,response){$.ajax(WPGMZA.ajaxurl,{data:{action:"wpgmza_store_nominatim_cache",query:JSON.stringify(query),response:JSON.stringify(response)},method:"POST"})},WPGMZA.OLGeocoder.prototype.clearCache=function(callback){$.ajax(WPGMZA.ajaxurl,{data:{action:"wpgmza_clear_nominatim_cache"},method:"POST",success:function(response){callback(response)}})},WPGMZA.OLGeocoder.prototype.getLatLngFromAddress=function(options,callback){return WPGMZA.OLGeocoder.prototype.geocode(options,callback)},WPGMZA.OLGeocoder.prototype.getAddressFromLatLng=function(options,callback){return WPGMZA.OLGeocoder.prototype.geocode(options,callback)},WPGMZA.OLGeocoder.prototype.geocode=function(options,callback){var self=this;if(!options)throw new Error("Invalid options");if(WPGMZA.LatLng.REGEXP.test(options.address)){var latLng=WPGMZA.LatLng.fromString(options.address);callback([{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng}],WPGMZA.Geocoder.SUCCESS)}else{var finish,location;if(options.location&&(options.latLng=new WPGMZA.LatLng(options.location)),options.address)location=options.address,finish=function(response,status){for(var i=0;i<response.length;i++)response[i].geometry={location:new WPGMZA.LatLng({lat:parseFloat(response[i].lat),lng:parseFloat(response[i].lon)})},response[i].latLng={lat:parseFloat(response[i].lat),lng:parseFloat(response[i].lon)},response[i].bounds=new WPGMZA.LatLngBounds(new WPGMZA.LatLng({lat:response[i].boundingbox[1],lng:response[i].boundingbox[2]}),new WPGMZA.LatLng({lat:response[i].boundingbox[0],lng:response[i].boundingbox[3]})),response[i].lng=response[i].lon;callback(response,status)};else{if(!options.latLng)throw new Error("You must supply either a latLng or address");location=options.latLng.toString(),finish=function(response,status){var address=response[0].display_name;callback([address],status)}}var query={location:location,options:options};this.getResponseFromCache(query,function(response){response.length?finish(response,WPGMZA.Geocoder.SUCCESS):self.getResponseFromNominatim($.extend(options,{address:location}),function(response,status){status!=WPGMZA.Geocoder.FAIL?0!=response.length?(finish(response,WPGMZA.Geocoder.SUCCESS),self.cacheResponse(query,response)):callback([],WPGMZA.Geocoder.ZERO_RESULTS):callback(null,WPGMZA.Geocoder.FAIL)})})}}}),jQuery(function($){var Parent;WPGMZA.OLInfoWindow=function(feature){var self=this;Parent.call(this,feature),this.element=$("<div class='wpgmza-infowindow ol-info-window-container ol-info-window-plain'></div>")[0],$(this.element).on("click",".ol-info-window-close",function(event){self.close()})},Parent=WPGMZA.isProVersion()?WPGMZA.ProInfoWindow:WPGMZA.InfoWindow,WPGMZA.OLInfoWindow.prototype=Object.create(Parent.prototype),WPGMZA.OLInfoWindow.prototype.constructor=WPGMZA.OLInfoWindow,Object.defineProperty(WPGMZA.OLInfoWindow.prototype,"isPanIntoViewAllowed",{get:function(){return!0}}),WPGMZA.OLInfoWindow.prototype.open=function(map,feature){var self=this,latLng=feature.getPosition();if(!Parent.prototype.open.call(this,map,feature))return!1;this.parent=map,this.overlay&&this.feature.map.olMap.removeOverlay(this.overlay),this.overlay=new ol.Overlay({element:this.element,stopEvent:!0,insertFirst:!0}),this.overlay.setPosition(ol.proj.fromLonLat([latLng.lng,latLng.lat])),self.feature.map.olMap.addOverlay(this.overlay),$(this.element).show(),this.setContent(this.content),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&WPGMZA.getImageDimensions(feature.getIcon(),function(size){$(self.element).css({left:Math.round(size.width/2)+"px"})}),this.trigger("infowindowopen"),this.trigger("domready")},WPGMZA.OLInfoWindow.prototype.close=function(event){$(this.element).hide(),this.overlay&&(WPGMZA.InfoWindow.prototype.close.call(this),this.trigger("infowindowclose"),this.feature.map.olMap.removeOverlay(this.overlay),this.overlay=null)},WPGMZA.OLInfoWindow.prototype.setContent=function(html){Parent.prototype.setContent.call(this,html),this.content=html;var eaBtn=WPGMZA.isProVersion()?"":this.addEditButton();$(this.element).html(eaBtn+"<i class='fa fa-times ol-info-window-close' aria-hidden='true'></i>"+html)},WPGMZA.OLInfoWindow.prototype.setOptions=function(options){options.maxWidth&&$(this.element).css({"max-width":options.maxWidth+"px"})},WPGMZA.OLInfoWindow.prototype.onOpen=function(){var self=this,imgs=$(this.element).find("img"),numImages=imgs.length,numImagesLoaded=0;if(WPGMZA.InfoWindow.prototype.onOpen.apply(this,arguments),this.isPanIntoViewAllowed){function inside(el,viewport){var a=$(el)[0].getBoundingClientRect(),b=$(viewport)[0].getBoundingClientRect();return a.left>=b.left&&a.left<=b.right&&a.right<=b.right&&a.right>=b.left&&a.top>=b.top&&a.top<=b.bottom&&a.bottom<=b.bottom&&a.bottom>=b.top}function panIntoView(){var offset=.45*-$(self.element).height();self.feature.map.animateNudge(0,offset,self.feature.getPosition())}imgs.each(function(index,el){el.onload=function(){++numImagesLoaded!=numImages||inside(self.element,self.feature.map.element)||panIntoView()}}),0!=numImages||inside(self.element,self.feature.map.element)||panIntoView()}}}),jQuery(function($){var Parent;WPGMZA.OLMap=function(element,options){var self=this;Parent.call(this,element),this.setOptions(options);var viewOptions=this.settings.toOLViewOptions();function isSettingDisabled(value){return"yes"===value||!!value}$(this.element).html(""),this.olMap=new ol.Map({target:$(element)[0],layers:[this.getTileLayer()],view:new ol.View(viewOptions)}),this.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan?interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_draggable)):interaction instanceof ol.interaction.DoubleClickZoom?interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_clickzoom)):interaction instanceof ol.interaction.MouseWheelZoom&&interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_scroll))},this),"greedy"!=this.settings.wpgmza_force_greedy_gestures&&"yes"!=this.settings.wpgmza_force_greedy_gestures&&1!=this.settings.wpgmza_force_greedy_gestures&&(this.gestureOverlay=$("<div class='wpgmza-gesture-overlay'></div>"),this.gestureOverlayTimeoutID=null,WPGMZA.isTouchDevice()||(this.olMap.on("wheel",function(event){if(!ol.events.condition.platformModifierKeyOnly(event))return self.showGestureOverlay(),event.originalEvent.preventDefault(),!1}),this.gestureOverlay.text(WPGMZA.localized_strings.use_ctrl_scroll_to_zoom))),this.olMap.getControls().forEach(function(control){control instanceof ol.control.Zoom&&1==WPGMZA.settings.wpgmza_settings_map_zoom&&self.olMap.removeControl(control)},this),isSettingDisabled(WPGMZA.settings.wpgmza_settings_map_full_screen_control)||this.olMap.addControl(new ol.control.FullScreen),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&(this.markerLayer=new ol.layer.Vector({source:new ol.source.Vector({features:[]})}),this.olMap.addLayer(this.markerLayer),this.olMap.on("click",function(event){var features=self.olMap.getFeaturesAtPixel(event.pixel);if(features&&features.length){var marker=features[0].wpgmzaMarker;marker&&(marker.trigger("click"),marker.trigger("select"))}})),this.olMap.on("movestart",function(event){self.isBeingDragged=!0}),this.olMap.on("moveend",function(event){self.wrapLongitude(),self.isBeingDragged=!1,self.dispatchEvent("dragend"),self.onIdle()}),this.olMap.getView().on("change:resolution",function(event){self.dispatchEvent("zoom_changed"),self.dispatchEvent("zoomchanged"),setTimeout(function(){self.onIdle()},10)}),this.olMap.getView().on("change",function(){self.onBoundsChanged()}),self.onBoundsChanged(),this._mouseoverNativeFeatures=[],this.olMap.on("pointermove",function(event){if(!event.dragging){try{var featuresUnderPixel=event.target.getFeaturesAtPixel(event.pixel)}catch(e){return}featuresUnderPixel=featuresUnderPixel||[];var i,props,nativeFeaturesUnderPixel=[];for(i=0;i<featuresUnderPixel.length;i++)(props=featuresUnderPixel[i].getProperties()).wpgmzaFeature&&(nativeFeature=props.wpgmzaFeature,nativeFeaturesUnderPixel.push(nativeFeature),-1==self._mouseoverNativeFeatures.indexOf(nativeFeature)&&(nativeFeature.trigger("mouseover"),self._mouseoverNativeFeatures.push(nativeFeature)));for(i=self._mouseoverNativeFeatures.length-1;0<=i;i--)nativeFeature=self._mouseoverNativeFeatures[i],-1==nativeFeaturesUnderPixel.indexOf(nativeFeature)&&(nativeFeature.trigger("mouseout"),self._mouseoverNativeFeatures.splice(i,1))}}),$(this.element).on("click contextmenu",function(event){var isRight;event=event||window.event;var latLng=self.pixelsToLatLng(event.offsetX,event.offsetY);if("which"in event?isRight=3==event.which:"button"in event&&(isRight=2==event.button),1!=event.which&&1!=event.button){if(isRight)return self.onRightClick(event)}else{if(self.isBeingDragged)return;if($(event.target).closest(".ol-marker").length)return;try{var featuresUnderPixel=self.olMap.getFeaturesAtPixel([event.offsetX,event.offsetY])}catch(e){return}featuresUnderPixel=featuresUnderPixel||[];var i,props,nativeFeaturesUnderPixel=[];for(i=0;i<featuresUnderPixel.length;i++)(props=featuresUnderPixel[i].getProperties()).wpgmzaFeature&&(nativeFeature=props.wpgmzaFeature,nativeFeaturesUnderPixel.push(nativeFeature),nativeFeature.trigger("click"));self.trigger({type:"click",latLng:latLng})}}),WPGMZA.isProVersion()||(this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded"))},Parent=WPGMZA.isProVersion()?WPGMZA.ProMap:WPGMZA.Map,WPGMZA.OLMap.prototype=Object.create(Parent.prototype),WPGMZA.OLMap.prototype.constructor=WPGMZA.OLMap,WPGMZA.OLMap.prototype.getTileLayer=function(){var options={};return WPGMZA.settings.tile_server_url&&(options.url=WPGMZA.settings.tile_server_url,"custom_override"===WPGMZA.settings.tile_server_url&&(WPGMZA.settings.tile_server_url_override&&""!==WPGMZA.settings.tile_server_url_override.trim()?options.url=WPGMZA.settings.tile_server_url_override.trim():options.url="https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png"),WPGMZA.settings.open_layers_api_key&&""!==WPGMZA.settings.open_layers_api_key&&(options.url+="?apikey="+WPGMZA.settings.open_layers_api_key.trim())),new ol.layer.Tile({source:new ol.source.OSM(options)})},WPGMZA.OLMap.prototype.wrapLongitude=function(){var transformed=ol.proj.transform(this.olMap.getView().getCenter(),"EPSG:3857","EPSG:4326"),center={lat:transformed[1],lng:transformed[0]};-180<=center.lng&¢er.lng<=180||(center.lng=center.lng-360*Math.floor(center.lng/360),180<center.lng&&(center.lng-=360),this.setCenter(center))},WPGMZA.OLMap.prototype.getCenter=function(){var lonLat=ol.proj.toLonLat(this.olMap.getView().getCenter());return{lat:lonLat[1],lng:lonLat[0]}},WPGMZA.OLMap.prototype.setCenter=function(latLng){var view=this.olMap.getView();WPGMZA.Map.prototype.setCenter.call(this,latLng),view.setCenter(ol.proj.fromLonLat([latLng.lng,latLng.lat])),this.wrapLongitude(),this.onBoundsChanged()},WPGMZA.OLMap.prototype.getBounds=function(){var bounds=this.olMap.getView().calculateExtent(this.olMap.getSize()),nativeBounds=new WPGMZA.LatLngBounds,topLeft=ol.proj.toLonLat([bounds[0],bounds[1]]),bottomRight=ol.proj.toLonLat([bounds[2],bounds[3]]);return nativeBounds.north=topLeft[1],nativeBounds.south=bottomRight[1],nativeBounds.west=topLeft[0],nativeBounds.east=bottomRight[0],nativeBounds},WPGMZA.OLMap.prototype.fitBounds=function(southWest,northEast){if(southWest instanceof WPGMZA.LatLng&&(southWest={lat:southWest.lat,lng:southWest.lng}),northEast instanceof WPGMZA.LatLng)northEast={lat:northEast.lat,lng:northEast.lng};else if(southWest instanceof WPGMZA.LatLngBounds){var bounds=southWest;southWest={lat:bounds.south,lng:bounds.west},northEast={lat:bounds.north,lng:bounds.east}}var view=this.olMap.getView(),extent=ol.extent.boundingExtent([ol.proj.fromLonLat([parseFloat(southWest.lng),parseFloat(southWest.lat)]),ol.proj.fromLonLat([parseFloat(northEast.lng),parseFloat(northEast.lat)])]);view.fit(extent,this.olMap.getSize())},WPGMZA.OLMap.prototype.panTo=function(latLng,zoom){var view=this.olMap.getView(),options={center:ol.proj.fromLonLat([parseFloat(latLng.lng),parseFloat(latLng.lat)]),duration:500};1<arguments.length&&(options.zoom=parseInt(zoom)),view.animate(options)},WPGMZA.OLMap.prototype.getZoom=function(){return Math.round(this.olMap.getView().getZoom())},WPGMZA.OLMap.prototype.setZoom=function(value){this.olMap.getView().setZoom(value)},WPGMZA.OLMap.prototype.getMinZoom=function(){return this.olMap.getView().getMinZoom()},WPGMZA.OLMap.prototype.setMinZoom=function(value){this.olMap.getView().setMinZoom(value)},WPGMZA.OLMap.prototype.getMaxZoom=function(){return this.olMap.getView().getMaxZoom()},WPGMZA.OLMap.prototype.setMaxZoom=function(value){this.olMap.getView().setMaxZoom(value)},WPGMZA.OLMap.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),this.olMap&&this.olMap.getView().setProperties(this.settings.toOLViewOptions())},WPGMZA.OLMap.prototype.addMarker=function(marker){WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT?this.olMap.addOverlay(marker.overlay):(this.markerLayer.getSource().addFeature(marker.feature),marker.featureInSource=!0),Parent.prototype.addMarker.call(this,marker)},WPGMZA.OLMap.prototype.removeMarker=function(marker){WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT?this.olMap.removeOverlay(marker.overlay):(this.markerLayer.getSource().removeFeature(marker.feature),marker.featureInSource=!1),Parent.prototype.removeMarker.call(this,marker)},WPGMZA.OLMap.prototype.addPolygon=function(polygon){this.olMap.addLayer(polygon.layer),Parent.prototype.addPolygon.call(this,polygon)},WPGMZA.OLMap.prototype.removePolygon=function(polygon){this.olMap.removeLayer(polygon.layer),Parent.prototype.removePolygon.call(this,polygon)},WPGMZA.OLMap.prototype.addPolyline=function(polyline){this.olMap.addLayer(polyline.layer),Parent.prototype.addPolyline.call(this,polyline)},WPGMZA.OLMap.prototype.removePolyline=function(polyline){this.olMap.removeLayer(polyline.layer),Parent.prototype.removePolyline.call(this,polyline)},WPGMZA.OLMap.prototype.addCircle=function(circle){this.olMap.addLayer(circle.layer),Parent.prototype.addCircle.call(this,circle)},WPGMZA.OLMap.prototype.removeCircle=function(circle){this.olMap.removeLayer(circle.layer),Parent.prototype.removeCircle.call(this,circle)},WPGMZA.OLMap.prototype.addRectangle=function(rectangle){this.olMap.addLayer(rectangle.layer),Parent.prototype.addRectangle.call(this,rectangle)},WPGMZA.OLMap.prototype.removeRectangle=function(rectangle){this.olMap.removeLayer(rectangle.layer),Parent.prototype.removeRectangle.call(this,rectangle)},WPGMZA.OLMap.prototype.pixelsToLatLng=function(x,y){null==y&&("x"in x&&"y"in x?(y=x.y,x=x.x):console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)"));var coord=this.olMap.getCoordinateFromPixel([x,y]);if(!coord)return{x:null,y:null};var lonLat=ol.proj.toLonLat(coord);return{lat:lonLat[1],lng:lonLat[0]}},WPGMZA.OLMap.prototype.latLngToPixels=function(latLng){var coord=ol.proj.fromLonLat([latLng.lng,latLng.lat]),pixel=this.olMap.getPixelFromCoordinate(coord);return pixel?{x:pixel[0],y:pixel[1]}:{x:null,y:null}},WPGMZA.OLMap.prototype.enableBicycleLayer=function(value){if(value)this.bicycleLayer||(this.bicycleLayer=new ol.layer.Tile({source:new ol.source.OSM({url:"http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png"})})),this.olMap.addLayer(this.bicycleLayer);else{if(!this.bicycleLayer)return;this.olMap.removeLayer(this.bicycleLayer)}},WPGMZA.OLMap.prototype.showGestureOverlay=function(){var self=this;clearTimeout(this.gestureOverlayTimeoutID),$(this.gestureOverlay).stop().animate({opacity:"100"}),$(this.element).append(this.gestureOverlay),$(this.gestureOverlay).css({"line-height":$(this.element).height()+"px",opacity:"1.0"}),$(this.gestureOverlay).show(),this.gestureOverlayTimeoutID=setTimeout(function(){self.gestureOverlay.fadeOut(2e3)},2e3)},WPGMZA.OLMap.prototype.onElementResized=function(event){this.olMap.updateSize()},WPGMZA.OLMap.prototype.onRightClick=function(event){if($(event.target).closest(".ol-marker, .wpgmza_modern_infowindow, .wpgmza-modern-store-locator").length)return!0;var parentOffset=$(this.element).offset(),relX=event.pageX-parentOffset.left,relY=event.pageY-parentOffset.top,latLng=this.pixelsToLatLng(relX,relY);return this.trigger({type:"rightclick",latLng:latLng}),$(this.element).trigger({type:"rightclick",latLng:latLng}),event.preventDefault(),!1},WPGMZA.OLMap.prototype.enableAllInteractions=function(){this.olMap.getInteractions().forEach(function(interaction){(interaction instanceof ol.interaction.DragPan||interaction instanceof ol.interaction.DoubleClickZoom||interaction instanceof ol.interaction.MouseWheelZoom)&&interaction.setActive(!0)},this)}}),jQuery(function($){var Parent;WPGMZA.OLMarker=function(options){var self=this;Parent.call(this,options);var settings={};if(options)for(var name in options)options[name]instanceof WPGMZA.LatLng?settings[name]=options[name].toLatLngLiteral():options[name]instanceof WPGMZA.Map||(settings[name]=options[name]);var origin=ol.proj.fromLonLat([parseFloat(this.lng),parseFloat(this.lat)]);if(WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT){var img=$("<img alt=''/>")[0];img.onload=function(event){self.updateElementHeight(),self.map&&self.map.olMap.updateSize()},img.src=WPGMZA.defaultMarkerIcon,this.element=$("<div class='ol-marker'></div>")[0],this.element.appendChild(img),this.element.wpgmzaMarker=this,$(this.element).on("mouseover",function(event){self.dispatchEvent("mouseover")}),this.overlay=new ol.Overlay({element:this.element,position:origin,positioning:"bottom-center",stopEvent:!1}),this.overlay.setPosition(origin),this.animation?this.setAnimation(this.animation):this.anim&&this.setAnimation(this.anim),options&&options.draggable&&this.setDraggable(!0),this.rebindClickListener()}else{if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)throw new Error("Invalid marker render mode");this.feature=new ol.Feature({geometry:new ol.geom.Point(origin)}),this.feature.setStyle(this.getVectorLayerStyle()),(this.feature.wpgmzaMarker=this).feature.wpgmzaFeature=this}this.setOptions(settings),this.trigger("init")},Parent=WPGMZA.isProVersion()?WPGMZA.ProMarker:WPGMZA.Marker,WPGMZA.OLMarker.prototype=Object.create(Parent.prototype),WPGMZA.OLMarker.prototype.constructor=WPGMZA.OLMarker,WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT="element",WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER="vector",WPGMZA.OLMarker.renderMode=WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT,"open-layers"==WPGMZA.settings.engine&&WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&(WPGMZA.OLMarker.defaultVectorLayerStyle=new ol.style.Style({image:new ol.style.Icon({anchor:[.5,1],src:WPGMZA.defaultMarkerIcon})}),WPGMZA.OLMarker.hiddenVectorLayerStyle=new ol.style.Style({})),WPGMZA.OLMarker.prototype.getVectorLayerStyle=function(){return this.vectorLayerStyle?this.vectorLayerStyle:WPGMZA.OLMarker.defaultVectorLayerStyle},WPGMZA.OLMarker.prototype.updateElementHeight=function(height,calledOnFocus){var self=this;0!=(height=height||$(this.element).find("img").height())||calledOnFocus||$(window).one("focus",function(event){self.updateElementHeight(!1,!0)}),$(this.element).css({height:height+"px"})},WPGMZA.OLMarker.prototype.addLabel=function(){this.setLabel(this.getLabelText())},WPGMZA.OLMarker.prototype.setLabel=function(label){WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?label?(this.label||(this.label=$("<div class='ol-marker-label'/>"),$(this.element).append(this.label)),this.label.html(label)):this.label&&$(this.element).find(".ol-marker-label").remove():console.warn("Marker labels are not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.getVisible=function(visible){if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)return"none"!=this.overlay.getElement().style.display},WPGMZA.OLMarker.prototype.setVisible=function(visible){if(Parent.prototype.setVisible.call(this,visible),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)if(visible){var style=this.getVectorLayerStyle();this.feature.setStyle(style)}else this.feature.setStyle(null);else this.overlay.getElement().style.display=visible?"block":"none"},WPGMZA.OLMarker.prototype.setPosition=function(latLng){Parent.prototype.setPosition.call(this,latLng);var origin=ol.proj.fromLonLat([parseFloat(this.lng),parseFloat(this.lat)]);WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?this.feature.setGeometry(new ol.geom.Point(origin)):this.overlay.setPosition(origin)},WPGMZA.OLMarker.prototype.updateOffset=function(x,y){if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER){x=this._offset.x,y=this._offset.y;this.element.style.position="relative",this.element.style.left=x+"px",this.element.style.top=y+"px"}else console.warn("Marker offset is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setAnimation=function(anim){if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)switch(Parent.prototype.setAnimation.call(this,anim),anim){case WPGMZA.Marker.ANIMATION_NONE:$(this.element).removeAttr("data-anim");break;case WPGMZA.Marker.ANIMATION_BOUNCE:$(this.element).attr("data-anim","bounce");break;case WPGMZA.Marker.ANIMATION_DROP:$(this.element).attr("data-anim","drop")}else console.warn("Marker animation is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setDraggable=function(draggable){var self=this;if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)if(draggable){var options={disabled:!1};this.jQueryDraggableInitialized||(options.start=function(event){self.onDragStart(event)},options.stop=function(event){self.onDragEnd(event)}),$(this.element).draggable(options),this.jQueryDraggableInitialized=!0,this.rebindClickListener()}else $(this.element).draggable({disabled:!0});else console.warn("Marker dragging is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setOpacity=function(opacity){WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?$(this.element).css({opacity:opacity}):console.warn("Marker opacity is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.onDragStart=function(event){this.isBeingDragged=!0,this.map.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan&&interaction.setActive(!1)})},WPGMZA.OLMarker.prototype.onDragEnd=function(event){var offset_top=parseFloat($(this.element).css("top").match(/-?\d+/)[0]),offset_left=parseFloat($(this.element).css("left").match(/-?\d+/)[0]);$(this.element).css({top:"0px",left:"0px"});var currentLatLng=this.getPosition(),pixelsBeforeDrag=this.map.latLngToPixels(currentLatLng),pixelsAfterDrag={x:pixelsBeforeDrag.x+offset_left,y:pixelsBeforeDrag.y+offset_top},latLngAfterDrag=this.map.pixelsToLatLng(pixelsAfterDrag);this.setPosition(latLngAfterDrag),this.isBeingDragged=!1,this.trigger({type:"dragend",latLng:latLngAfterDrag}),this.trigger("change"),"yes"!=this.map.settings.wpgmza_settings_map_draggable&&this.map.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan&&interaction.setActive(!0)})},WPGMZA.OLMarker.prototype.onElementClick=function(event){var self=event.currentTarget.wpgmzaMarker;self.isBeingDragged||(self.dispatchEvent("click"),self.dispatchEvent("select"))},WPGMZA.OLMarker.prototype.rebindClickListener=function(){$(this.element).off("click",this.onElementClick),$(this.element).on("click",this.onElementClick)}}),jQuery(function($){WPGMZA.OLModernStoreLocatorCircle=function(map,settings){WPGMZA.ModernStoreLocatorCircle.call(this,map,settings)},WPGMZA.OLModernStoreLocatorCircle.prototype=Object.create(WPGMZA.ModernStoreLocatorCircle.prototype),WPGMZA.OLModernStoreLocatorCircle.prototype.constructor=WPGMZA.OLModernStoreLocatorCircle,WPGMZA.OLModernStoreLocatorCircle.prototype.initCanvasLayer=function(){var self=this,olViewportElement=$(this.map.element).children(".ol-viewport");this.canvas=document.createElement("canvas"),this.canvas.className="wpgmza-ol-canvas-overlay",olViewportElement.find(".ol-layers .ol-layer:first-child").prepend(this.canvas),this.renderFunction=function(event){self.canvas.width==olViewportElement.width()&&self.canvas.height==olViewportElement.height()||(self.canvas.width=olViewportElement.width(),self.canvas.height=olViewportElement.height(),$(this.canvas).css({width:olViewportElement.width()+"px",height:olViewportElement.height()+"px"})),self.draw()},this.map.olMap.on("postrender",this.renderFunction)},WPGMZA.OLModernStoreLocatorCircle.prototype.getContext=function(type){return this.canvas.getContext(type)},WPGMZA.OLModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){return{width:this.canvas.width,height:this.canvas.height}},WPGMZA.OLModernStoreLocatorCircle.prototype.getCenterPixels=function(){return this.map.latLngToPixels(this.settings.center)},WPGMZA.OLModernStoreLocatorCircle.prototype.getWorldOriginOffset=function(){return{x:0,y:0}},WPGMZA.OLModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){var center=new WPGMZA.LatLng(this.settings.center),outer=new WPGMZA.LatLng(center);outer.moveByDistance(km,90);var centerPixels=this.map.latLngToPixels(center),outerPixels=this.map.latLngToPixels(outer);return Math.abs(outerPixels.x-centerPixels.x)},WPGMZA.OLModernStoreLocatorCircle.prototype.getScale=function(){return 1},WPGMZA.OLModernStoreLocatorCircle.prototype.destroy=function(){$(this.canvas).remove(),this.map.olMap.un("postrender",this.renderFunction),this.map=null,this.canvas=null}}),jQuery(function($){WPGMZA.OLModernStoreLocator=function(map_id){WPGMZA.ModernStoreLocator.call(this,map_id),(WPGMZA.isProVersion()?$(".wpgmza_map[data-map-id='"+map_id+"']"):$("#wpgmza_map")).append(this.element)},WPGMZA.OLModernStoreLocator.prototype=Object.create(WPGMZA.ModernStoreLocator),WPGMZA.OLModernStoreLocator.prototype.constructor=WPGMZA.OLModernStoreLocator}),jQuery(function($){var Parent;WPGMZA.OLPolygon=function(options,olFeature){if(Parent.call(this,options,olFeature),olFeature)this.olFeature=olFeature;else{var coordinates=[[]];if(options&&options.polydata)for(var paths=this.parseGeometry(options.polydata),i=0;i<=paths.length;i++)coordinates[0].push(ol.proj.fromLonLat([parseFloat(paths[i%paths.length].lng),parseFloat(paths[i%paths.length].lat)]));this.olFeature=new ol.Feature({geometry:new ol.geom.Polygon(coordinates)})}this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]})}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaPolygon:this,wpgmzaFeature:this}),options&&this.setOptions(options)},Parent=WPGMZA.isProVersion()?WPGMZA.ProPolygon:WPGMZA.Polygon,WPGMZA.OLPolygon.prototype=Object.create(Parent.prototype),WPGMZA.OLPolygon.prototype.constructor=WPGMZA.OLPolygon,WPGMZA.OLPolygon.prototype.getGeometry=function(){for(var coordinates=this.olFeature.getGeometry().getCoordinates()[0],result=[],i=0;i<coordinates.length;i++){var lonLat=ol.proj.toLonLat(coordinates[i]),latLng={lat:lonLat[1],lng:lonLat[0]};result.push(latLng)}return result},WPGMZA.OLPolygon.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){var Parent;WPGMZA.OLPolyline=function(options,olFeature){if(WPGMZA.Polyline.call(this,options),olFeature)this.olFeature=olFeature;else{var coordinates=[];if(options&&options.polydata)for(var path=this.parseGeometry(options.polydata),i=0;i<path.length;i++){if(!$.isNumeric(path[i].lat))throw new Error("Invalid latitude");if(!$.isNumeric(path[i].lng))throw new Error("Invalid longitude");coordinates.push(ol.proj.fromLonLat([parseFloat(path[i].lng),parseFloat(path[i].lat)]))}this.olFeature=new ol.Feature({geometry:new ol.geom.LineString(coordinates)})}this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]})}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaPolyline:this,wpgmzaFeature:this}),options&&this.setOptions(options)},Parent=WPGMZA.Polyline,WPGMZA.OLPolyline.prototype=Object.create(Parent.prototype),WPGMZA.OLPolyline.prototype.constructor=WPGMZA.OLPolyline,WPGMZA.OLPolyline.prototype.getGeometry=function(){for(var result=[],coordinates=this.olFeature.getGeometry().getCoordinates(),i=0;i<coordinates.length;i++){var lonLat=ol.proj.toLonLat(coordinates[i]),latLng={lat:lonLat[1],lng:lonLat[0]};result.push(latLng)}return result},WPGMZA.OLPolyline.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){var Parent=WPGMZA.Rectangle;WPGMZA.OLRectangle=function(options,olFeature){if(Parent.apply(this,arguments),olFeature)this.olFeature=olFeature;else{var coordinates=[[]];options.cornerA&&options.cornerB&&(coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerA.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerB.lng),parseFloat(options.cornerA.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerB.lng),parseFloat(options.cornerB.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerB.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerA.lat)]))),this.olFeature=new ol.Feature({geometry:new ol.geom.Polygon(coordinates)})}this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]}),style:this.olStyle}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaRectangle:this,wpgmzaFeature:this}),options&&this.setOptions(options)},WPGMZA.extend(WPGMZA.OLRectangle,WPGMZA.Rectangle),WPGMZA.OLRectangle.prototype.getBounds=function(){var extent=this.olFeature.getGeometry().getExtent(),topLeft=ol.extent.getTopLeft(extent),bottomRight=ol.extent.getBottomRight(extent),topLeftLonLat=ol.proj.toLonLat(topLeft),bottomRightLonLat=ol.proj.toLonLat(bottomRight),topLeftLatLng=new WPGMZA.LatLng(topLeftLonLat[1],topLeftLonLat[0]),bottomRightLatLng=new WPGMZA.LatLng(bottomRightLonLat[1],bottomRightLonLat[0]);return new WPGMZA.LatLngBounds(topLeftLatLng,bottomRightLatLng)},WPGMZA.OLRectangle.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){WPGMZA.OLText=function(){}}),jQuery(function($){WPGMZA.GoogleCircle=function(options,googleCircle){var self=this;WPGMZA.Circle.call(this,options,googleCircle),googleCircle?(this.googleCircle=googleCircle,options&&(options.center=WPGMZA.LatLng.fromGoogleLatLng(googleCircle.getCenter()),options.radius=googleCircle.getRadius()/1e3)):(this.googleCircle=new google.maps.Circle,this.googleCircle.wpgmzaCircle=this),this.googleFeature=this.googleCircle,options&&this.setOptions(options),google.maps.event.addListener(this.googleCircle,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GoogleCircle.prototype=Object.create(WPGMZA.Circle.prototype),WPGMZA.GoogleCircle.prototype.constructor=WPGMZA.GoogleCircle,WPGMZA.GoogleCircle.prototype.getCenter=function(){return WPGMZA.LatLng.fromGoogleLatLng(this.googleCircle.getCenter())},WPGMZA.GoogleCircle.prototype.setCenter=function(center){WPGMZA.Circle.prototype.setCenter.apply(this,arguments),this.googleCircle.setCenter(center)},WPGMZA.GoogleCircle.prototype.getRadius=function(){return this.googleCircle.getRadius()/1e3},WPGMZA.GoogleCircle.prototype.setRadius=function(radius){WPGMZA.Circle.prototype.setRadius.apply(this,arguments),this.googleCircle.setRadius(1e3*parseFloat(radius))},WPGMZA.GoogleCircle.prototype.setVisible=function(visible){this.googleCircle.setVisible(!!visible)},WPGMZA.GoogleCircle.prototype.setDraggable=function(value){this.googleCircle.setDraggable(!!value)},WPGMZA.GoogleCircle.prototype.setEditable=function(value){var self=this;this.googleCircle.setOptions({editable:value}),value&&(google.maps.event.addListener(this.googleCircle,"center_changed",function(event){self.center=WPGMZA.LatLng.fromGoogleLatLng(self.googleCircle.getCenter()),self.trigger("change")}),google.maps.event.addListener(this.googleCircle,"radius_changed",function(event){self.radius=self.googleCircle.getRadius()/1e3,self.trigger("change")}))},WPGMZA.GoogleCircle.prototype.setOptions=function(options){WPGMZA.Circle.prototype.setOptions.apply(this,arguments),options.center&&(this.center=new WPGMZA.LatLng(options.center))},WPGMZA.GoogleCircle.prototype.updateNativeFeature=function(){var googleOptions=this.getScalarProperties(),center=new WPGMZA.LatLng(this.center);googleOptions.radius*=1e3,googleOptions.center=center.toGoogleLatLng(),this.googleCircle.setOptions(googleOptions)}}),jQuery(function($){WPGMZA.GoogleDrawingManager=function(map){var self=this;WPGMZA.DrawingManager.call(this,map),this.mode=null,this.googleDrawingManager=new google.maps.drawing.DrawingManager({drawingControl:!1,polygonOptions:{editable:!0},polylineOptions:{editable:!0},circleOptions:{editable:!0},rectangleOptions:{editable:!0}}),this.googleDrawingManager.setMap(map.googleMap),google.maps.event.addListener(this.googleDrawingManager,"polygoncomplete",function(polygon){self.onPolygonClosed(polygon)}),google.maps.event.addListener(this.googleDrawingManager,"polylinecomplete",function(polyline){self.onPolylineComplete(polyline)}),google.maps.event.addListener(this.googleDrawingManager,"circlecomplete",function(circle){self.onCircleComplete(circle)}),google.maps.event.addListener(this.googleDrawingManager,"rectanglecomplete",function(rectangle){self.onRectangleComplete(rectangle)})},WPGMZA.GoogleDrawingManager.prototype=Object.create(WPGMZA.DrawingManager.prototype),WPGMZA.GoogleDrawingManager.prototype.constructor=WPGMZA.GoogleDrawingManager,WPGMZA.GoogleDrawingManager.prototype.setDrawingMode=function(mode){var googleMode;switch(WPGMZA.DrawingManager.prototype.setDrawingMode.call(this,mode),mode){case WPGMZA.DrawingManager.MODE_NONE:case WPGMZA.DrawingManager.MODE_MARKER:googleMode=null;break;case WPGMZA.DrawingManager.MODE_POLYGON:googleMode=google.maps.drawing.OverlayType.POLYGON;break;case WPGMZA.DrawingManager.MODE_POLYLINE:googleMode=google.maps.drawing.OverlayType.POLYLINE;break;case WPGMZA.DrawingManager.MODE_CIRCLE:googleMode=google.maps.drawing.OverlayType.CIRCLE;break;case WPGMZA.DrawingManager.MODE_RECTANGLE:googleMode=google.maps.drawing.OverlayType.RECTANGLE;break;case WPGMZA.DrawingManager.MODE_HEATMAP:googleMode=null;break;default:throw new Error("Invalid drawing mode")}this.googleDrawingManager.setDrawingMode(googleMode)},WPGMZA.GoogleDrawingManager.prototype.setOptions=function(options){this.googleDrawingManager.setOptions({polygonOptions:options,polylineOptions:options})},WPGMZA.GoogleDrawingManager.prototype.onVertexClicked=function(event){},WPGMZA.GoogleDrawingManager.prototype.onPolygonClosed=function(googlePolygon){var event=new WPGMZA.Event("polygonclosed");event.enginePolygon=googlePolygon,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onPolylineComplete=function(googlePolyline){var event=new WPGMZA.Event("polylinecomplete");event.enginePolyline=googlePolyline,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onCircleComplete=function(googleCircle){var event=new WPGMZA.Event("circlecomplete");event.engineCircle=googleCircle,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onRectangleComplete=function(googleRectangle){var event=new WPGMZA.Event("rectanglecomplete");event.engineRectangle=googleRectangle,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onHeatmapPointAdded=function(googleMarker){var position=WPGMZA.LatLng.fromGoogleLatLng(googleMarker.getPosition());googleMarker.setMap(null);var marker=WPGMZA.Marker.createInstance();marker.setPosition(position);var image={url:WPGMZA.imageFolderURL+"heatmap-point.png",origin:new google.maps.Point(0,0),anchor:new google.maps.Point(13,13)};marker.googleMarker.setIcon(image),this.map.addMarker(marker);var event=new WPGMZA.Event("heatmappointadded");event.position=position,this.trigger(event)}}),jQuery(function($){WPGMZA.GoogleGeocoder=function(){},WPGMZA.GoogleGeocoder.prototype=Object.create(WPGMZA.Geocoder.prototype),WPGMZA.GoogleGeocoder.prototype.constructor=WPGMZA.GoogleGeocoder,WPGMZA.GoogleGeocoder.prototype.getLatLngFromAddress=function(options,callback){if(!options||!options.address)return nativeStatus=WPGMZA.Geocoder.NO_ADDRESS,void callback(null,nativeStatus);if(options.lat&&options.lng){var latLng={lat:options.lat,lng:options.lng};callback([{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng,bounds:null}],WPGMZA.Geocoder.SUCCESS)}if(WPGMZA.isLatLngString(options.address))return WPGMZA.Geocoder.prototype.getLatLngFromAddress.call(this,options,callback);options.country&&(options.componentRestrictions={country:options.country}),(new google.maps.Geocoder).geocode(options,function(results,status){if(status==google.maps.GeocoderStatus.OK){var location=results[0].geometry.location,latLng={lat:location.lat(),lng:location.lng()},bounds=null;results[0].geometry.bounds&&(bounds=WPGMZA.LatLngBounds.fromGoogleLatLngBounds(results[0].geometry.bounds)),callback(results=[{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng,bounds:bounds}],WPGMZA.Geocoder.SUCCESS)}else{var nativeStatus=WPGMZA.Geocoder.FAIL;status==google.maps.GeocoderStatus.ZERO_RESULTS&&(nativeStatus=WPGMZA.Geocoder.ZERO_RESULTS),callback(null,nativeStatus)}})},WPGMZA.GoogleGeocoder.prototype.getAddressFromLatLng=function(options,callback){if(!options||!options.latLng)throw new Error("No latLng specified");var latLng=new WPGMZA.LatLng(options.latLng),geocoder=new google.maps.Geocoder;delete(options=$.extend(options,{location:{lat:latLng.lat,lng:latLng.lng}})).latLng,geocoder.geocode(options,function(results,status){"OK"!==status&&callback(null,WPGMZA.Geocoder.FAIL),results&&results.length||callback([],WPGMZA.Geocoder.NO_RESULTS),callback([results[0].formatted_address],WPGMZA.Geocoder.SUCCESS)})}}),jQuery(function($){WPGMZA.settings.engine&&"google-maps"!=WPGMZA.settings.engine||window.google&&window.google.maps&&(WPGMZA.GoogleHTMLOverlay=function(map){this.element=$("<div class='wpgmza-google-html-overlay'></div>"),this.visible=!0,this.position=new WPGMZA.LatLng,this.setMap(map.googleMap),this.wpgmzaMap=map},WPGMZA.GoogleHTMLOverlay.prototype=new google.maps.OverlayView,WPGMZA.GoogleHTMLOverlay.prototype.onAdd=function(){this.getPanes().overlayMouseTarget.appendChild(this.element[0])},WPGMZA.GoogleHTMLOverlay.prototype.onRemove=function(){this.element&&$(this.element).parent().length&&($(this.element).remove(),this.element=null)},WPGMZA.GoogleHTMLOverlay.prototype.draw=function(){this.updateElementPosition()},WPGMZA.GoogleHTMLOverlay.prototype.updateElementPosition=function(){var projection=this.getProjection();if(projection){var pixels=projection.fromLatLngToDivPixel(this.position.toGoogleLatLng());$(this.element).css({left:pixels.x,top:pixels.y})}})}),jQuery(function($){var Parent;WPGMZA.GoogleInfoWindow=function(feature){Parent.call(this,feature),this.setFeature(feature)},WPGMZA.GoogleInfoWindow.Z_INDEX=99,Parent=WPGMZA.isProVersion()?WPGMZA.ProInfoWindow:WPGMZA.InfoWindow,WPGMZA.GoogleInfoWindow.prototype=Object.create(Parent.prototype),WPGMZA.GoogleInfoWindow.prototype.constructor=WPGMZA.GoogleInfoWindow,WPGMZA.GoogleInfoWindow.prototype.setFeature=function(feature){(this.feature=feature)instanceof WPGMZA.Marker?this.googleObject=feature.googleMarker:feature instanceof WPGMZA.Polygon?this.googleObject=feature.googlePolygon:feature instanceof WPGMZA.Polyline&&(this.googleObject=feature.googlePolyline)},WPGMZA.GoogleInfoWindow.prototype.createGoogleInfoWindow=function(){var self=this;this.googleInfoWindow||(this.googleInfoWindow=new google.maps.InfoWindow,this.googleInfoWindow.setZIndex(WPGMZA.GoogleInfoWindow.Z_INDEX),google.maps.event.addListener(this.googleInfoWindow,"domready",function(event){self.trigger("domready")}),google.maps.event.addListener(this.googleInfoWindow,"closeclick",function(event){self.state!=WPGMZA.InfoWindow.STATE_CLOSED&&(self.state=WPGMZA.InfoWindow.STATE_CLOSED,self.feature.map.trigger("infowindowclose"))}))},WPGMZA.GoogleInfoWindow.prototype.open=function(map,feature){var self=this;if(!Parent.prototype.open.call(this,map,feature))return!1;this.parent=map,this.createGoogleInfoWindow(),this.setFeature(feature),this.googleInfoWindow.open(this.feature.map.googleMap,this.googleObject);var intervalID,guid=WPGMZA.guid(),eaBtn=WPGMZA.isProVersion()?"":this.addEditButton(),html="<div id='"+guid+"'>"+eaBtn+" "+this.content+"</div>";return this.googleInfoWindow.setContent(html),intervalID=setInterval(function(event){div=$("#"+guid),div.length&&(clearInterval(intervalID),div[0].wpgmzaFeature=self.feature,div.addClass("wpgmza-infowindow"),self.element=div[0],self.trigger("infowindowopen"))},50),!0},WPGMZA.GoogleInfoWindow.prototype.close=function(){this.googleInfoWindow&&(WPGMZA.InfoWindow.prototype.close.call(this),this.googleInfoWindow.close())},WPGMZA.GoogleInfoWindow.prototype.setContent=function(html){Parent.prototype.setContent.call(this,html),this.content=html,this.createGoogleInfoWindow(),this.googleInfoWindow.setContent(html)},WPGMZA.GoogleInfoWindow.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),this.createGoogleInfoWindow(),this.googleInfoWindow.setOptions(options)}}),jQuery(function($){var Parent;WPGMZA.GoogleMap=function(element,options){var self=this;Parent.call(this,element,options),this.loadGoogleMap(),options?this.setOptions(options,!0):this.setOptions({},!0),google.maps.event.addListener(this.googleMap,"click",function(event){var wpgmzaEvent=new WPGMZA.Event("click");wpgmzaEvent.latLng={lat:event.latLng.lat(),lng:event.latLng.lng()},self.dispatchEvent(wpgmzaEvent)}),google.maps.event.addListener(this.googleMap,"rightclick",function(event){var wpgmzaEvent=new WPGMZA.Event("rightclick");wpgmzaEvent.latLng={lat:event.latLng.lat(),lng:event.latLng.lng()},self.dispatchEvent(wpgmzaEvent)}),google.maps.event.addListener(this.googleMap,"dragend",function(event){self.dispatchEvent("dragend")}),google.maps.event.addListener(this.googleMap,"zoom_changed",function(event){self.dispatchEvent("zoom_changed"),self.dispatchEvent("zoomchanged")}),google.maps.event.addListener(this.googleMap,"idle",function(event){self.onIdle(event)}),WPGMZA.isProVersion()||(this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded"))},WPGMZA.isProVersion()?(Parent=WPGMZA.ProMap,WPGMZA.GoogleMap.prototype=Object.create(WPGMZA.ProMap.prototype)):(Parent=WPGMZA.Map,WPGMZA.GoogleMap.prototype=Object.create(WPGMZA.Map.prototype)),WPGMZA.GoogleMap.prototype.constructor=WPGMZA.GoogleMap,WPGMZA.GoogleMap.parseThemeData=function(raw){var json;try{json=JSON.parse(raw)}catch(e){try{json=eval(raw)}catch(e){var str=raw;str=str.replace(/\\'/g,"'"),str=str.replace(/\\"/g,'"'),str=str.replace(/\\0/g,"\0"),str=str.replace(/\\\\/g,"\\");try{json=eval(str)}catch(e){return console.warn("Couldn't parse theme data"),[]}}}return json},WPGMZA.GoogleMap.prototype.loadGoogleMap=function(){var self=this,options=this.settings.toGoogleMapsOptions();this.googleMap=new google.maps.Map(this.engineElement,options),google.maps.event.addListener(this.googleMap,"bounds_changed",function(){self.onBoundsChanged()}),1==this.settings.bicycle&&this.enableBicycleLayer(!0),1==this.settings.traffic&&this.enableTrafficLayer(!0),this.settings.transport_layer&&this.enablePublicTransportLayer(!0),this.showPointsOfInterest(this.settings.wpgmza_show_point_of_interest),$(this.engineElement).append($(this.element).find(".wpgmza-loader"))},WPGMZA.GoogleMap.prototype.setOptions=function(options,initializing){if(Parent.prototype.setOptions.call(this,options),options.scrollwheel&&delete options.scrollwheel,initializing){var converted=$.extend(options,this.settings.toGoogleMapsOptions()),clone=$.extend({},converted);if(!clone.center instanceof google.maps.LatLng&&(clone.center instanceof WPGMZA.LatLng||"object"==typeof clone.center)&&(clone.center={lat:parseFloat(clone.center.lat),lng:parseFloat(clone.center.lng)}),this.settings.hide_point_of_interest){clone.styles||(clone.styles=[]),clone.styles.push({featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]})}this.googleMap.setOptions(clone)}else this.googleMap.setOptions(options)},WPGMZA.GoogleMap.prototype.addMarker=function(marker){marker.googleMarker.setMap(this.googleMap),Parent.prototype.addMarker.call(this,marker)},WPGMZA.GoogleMap.prototype.removeMarker=function(marker){marker.googleMarker.setMap(null),Parent.prototype.removeMarker.call(this,marker)},WPGMZA.GoogleMap.prototype.addPolygon=function(polygon){polygon.googlePolygon.setMap(this.googleMap),Parent.prototype.addPolygon.call(this,polygon)},WPGMZA.GoogleMap.prototype.removePolygon=function(polygon){polygon.googlePolygon.setMap(null),Parent.prototype.removePolygon.call(this,polygon)},WPGMZA.GoogleMap.prototype.addPolyline=function(polyline){polyline.googlePolyline.setMap(this.googleMap),Parent.prototype.addPolyline.call(this,polyline)},WPGMZA.GoogleMap.prototype.removePolyline=function(polyline){polyline.googlePolyline.setMap(null),Parent.prototype.removePolyline.call(this,polyline)},WPGMZA.GoogleMap.prototype.addCircle=function(circle){circle.googleCircle.setMap(this.googleMap),Parent.prototype.addCircle.call(this,circle)},WPGMZA.GoogleMap.prototype.removeCircle=function(circle){circle.googleCircle.setMap(null),Parent.prototype.removeCircle.call(this,circle)},WPGMZA.GoogleMap.prototype.addRectangle=function(rectangle){rectangle.googleRectangle.setMap(this.googleMap),Parent.prototype.addRectangle.call(this,rectangle)},WPGMZA.GoogleMap.prototype.removeRectangle=function(rectangle){rectangle.googleRectangle.setMap(null),Parent.prototype.removeRectangle.call(this,rectangle)},WPGMZA.GoogleMap.prototype.getCenter=function(){var latLng=this.googleMap.getCenter();return{lat:latLng.lat(),lng:latLng.lng()}},WPGMZA.GoogleMap.prototype.setCenter=function(latLng){WPGMZA.Map.prototype.setCenter.call(this,latLng),latLng instanceof WPGMZA.LatLng?this.googleMap.setCenter({lat:latLng.lat,lng:latLng.lng}):this.googleMap.setCenter(latLng)},WPGMZA.GoogleMap.prototype.panTo=function(latLng){latLng instanceof WPGMZA.LatLng?this.googleMap.panTo({lat:latLng.lat,lng:latLng.lng}):this.googleMap.panTo(latLng)},WPGMZA.GoogleMap.prototype.getZoom=function(){return this.googleMap.getZoom()},WPGMZA.GoogleMap.prototype.setZoom=function(value){if(isNaN(value))throw new Error("Value must not be NaN");return this.googleMap.setZoom(parseInt(value))},WPGMZA.GoogleMap.prototype.getBounds=function(){var bounds=this.googleMap.getBounds(),northEast=bounds.getNorthEast(),southWest=bounds.getSouthWest(),nativeBounds=new WPGMZA.LatLngBounds({});return nativeBounds.north=northEast.lat(),nativeBounds.south=southWest.lat(),nativeBounds.west=southWest.lng(),nativeBounds.east=northEast.lng(),nativeBounds.topLeft={lat:northEast.lat(),lng:southWest.lng()},nativeBounds.bottomRight={lat:southWest.lat(),lng:northEast.lng()},nativeBounds},WPGMZA.GoogleMap.prototype.fitBounds=function(southWest,northEast){if(southWest instanceof WPGMZA.LatLng&&(southWest={lat:southWest.lat,lng:southWest.lng}),northEast instanceof WPGMZA.LatLng)northEast={lat:northEast.lat,lng:northEast.lng};else if(southWest instanceof WPGMZA.LatLngBounds){var bounds=southWest;southWest={lat:bounds.south,lng:bounds.west},northEast={lat:bounds.north,lng:bounds.east}}var nativeBounds=new google.maps.LatLngBounds(southWest,northEast);this.googleMap.fitBounds(nativeBounds)},WPGMZA.GoogleMap.prototype.fitBoundsToVisibleMarkers=function(){for(var bounds=new google.maps.LatLngBounds,i=0;i<this.markers.length;i++)markers[i].getVisible()&&bounds.extend(markers[i].getPosition());this.googleMap.fitBounds(bounds)},WPGMZA.GoogleMap.prototype.enableBicycleLayer=function(enable){this.bicycleLayer||(this.bicycleLayer=new google.maps.BicyclingLayer),this.bicycleLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.enableTrafficLayer=function(enable){this.trafficLayer||(this.trafficLayer=new google.maps.TrafficLayer),this.trafficLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.enablePublicTransportLayer=function(enable){this.publicTransportLayer||(this.publicTransportLayer=new google.maps.TransitLayer),this.publicTransportLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.showPointsOfInterest=function(show){var text=$("textarea[name='theme_data']").val();if(text){var styles=JSON.parse(text);styles.push({featureType:"poi",stylers:[{visibility:show?"on":"off"}]}),this.googleMap.setOptions({styles:styles})}},WPGMZA.GoogleMap.prototype.getMinZoom=function(){return parseInt(this.settings.min_zoom)},WPGMZA.GoogleMap.prototype.setMinZoom=function(value){this.googleMap.setOptions({minZoom:value,maxZoom:this.getMaxZoom()})},WPGMZA.GoogleMap.prototype.getMaxZoom=function(){return parseInt(this.settings.max_zoom)},WPGMZA.GoogleMap.prototype.setMaxZoom=function(value){this.googleMap.setOptions({minZoom:this.getMinZoom(),maxZoom:value})},WPGMZA.GoogleMap.prototype.latLngToPixels=function(latLng){var map=this.googleMap,nativeLatLng=new google.maps.LatLng({lat:parseFloat(latLng.lat),lng:parseFloat(latLng.lng)}),topRight=map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast()),bottomLeft=map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest()),scale=Math.pow(2,map.getZoom()),worldPoint=map.getProjection().fromLatLngToPoint(nativeLatLng);return{x:(worldPoint.x-bottomLeft.x)*scale,y:(worldPoint.y-topRight.y)*scale}},WPGMZA.GoogleMap.prototype.pixelsToLatLng=function(x,y){null==y&&("x"in x&&"y"in x?(y=x.y,x=x.x):console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)"));var map=this.googleMap,topRight=map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast()),bottomLeft=map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest()),scale=Math.pow(2,map.getZoom()),worldPoint=new google.maps.Point(x/scale+bottomLeft.x,y/scale+topRight.y),latLng=map.getProjection().fromPointToLatLng(worldPoint);return{lat:latLng.lat(),lng:latLng.lng()}},WPGMZA.GoogleMap.prototype.onElementResized=function(event){this.googleMap&&google.maps.event.trigger(this.googleMap,"resize")},WPGMZA.GoogleMap.prototype.enableAllInteractions=function(){var options={scrollwheel:!0,draggable:!0,disableDoubleClickZoom:!1};this.googleMap.setOptions(options)}}),jQuery(function($){var Parent;WPGMZA.GoogleMarker=function(options){var self=this;Parent.call(this,options);var settings={};if(options)for(var name in options)options[name]instanceof WPGMZA.LatLng?settings[name]=options[name].toGoogleLatLng():options[name]instanceof WPGMZA.Map||"icon"==name||(settings[name]=options[name]);this.googleMarker=new google.maps.Marker(settings),(this.googleMarker.wpgmzaMarker=this).googleFeature=this.googleMarker,this.googleMarker.setPosition(new google.maps.LatLng({lat:parseFloat(this.lat),lng:parseFloat(this.lng)})),this.anim&&this.googleMarker.setAnimation(this.anim),this.animation&&this.googleMarker.setAnimation(this.animation),google.maps.event.addListener(this.googleMarker,"click",function(){self.dispatchEvent("click"),self.dispatchEvent("select")}),google.maps.event.addListener(this.googleMarker,"mouseover",function(){self.dispatchEvent("mouseover")}),google.maps.event.addListener(this.googleMarker,"dragend",function(){var googleMarkerPosition=self.googleMarker.getPosition();self.setPosition({lat:googleMarkerPosition.lat(),lng:googleMarkerPosition.lng()}),self.dispatchEvent({type:"dragend",latLng:self.getPosition()}),self.trigger("change")}),this.setOptions(settings),this.trigger("init")},Parent=WPGMZA.isProVersion()?WPGMZA.ProMarker:WPGMZA.Marker,WPGMZA.GoogleMarker.prototype=Object.create(Parent.prototype),WPGMZA.GoogleMarker.prototype.constructor=WPGMZA.GoogleMarker,Object.defineProperty(WPGMZA.GoogleMarker.prototype,"opacity",{get:function(){return this._opacity},set:function(value){this._opacity=value,this.googleMarker.setOpacity(value)}}),WPGMZA.GoogleMarker.prototype.setLabel=function(label){label?(this.googleMarker.setLabel({text:label}),this.googleMarker.getIcon()||this.googleMarker.setIcon(WPGMZA.settings.default_marker_icon)):this.googleMarker.setLabel(null)},WPGMZA.GoogleMarker.prototype.setPosition=function(latLng){Parent.prototype.setPosition.call(this,latLng),this.googleMarker.setPosition({lat:this.lat,lng:this.lng})},WPGMZA.GoogleMarker.prototype.updateOffset=function(){var params,self=this,icon=this.googleMarker.getIcon(),img=new Image,x=this._offset.x,y=this._offset.y;icon=icon||WPGMZA.settings.default_marker_icon,params="string"==typeof icon?{url:icon}:icon,img.onload=function(){var defaultAnchor_x=img.width/2,defaultAnchor_y=img.height;params.anchor=new google.maps.Point(defaultAnchor_x-x,defaultAnchor_y-y),self.googleMarker.setIcon(params)},img.src=params.url},WPGMZA.GoogleMarker.prototype.setOptions=function(options){this.googleMarker.setOptions(options)},WPGMZA.GoogleMarker.prototype.setAnimation=function(animation){Parent.prototype.setAnimation.call(this,animation),this.googleMarker.setAnimation(animation)},WPGMZA.GoogleMarker.prototype.setVisible=function(visible){Parent.prototype.setVisible.call(this,visible),this.googleMarker.setVisible(!!visible)},WPGMZA.GoogleMarker.prototype.getVisible=function(visible){return this.googleMarker.getVisible()},WPGMZA.GoogleMarker.prototype.setDraggable=function(draggable){this.googleMarker.setDraggable(draggable)},WPGMZA.GoogleMarker.prototype.setOpacity=function(opacity){this.googleMarker.setOpacity(opacity)}}),jQuery(function($){WPGMZA.GoogleModernStoreLocatorCircle=function(map,settings){var self=this;WPGMZA.ModernStoreLocatorCircle.call(this,map,settings),this.intervalID=setInterval(function(){var mapSize={width:$(self.mapElement).width(),height:$(self.mapElement).height()};mapSize.width==self.mapSize.width&&mapSize.height==self.mapSize.height||(self.canvasLayer.resize_(),self.canvasLayer.draw(),self.mapSize=mapSize)},1e3),$(document).bind("webkitfullscreenchange mozfullscreenchange fullscreenchange",function(){self.canvasLayer.resize_(),self.canvasLayer.draw()})},WPGMZA.GoogleModernStoreLocatorCircle.prototype=Object.create(WPGMZA.ModernStoreLocatorCircle.prototype),WPGMZA.GoogleModernStoreLocatorCircle.prototype.constructor=WPGMZA.GoogleModernStoreLocatorCircle,WPGMZA.GoogleModernStoreLocatorCircle.prototype.initCanvasLayer=function(){var self=this;this.canvasLayer&&(this.canvasLayer.setMap(null),this.canvasLayer.setAnimate(!1)),this.canvasLayer=new CanvasLayer({map:this.map.googleMap,resizeHandler:function(event){self.onResize(event)},updateHandler:function(event){self.onUpdate(event)},animate:!0,resolutionScale:this.getResolutionScale()})},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setOptions=function(options){WPGMZA.ModernStoreLocatorCircle.prototype.setOptions.call(this,options),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setPosition=function(position){WPGMZA.ModernStoreLocatorCircle.prototype.setPosition.call(this,position),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setRadius=function(radius){WPGMZA.ModernStoreLocatorCircle.prototype.setRadius.call(this,radius),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){var spherical=google.maps.geometry.spherical,center=this.settings.center,equator=new WPGMZA.LatLng({lat:0,lng:0}),latitude=new WPGMZA.LatLng({lat:center.lat,lng:0}),offsetAtEquator=spherical.computeOffset(equator.toGoogleLatLng(),1e3*km,90),result=.006395*km*(spherical.computeOffset(latitude.toGoogleLatLng(),1e3*km,90).lng()/offsetAtEquator.lng());if(isNaN(result))throw new Error("here");return result},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){return{width:this.canvasLayer.canvas.width,height:this.canvasLayer.canvas.height}},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getWorldOriginOffset=function(){var position=this.map.googleMap.getProjection().fromLatLngToPoint(this.canvasLayer.getTopLeft());return{x:-position.x,y:-position.y}},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getCenterPixels=function(){var center=new WPGMZA.LatLng(this.settings.center);return this.map.googleMap.getProjection().fromLatLngToPoint(center.toGoogleLatLng())},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getContext=function(type){return this.canvasLayer.canvas.getContext("2d")},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getScale=function(){return Math.pow(2,this.map.getZoom())*this.getResolutionScale()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setVisible=function(visible){WPGMZA.ModernStoreLocatorCircle.prototype.setVisible.call(this,visible),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.destroy=function(){this.canvasLayer.setMap(null),this.canvasLayer=null,clearInterval(this.intervalID)}}),jQuery(function($){WPGMZA.GoogleModernStoreLocator=function(map_id){var map=this.map=WPGMZA.getMapByID(map_id);WPGMZA.ModernStoreLocator.call(this,map_id);var restrict=map.settings.wpgmza_store_locator_restrict;this.addressInput=$(this.element).find(".addressInput, #addressInput")[0],this.addressInput&&restrict&&restrict.length,this.map.googleMap.controls[google.maps.ControlPosition.TOP_CENTER].push(this.element)},WPGMZA.GoogleModernStoreLocator.prototype=Object.create(WPGMZA.ModernStoreLocator.prototype),WPGMZA.GoogleModernStoreLocator.prototype.constructor=WPGMZA.GoogleModernStoreLocator}),jQuery(function($){var Parent;WPGMZA.GooglePolygon=function(options,googlePolygon){var self=this;options=options||{},Parent.call(this,options,googlePolygon),this.googlePolygon=googlePolygon||new google.maps.Polygon,this.googleFeature=this.googlePolygon,options&&options.polydata&&this.googlePolygon.setOptions({paths:this.parseGeometry(options.polydata)}),this.googlePolygon.wpgmzaPolygon=this,options&&this.setOptions(options),google.maps.event.addListener(this.googlePolygon,"click",function(){self.dispatchEvent({type:"click"})})},Parent=WPGMZA.isProVersion()?WPGMZA.ProPolygon:WPGMZA.Polygon,WPGMZA.GooglePolygon.prototype=Object.create(Parent.prototype),WPGMZA.GooglePolygon.prototype.constructor=WPGMZA.GooglePolygon,WPGMZA.GooglePolygon.prototype.updateNativeFeature=function(){this.googlePolygon.setOptions(this.getScalarProperties())},WPGMZA.GooglePolygon.prototype.getEditable=function(){return this.googlePolygon.getOptions().editable},WPGMZA.GooglePolygon.prototype.setEditable=function(value){var self=this;this.googlePolygon.setOptions({editable:value}),value&&(this.googlePolygon.getPaths().forEach(function(path,index){["insert_at","remove_at","set_at"].forEach(function(name){google.maps.event.addListener(path,name,function(){self.trigger("change")})})}),google.maps.event.addListener(this.googlePolygon,"dragend",function(event){self.trigger("change")}),google.maps.event.addListener(this.googlePolygon,"click",function(event){WPGMZA.altKeyDown&&(this.getPath().removeAt(event.vertex),self.trigger("change"))}))},WPGMZA.GooglePolygon.prototype.setDraggable=function(value){this.googlePolygon.setDraggable(value)},WPGMZA.GooglePolygon.prototype.getGeometry=function(){for(var result=[],path=this.googlePolygon.getPath(),i=0;i<path.getLength();i++){var latLng=path.getAt(i);result.push({lat:latLng.lat(),lng:latLng.lng()})}return result}}),jQuery(function($){WPGMZA.GooglePolyline=function(options,googlePolyline){var self=this;if(WPGMZA.Polyline.call(this,options,googlePolyline),this.googlePolyline=googlePolyline||new google.maps.Polyline(this.settings),this.googleFeature=this.googlePolyline,options&&options.polydata){var path=this.parseGeometry(options.polydata);this.googlePolyline.setPath(path)}this.googlePolyline.wpgmzaPolyline=this,options&&this.setOptions(options),google.maps.event.addListener(this.googlePolyline,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GooglePolyline.prototype=Object.create(WPGMZA.Polyline.prototype),WPGMZA.GooglePolyline.prototype.constructor=WPGMZA.GooglePolyline,WPGMZA.GooglePolyline.prototype.updateNativeFeature=function(){this.googlePolyline.setOptions(this.getScalarProperties())},WPGMZA.GooglePolyline.prototype.setEditable=function(value){var self=this;if(this.googlePolyline.setOptions({editable:value}),value){var path=this.googlePolyline.getPath();["insert_at","remove_at","set_at"].forEach(function(name){google.maps.event.addListener(path,name,function(){self.trigger("change")})}),google.maps.event.addListener(this.googlePolyline,"dragend",function(event){self.trigger("change")}),google.maps.event.addListener(this.googlePolyline,"click",function(event){WPGMZA.altKeyDown&&(this.getPath().removeAt(event.vertex),self.trigger("change"))})}},WPGMZA.GooglePolyline.prototype.setDraggable=function(value){this.googlePolyline.setOptions({draggable:value})},WPGMZA.GooglePolyline.prototype.getGeometry=function(){for(var result=[],path=this.googlePolyline.getPath(),i=0;i<path.getLength();i++){var latLng=path.getAt(i);result.push({lat:latLng.lat(),lng:latLng.lng()})}return result}}),jQuery(function($){WPGMZA.GoogleRectangle=function(options,googleRectangle){var self=this;options=options||{},WPGMZA.Rectangle.call(this,options,googleRectangle),googleRectangle?(this.googleRectangle=googleRectangle,this.cornerA=options.cornerA=new WPGMZA.LatLng({lat:googleRectangle.getBounds().getNorthEast().lat(),lng:googleRectangle.getBounds().getSouthWest().lng()}),this.cornerB=options.cornerB=new WPGMZA.LatLng({lat:googleRectangle.getBounds().getSouthWest().lat(),lng:googleRectangle.getBounds().getNorthEast().lng()})):(this.googleRectangle=new google.maps.Rectangle,this.googleRectangle.wpgmzaRectangle=this),this.googleFeature=this.googleRectangle,options&&this.setOptions(options),google.maps.event.addListener(this.googleRectangle,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GoogleRectangle.prototype=Object.create(WPGMZA.Rectangle.prototype),WPGMZA.GoogleRectangle.prototype.constructor=WPGMZA.GoogleRectangle,WPGMZA.GoogleRectangle.prototype.getBounds=function(){return WPGMZA.LatLngBounds.fromGoogleLatLngBounds(this.googleRectangle.getBounds())},WPGMZA.GoogleRectangle.prototype.setVisible=function(visible){this.googleRectangle.setVisible(!!visible)},WPGMZA.GoogleRectangle.prototype.setDraggable=function(value){this.googleRectangle.setDraggable(!!value)},WPGMZA.GoogleRectangle.prototype.setEditable=function(value){var self=this;this.googleRectangle.setEditable(!!value),value&&google.maps.event.addListener(this.googleRectangle,"bounds_changed",function(event){self.trigger("change")})},WPGMZA.GoogleRectangle.prototype.setOptions=function(options){WPGMZA.Rectangle.prototype.setOptions.apply(this,arguments),options.cornerA&&options.cornerB&&(this.cornerA=new WPGMZA.LatLng(options.cornerA),this.cornerB=new WPGMZA.LatLng(options.cornerB))},WPGMZA.GoogleRectangle.prototype.updateNativeFeature=function(){var googleOptions=this.getScalarProperties(),north=parseFloat(this.cornerA.lat),west=parseFloat(this.cornerA.lng),south=parseFloat(this.cornerB.lat),east=parseFloat(this.cornerB.lng);north&&west&&south&&east&&(googleOptions.bounds={north:north,west:west,south:south,east:east}),this.googleRectangle.setOptions(googleOptions)}}),jQuery(function($){WPGMZA.GoogleText=function(options){WPGMZA.Text.apply(this,arguments),this.overlay=new WPGMZA.GoogleTextOverlay(options)},WPGMZA.extend(WPGMZA.GoogleText,WPGMZA.Text)}),jQuery(function($){WPGMZA.GoogleTextOverlay=function(options){this.element=$("<div class='wpgmza-google-text-overlay'><div class='wpgmza-inner'></div></div>"),(options=options||{}).position&&(this.position=options.position),options.text&&this.element.find(".wpgmza-inner").text(options.text),options.map&&this.setMap(options.map.googleMap)},window.google&&google.maps&&google.maps.OverlayView&&(WPGMZA.GoogleTextOverlay.prototype=new google.maps.OverlayView),WPGMZA.GoogleTextOverlay.prototype.onAdd=function(){var position=this.getProjection().fromLatLngToDivPixel(this.position.toGoogleLatLng());this.element.css({position:"absolute",left:position.x+"px",top:position.y+"px",minWidth:"200px"}),this.getPanes().floatPane.appendChild(this.element[0])},WPGMZA.GoogleTextOverlay.prototype.draw=function(){var position=this.getProjection().fromLatLngToDivPixel(this.position.toGoogleLatLng());this.element.css({position:"absolute",left:position.x+"px",top:position.y+"px",minWidth:"200px"})},WPGMZA.GoogleTextOverlay.prototype.onRemove=function(){this.element.remove()},WPGMZA.GoogleTextOverlay.prototype.hide=function(){this.element.hide()},WPGMZA.GoogleTextOverlay.prototype.show=function(){this.element.show()},WPGMZA.GoogleTextOverlay.prototype.toggle=function(){this.element.is(":visible")?this.element.hide():this.element.show()}}),jQuery(function($){"google-maps"==WPGMZA.settings.engine&&(WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code||(WPGMZA.GoogleVertexContextMenu=function(mapEditPage){var self=this;this.mapEditPage=mapEditPage,this.element=document.createElement("div"),this.element.className="wpgmza-vertex-context-menu",this.element.innerHTML="Delete",google.maps.event.addDomListener(this.element,"click",function(event){return self.removeVertex(),event.preventDefault(),event.stopPropagation(),!1})},WPGMZA.GoogleVertexContextMenu.prototype=new google.maps.OverlayView,WPGMZA.GoogleVertexContextMenu.prototype.onAdd=function(){var self=this,map=this.getMap();this.getPanes().floatPane.appendChild(this.element),this.divListener=google.maps.event.addDomListener(map.getDiv(),"mousedown",function(e){e.target!=self.element&&self.close()},!0)},WPGMZA.GoogleVertexContextMenu.prototype.onRemove=function(){google.maps.event.removeListener(this.divListener),this.element.parentNode.removeChild(this.element),this.set("position"),this.set("path"),this.set("vertex")},WPGMZA.GoogleVertexContextMenu.prototype.open=function(map,path,vertex){this.set("position",path.getAt(vertex)),this.set("path",path),this.set("vertex",vertex),this.setMap(map),this.draw()},WPGMZA.GoogleVertexContextMenu.prototype.close=function(){this.setMap(null)},WPGMZA.GoogleVertexContextMenu.prototype.draw=function(){var position=this.get("position"),projection=this.getProjection();if(position&&projection){var point=projection.fromLatLngToDivPixel(position);this.element.style.top=point.y+"px",this.element.style.left=point.x+"px"}},WPGMZA.GoogleVertexContextMenu.prototype.removeVertex=function(){var path=this.get("path"),vertex=this.get("vertex");path&&null!=vertex&&path.removeAt(vertex),this.close()}))}),jQuery(function($){WPGMZA.FeaturePanel=function(element,mapEditPage){var self=this;WPGMZA.EventDispatcher.apply(this,arguments),this.map=mapEditPage.map,this.drawingManager=mapEditPage.drawingManager,this.feature=null,this.element=element,this.initDefaults(),this.setMode(WPGMZA.FeaturePanel.MODE_ADD),this.drawingInstructionsElement=$(this.element).find(".wpgmza-feature-drawing-instructions"),this.drawingInstructionsElement.detach(),this.editingInstructionsElement=$(this.element).find(".wpgmza-feature-editing-instructions"),this.editingInstructionsElement.detach(),$("#wpgmaps_tabs_markers").on("tabsactivate",function(event,ui){$.contains(ui.newPanel[0],self.element[0])&&self.onTabActivated(event)}),$("#wpgmaps_tabs_markers").on("tabsactivate",function(event,ui){$.contains(ui.oldPanel[0],self.element[0])&&self.onTabDeactivated(event)}),$(document.body).on("click","[data-edit-"+this.featureType+"-id]",function(event){self.onEditFeature(event)}),$(document.body).on("click","[data-delete-"+this.featureType+"-id]",function(event){self.onDeleteFeature(event)}),$(this.element).find(".wpgmza-save-feature").on("click",function(event){self.onSave(event)}),this.drawingManager.on(self.drawingManagerCompleteEvent,function(event){self.onDrawingComplete(event)}),this.drawingManager.on("drawingmodechanged",function(event){self.onDrawingModeChanged(event)}),$(this.element).on("change input",function(event){self.onPropertyChanged(event)})},WPGMZA.extend(WPGMZA.FeaturePanel,WPGMZA.EventDispatcher),WPGMZA.FeaturePanel.MODE_ADD="add",WPGMZA.FeaturePanel.MODE_EDIT="edit",WPGMZA.FeaturePanel.prevEditableFeature=null,Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureType",{get:function(){return $(this.element).attr("data-wpgmza-feature-type")}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"drawingManagerCompleteEvent",{get:function(){return this.featureType+"complete"}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureDataTable",{get:function(){return $("[data-wpgmza-datatable][data-wpgmza-feature-type='"+this.featureType+"']")[0].wpgmzaDataTable}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureAccordion",{get:function(){return $(this.element).closest(".wpgmza-accordion")}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"map",{get:function(){return WPGMZA.mapEditPage.map}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"mode",{get:function(){return this._mode}}),WPGMZA.FeaturePanel.prototype.initPreloader=function(){this.preloader||(this.preloader=$(WPGMZA.preloaderHTML),this.preloader.hide(),$(this.element).append(this.preloader))},WPGMZA.FeaturePanel.prototype.initDataTable=function(){var el=$(this.element).find("[data-wpgmza-datatable][data-wpgmza-rest-api-route]");this[this.featureType+"AdminDataTable"]=new WPGMZA.AdminFeatureDataTable(el)},WPGMZA.FeaturePanel.prototype.initDefaults=function(){$(this.element).find("[data-ajax-name]:not([type='radio'])").each(function(index,el){var val=$(el).val();val&&$(el).attr("data-default-value",val)})},WPGMZA.FeaturePanel.prototype.setCaptionType=function(type,id){var icons={add:"fa-plus-circle",save:"fa-pencil-square-o"};switch(type){case WPGMZA.FeaturePanel.MODE_ADD:case WPGMZA.FeaturePanel.MODE_EDIT:this.featureAccordion.find("[data-add-caption][data-edit-caption]").each(function(index,el){var text=$(el).attr("data-"+type+"-caption"),icon=$(el).find("i.fa");id&&(text+=" "+id),$(el).text(text),icon.length&&((icon=$("<i class='fa' aria-hidden='true'></i>")).addClass(icons[type]),$(el).prepend(" "),$(el).prepend(icon))});break;default:throw new Error("Invalid type")}},WPGMZA.FeaturePanel.prototype.setMode=function(type,id){this._mode=type,this.setCaptionType(type,id)},WPGMZA.FeaturePanel.prototype.setTargetFeature=function(feature){var self=this;if(WPGMZA.FeaturePanel.prevEditableFeature){var prev=WPGMZA.FeaturePanel.prevEditableFeature;prev.setEditable(!1),prev.setDraggable(!1),prev.off("change")}feature?(feature.setEditable(!0),feature.setDraggable(!0),feature.on("change",function(event){self.onFeatureChanged(event)}),this.setMode(WPGMZA.FeaturePanel.MODE_EDIT),this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showInstructions()):this.setMode(WPGMZA.FeaturePanel.MODE_ADD),this.feature=WPGMZA.FeaturePanel.prevEditableFeature=feature},WPGMZA.FeaturePanel.prototype.reset=function(){$(this.element).find("[data-ajax-name]:not([data-ajax-name='map_id']):not([type='color']):not([type='checkbox']):not([type='radio'])").val(""),$(this.element).find("select[data-ajax-name]>option:first-child").prop("selected",!0),$(this.element).find("[data-ajax-name='id']").val("-1"),$(this.element).find("input[type='checkbox']").prop("checked",!1),tinyMCE.get("wpgmza-description-editor")?tinyMCE.get("wpgmza-description-editor").setContent(""):$("#wpgmza-description-editor").val(""),$("#wpgmza-description-editor").val(""),this.showPreloader(!1),this.setMode(WPGMZA.FeaturePanel.MODE_ADD),$(this.element).find("[data-ajax-name][data-default-value]").each(function(index,el){$(el).val($(el).data("default-value"))})},WPGMZA.FeaturePanel.prototype.select=function(arg){var id,expectedBaseClass,self=this;if(this.reset(),$.isNumeric(arg))id=arg;else{if(expectedBaseClass=WPGMZA[WPGMZA.capitalizeWords(this.featureType)],!(feature instanceof expectedBaseClass))throw new Error("Invalid feature type for this panel");id=arg.id}this.showPreloader(!0),WPGMZA.animateScroll($(".wpgmza_map")),WPGMZA.restAPI.call("/"+this.featureType+"s/"+id+"?skip_cache=1",{success:function(data,status,xhr){var getByIDFunction="get"+WPGMZA.capitalizeWords(self.featureType)+"ByID",feature=self.map[getByIDFunction](id);self.populate(data),self.showPreloader(!1),self.setMode(WPGMZA.FeaturePanel.MODE_EDIT,id),self.setTargetFeature(feature)}})},WPGMZA.FeaturePanel.prototype.showPreloader=function(show){this.initPreloader(),0==arguments.length||show?(this.preloader.fadeIn(),this.element.addClass("wpgmza-loading")):(this.preloader.fadeOut(),this.element.removeClass("wpgmza-loading"))},WPGMZA.FeaturePanel.prototype.populate=function(data){var value,target,name;for(name in data)switch(target=$(this.element).find("[data-ajax-name='"+name+"']"),value=data[name],(target.attr("type")||"").toLowerCase()){case"checkbox":case"radio":target.prop("checked",1==data[name]);break;case"color":value.match(/^#/)||(value="#"+value);default:"object"==typeof value&&(value=JSON.stringify(value)),$(this.element).find("[data-ajax-name='"+name+"']:not(select)").val(value),$(this.element).find("select[data-ajax-name='"+name+"']").each(function(index,el){"string"==typeof value&&0==data[name].length||$(el).val(value)})}},WPGMZA.FeaturePanel.prototype.serializeFormData=function(){var fields=$(this.element).find("[data-ajax-name]"),data={};return fields.each(function(index,el){var type="text";switch($(el).attr("type")&&(type=$(el).attr("type").toLowerCase()),type){case"checkbox":data[$(el).attr("data-ajax-name")]=$(el).prop("checked")?1:0;break;case"radio":$(el).prop("checked")&&(data[$(el).attr("data-ajax-name")]=$(el).val());break;default:data[$(el).attr("data-ajax-name")]=$(el).val()}}),data},WPGMZA.FeaturePanel.prototype.discardChanges=function(){if(this.feature){var feature=this.feature;this.setTargetFeature(null),feature&&feature.map&&(this.map["remove"+WPGMZA.capitalizeWords(this.featureType)](feature),-1<feature.id&&this.updateFeatureByID(feature.id))}},WPGMZA.FeaturePanel.prototype.updateFeatureByID=function(id){var feature,self=this,route="/"+this.featureType+"s/",functionSuffix=WPGMZA.capitalizeWords(self.featureType),getByIDFunction="get"+functionSuffix+"ByID",removeFunction="remove"+functionSuffix,addFunction="add"+functionSuffix;WPGMZA.restAPI.call(route+id,{success:function(data,status,xhr){(feature=self.map[getByIDFunction](id))&&self.map[removeFunction](feature),feature=WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data),self.map[addFunction](feature)}})},WPGMZA.FeaturePanel.prototype.showInstructions=function(){switch(this.mode){case WPGMZA.FeaturePanel.MODE_ADD:$(this.map.element).append(this.drawingInstructionsElement),$(this.drawingInstructionsElement).hide().fadeIn();break;default:$(this.map.element).append(this.editingInstructionsElement),$(this.editingInstructionsElement).hide().fadeIn()}},WPGMZA.FeaturePanel.prototype.onTabActivated=function(){this.reset(),this.drawingManager.setDrawingMode(this.featureType),this.onAddFeature(event),$(".wpgmza-table-container-title").hide(),$(".wpgmza-table-container").hide();var featureString=this.featureType.charAt(0).toUpperCase()+this.featureType.slice(1);$("#wpgmza-table-container-"+featureString).show(),$("#wpgmza-table-container-title-"+featureString).show()},WPGMZA.FeaturePanel.prototype.onTabDeactivated=function(){this.discardChanges(),this.setTargetFeature(null)},WPGMZA.FeaturePanel.prototype.onAddFeature=function(event){this.drawingManager.setDrawingMode(this.featureType)},WPGMZA.FeaturePanel.prototype.onEditFeature=function(event){var name="data-edit-"+this.featureType+"-id",id=$(event.currentTarget).attr(name);this.discardChanges(),this.select(id)},WPGMZA.FeaturePanel.prototype.onDeleteFeature=function(event){var self=this,name="data-delete-"+this.featureType+"-id",id=$(event.currentTarget).attr(name),route="/"+this.featureType+"s/",feature=this.map["get"+WPGMZA.capitalizeWords(this.featureType)+"ByID"](id);this.featureDataTable.dataTable.processing(!0),WPGMZA.restAPI.call(route+id,{method:"DELETE",success:function(data,status,xhr){self.map["remove"+WPGMZA.capitalizeWords(self.featureType)](feature),self.featureDataTable.reload()}})},WPGMZA.FeaturePanel.prototype.onDrawingModeChanged=function(event){$(this.drawingInstructionsElement).detach(),$(this.editingInstructionsElement).detach(),this.drawingManager.mode==this.featureType&&this.showInstructions()},WPGMZA.FeaturePanel.prototype.onDrawingComplete=function(event){var engineFeature=event["engine"+WPGMZA.capitalizeWords(this.featureType)],formData=this.serializeFormData(),geometryField=$(this.element).find("textarea[data-ajax-name$='data']");delete formData.polydata;var nativeFeature=WPGMZA[WPGMZA.capitalizeWords(this.featureType)].createInstance(formData,engineFeature);this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.map["add"+WPGMZA.capitalizeWords(this.featureType)](nativeFeature),this.setTargetFeature(nativeFeature),geometryField.length&&geometryField.val(JSON.stringify(nativeFeature.getGeometry())),this.featureType},WPGMZA.FeaturePanel.prototype.onPropertyChanged=function(event){var feature=this.feature;feature&&($(this.element).find(":input[data-ajax-name]").each(function(index,el){var key=$(el).attr("data-ajax-name");feature[key]=$(el).val()}),feature.updateNativeFeature())},WPGMZA.FeaturePanel.prototype.onFeatureChanged=function(event){var geometryField=$(this.element).find("textarea[data-ajax-name$='data']");geometryField.length&&geometryField.val(JSON.stringify(this.feature.getGeometry()))},WPGMZA.FeaturePanel.prototype.onSave=function(event){var self=this,id=$(self.element).find("[data-ajax-name='id']").val(),data=this.serializeFormData(),route="/"+this.featureType+"s/",isNew=-1==id;"circle"!=this.featureType||data.center?"rectangle"!=this.featureType||data.cornerA?"polygon"!=this.featureType||data.polydata?"polyline"!=this.featureType||data.polydata?(isNew||(route+=id),WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showPreloader(!0),WPGMZA.restAPI.call(route,{method:"POST",data:data,success:function(data,status,xhr){var feature,functionSuffix=WPGMZA.capitalizeWords(self.featureType),getByIDFunction="get"+functionSuffix+"ByID",removeFunction="remove"+functionSuffix,addFunction="add"+functionSuffix;self.reset(),(feature=self.map[getByIDFunction](id))&&self.map[removeFunction](feature),self.setTargetFeature(null),self.showPreloader(!1),feature=WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data),self.map[addFunction](feature),self.featureDataTable.reload(),self.onTabActivated(event)}})):alert(WPGMZA.localized_strings.no_shape_polyline):alert(WPGMZA.localized_strings.no_shape_polygon):alert(WPGMZA.localized_strings.no_shape_rectangle):alert(WPGMZA.localized_strings.no_shape_circle)}}),jQuery(function($){WPGMZA.MarkerPanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.MarkerPanel,WPGMZA.FeaturePanel),WPGMZA.MarkerPanel.createInstance=function(element,mapEditPage){return WPGMZA.isProVersion()?new WPGMZA.ProMarkerPanel(element,mapEditPage):new WPGMZA.MarkerPanel(element,mapEditPage)},WPGMZA.MarkerPanel.prototype.initDefaults=function(){var self=this;WPGMZA.FeaturePanel.prototype.initDefaults.apply(this,arguments),this.adjustSubMode=!1,this.onTabActivated(null),$(document.body).on("click","[data-adjust-"+this.featureType+"-id]",function(event){self.onAdjustFeature(event)}),$(document.body).on("click",".wpgmza_approve_btn",function(event){self.onApproveMarker(event)})},WPGMZA.MarkerPanel.prototype.onAdjustFeature=function(event){var name="data-adjust-"+this.featureType+"-id",id=$(event.currentTarget).attr(name);this.discardChanges(),this.adjustSubMode=!0,this.select(id)},WPGMZA.MarkerPanel.prototype.onApproveMarker=function(event){var self=this,route="/"+this.featureType+"s/"+$(event.currentTarget).attr("id");WPGMZA.restAPI.call(route,{method:"POST",data:{approved:"1"},success:function(data,status,xhr){self.featureDataTable.reload()}})},WPGMZA.MarkerPanel.prototype.onFeatureChanged=function(event){if(this.adjustSubMode){var aPos=this.feature.getPosition();aPos&&($(this.element).find("[data-ajax-name='lat']").val(aPos.lat),$(this.element).find("[data-ajax-name='lng']").val(aPos.lng))}else{var addressField=$(this.element).find("input[data-ajax-name$='address']");if(addressField.length){var pos=this.feature.getPosition();addressField.val(pos.lat+","+pos.lng)}}},WPGMZA.MarkerPanel.prototype.setTargetFeature=function(feature){if(WPGMZA.FeaturePanel.prevEditableFeature){var prev=WPGMZA.FeaturePanel.prevEditableFeature;prev.setOpacity&&prev.setOpacity(1)}$(this.element).find("[data-ajax-name]").removeAttr("disabled"),$(this.element).find("fieldset").show(),$(this.element).find(".wpgmza-adjust-mode-notice").addClass("wpgmza-hidden"),$(this.element).find('[data-ajax-name="lat"]').attr("type","hidden"),$(this.element).find('[data-ajax-name="lng"]').attr("type","hidden"),$(this.element).find(".wpgmza-hide-in-adjust-mode").removeClass("wpgmza-hidden"),$(this.element).find(".wpgmza-show-in-adjust-mode").addClass("wpgmza-hidden"),feature?(feature.setOpacity&&feature.setOpacity(.7),feature.getMap().panTo(feature.getPosition()),this.adjustSubMode&&($(this.element).find("[data-ajax-name]").attr("disabled","disabled"),$(this.element).find("fieldset:not(.wpgmza-always-on)").hide(),$(this.element).find(".wpgmza-adjust-mode-notice").removeClass("wpgmza-hidden"),$(this.element).find('[data-ajax-name="lat"]').attr("type","text").removeAttr("disabled"),$(this.element).find('[data-ajax-name="lng"]').attr("type","text").removeAttr("disabled"),$(this.element).find(".wpgmza-hide-in-adjust-mode").addClass("wpgmza-hidden"),$(this.element).find(".wpgmza-show-in-adjust-mode").removeClass("wpgmza-hidden"))):this.adjustSubMode=!1,WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments)},WPGMZA.MarkerPanel.prototype.onSave=function(event){var self=this,geocoder=WPGMZA.Geocoder.createInstance(),geocodingData={address:$(this.element).find("[data-ajax-name='address']").val()};WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showPreloader(!0);var cloud_lat=!1,cloud_lng=!1;0<document.getElementsByName("lat").length&&(cloud_lat=document.getElementsByName("lat")[0].value),0<document.getElementsByName("lng").length&&(cloud_lng=document.getElementsByName("lng")[0].value),cloud_lat&&cloud_lng&&(WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey||(geocodingData.lat=parseFloat(cloud_lat),geocodingData.lng=parseFloat(cloud_lng))),this.adjustSubMode?WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments):geocoder.geocode(geocodingData,function(results,status){switch(status){case WPGMZA.Geocoder.ZERO_RESULTS:return alert(WPGMZA.localized_strings.zero_results),void self.showPreloader(!1);case WPGMZA.Geocoder.SUCCESS:break;case WPGMZA.Geocoder.NO_ADDRESS:return alert(WPGMZA.localized_strings.no_address),void self.showPreloader(!1);case WPGMZA.Geocoder.FAIL:default:return alert(WPGMZA.localized_strings.geocode_fail),void self.showPreloader(!1)}var result=results[0];$(self.element).find("[data-ajax-name='lat']").val(result.lat),$(self.element).find("[data-ajax-name='lng']").val(result.lng),WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments)}),WPGMZA.mapEditPage.map.resetBounds()}}),jQuery(function($){WPGMZA.CirclePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.CirclePanel,WPGMZA.FeaturePanel),WPGMZA.CirclePanel.createInstance=function(element,mapEditPage){return WPGMZA.isProVersion()?new WPGMZA.ProCirclePanel(element,mapEditPage):new WPGMZA.CirclePanel(element,mapEditPage)},WPGMZA.CirclePanel.prototype.updateFields=function(){$(this.element).find("[data-ajax-name='center']").val(this.feature.getCenter().toString()),$(this.element).find("[data-ajax-name='radius']").val(this.feature.getRadius())},WPGMZA.CirclePanel.prototype.onDrawingComplete=function(event){WPGMZA.FeaturePanel.prototype.onDrawingComplete.apply(this,arguments),this.updateFields()},WPGMZA.CirclePanel.prototype.setTargetFeature=function(feature){WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments),feature&&this.updateFields()},WPGMZA.CirclePanel.prototype.onFeatureChanged=function(event){WPGMZA.FeaturePanel.prototype.onFeatureChanged.apply(this,arguments),this.updateFields()}});var wpgmza_autoCompleteDisabled=!1;jQuery(function($){"map-edit"==WPGMZA.currentPage&&(WPGMZA.MapEditPage=function(){var self=this,element=document.body;WPGMZA.EventDispatcher.call(this),$("#wpgmaps_options fieldset").wrapInner("<div class='wpgmza-flex'></div>"),this.themePanel=new WPGMZA.ThemePanel,this.themeEditor=new WPGMZA.ThemeEditor,this.map=WPGMZA.maps[0],(!WPGMZA.pro_version||WPGMZA.Version.compare(WPGMZA.pro_version,"8.1.0")>=WPGMZA.Version.EQUAL_TO)&&(this.drawingManager=WPGMZA.DrawingManager.createInstance(this.map)),this.initDataTables(),this.initFeaturePanels(),this.initJQueryUIControls(),"en"!==WPGMZA.locale&&$("#datatable_no_result_message,#datatable_search_string").parent().parent().hide(),$("input.wpgmza-address").each(function(index,el){el.addressInput=WPGMZA.AddressInput.createInstance(el,self.map)}),$('#wpgmza-map-edit-page input[type="color"]').each(function(){$("<div class='button-secondary wpgmza-paste-color-btn' title='Paste a HEX color code'><i class='fa fa-clipboard' aria-hidden='true'></i></div>").insertAfter(this)}),jQuery("body").on("click",".wpgmza_ac_result",function(e){var index=jQuery(this).data("id"),lat=jQuery(this).data("lat"),lng=jQuery(this).data("lng"),name=jQuery("#wpgmza_item_address_"+index).html();jQuery("input[name='lat']").val(lat),jQuery("input[name='lng']").val(lng),jQuery("#wpgmza_add_address_map_editor").val(name),jQuery("#wpgmza_autocomplete_search_results").hide()}),jQuery("body").on("click",".wpgmza-paste-color-btn",function(){try{var colorBtn=$(this);if(!navigator||!navigator.clipboard||!navigator.clipboard.readText)return;navigator.clipboard.readText().then(function(textcopy){colorBtn.parent().find('input[type="color"]').val("#"+textcopy.replace("#","").trim())}).catch(function(err){console.error("WP Google Maps: Could not access clipboard",err)})}catch(c_ex){}}),jQuery("body").on("focusout","#wpgmza_add_address_map_editor",function(e){setTimeout(function(){jQuery("#wpgmza_autocomplete_search_results").fadeOut("slow")},500)});var ajaxRequest=!1,wpgmzaAjaxTimeout=!1,wpgmzaStartTyping=!1,wpgmzaKeyStrokeCount=1,wpgmzaAvgTimeBetweenStrokes=300,wpgmzaTotalTimeForKeyStrokes=0,wpgmzaTmp="",wpgmzaIdentifiedTypingSpeed=!1;$("body").on("keypress",".wpgmza-address",function(e){if("wpgmza_add_address_map_editor"==this.id){if(wpgmza_autoCompleteDisabled)return;var wpgmza_apikey=!1;if(WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey)return void(wpgmza_apikey=WPGMZA_localized_data.settings.googleMapsApiKey);if("Escape"===e.key||"Alt"===e.key||"Control"===e.key||"Option"===e.key||"Shift"===e.key||"ArrowLeft"===e.key||"ArrowRight"===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key)return void $("#wpgmza_autocomplete_search_results").hide();if(!wpgmzaIdentifiedTypingSpeed){var d=new Date;return clearTimeout(wpgmzaTmp),wpgmzaTmp=setTimeout(function(){wpgmzaStartTyping=!1,wpgmzaAvgTimeBetweenStrokes=300,wpgmzaTotalTimeForKeyStrokes=0},1500),wpgmzaStartTyping?1==wpgmzaKeyStrokeCount||(wpgmzaCurrentTimeBetweenStrokes=d.getTime()-wpgmzaStartTyping,wpgmzaTotalTimeForKeyStrokes+=wpgmzaCurrentTimeBetweenStrokes,wpgmzaAvgTimeBetweenStrokes=wpgmzaTotalTimeForKeyStrokes/(wpgmzaKeyStrokeCount-1),wpgmzaStartTyping=d.getTime(),3<=wpgmzaKeyStrokeCount&&(wpgmzaIdentifiedTypingSpeed=wpgmzaAvgTimeBetweenStrokes)):wpgmzaStartTyping=d.getTime(),void wpgmzaKeyStrokeCount++}clearTimeout(wpgmzaAjaxTimeout),$("#wpgmza_autocomplete_search_results").html("Searching..."),$("#wpgmza_autocomplete_search_results").show();var currentSearch=jQuery(this).val();if(""!==currentSearch){!1!==ajaxRequest&&ajaxRequest.abort();var wpgmza_api_url="";wpgmza_api_url=wpgmza_apikey?"https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+window.location.hostname+"&hash="+WPGMZA_localized_data.siteHash+"&k="+wpgmza_apikey:"https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+window.location.hostname+"&hash="+WPGMZA_localized_data.siteHash,wpgmzaAjaxTimeout=setTimeout(function(){ajaxRequest=$.ajax({url:wpgmza_api_url,type:"GET",dataType:"json",success:function(results){try{if(void 0!==results.error)"error1"==results.error?($("#wpgmza_autoc_disabled").html(WPGMZA.localized_strings.cloud_api_key_error_1),$("#wpgmza_autoc_disabled").fadeIn("slow"),$("#wpgmza_autocomplete_search_results").hide(),wpgmza_autoCompleteDisabled=!0):console.error(results.error);else{$("#wpgmza_autocomplete_search_results").html("");var html="";for(var i in results)html+="<div class='wpgmza_ac_result "+(""===html?"":"border-top")+"' data-id='"+i+"' data-lat='"+results[i].lat+"' data-lng='"+results[i].lng+"'><div class='wpgmza_ac_container'><div class='wpgmza_ac_icon'><img src='"+results[i].icon+"' /></div><div class='wpgmza_ac_item'><span id='wpgmza_item_name_"+i+"' class='wpgmza_item_name'>"+results[i].place_name+"</span><span id='wpgmza_item_address_"+i+"' class='wpgmza_item_address'>"+results[i].formatted_address+"</span></div></div></div>";""==html&&(html="<div class='p-2 text-center'><small>No results found...</small></div>"),$("#wpgmza_autocomplete_search_results").html(html),$("#wpgmza_autocomplete_search_results").show()}}catch(exception){console.error("WP Google Maps Plugin: There was an error returning the list of places for your search")}}})},2*wpgmzaIdentifiedTypingSpeed)}else $("#wpgmza_autocomplete_search_results").hide()}}),$("#wpgmza_map_height_type").on("change",function(event){self.onMapHeightTypeChange(event)}),$("#advanced-markers .wpgmza-feature-drawing-instructions").remove(),$("[data-search-area='auto']").hide(),$(document.body).on("click","[data-wpgmza-admin-marker-datatable] input[name='mark']",function(event){self.onShiftClick(event)}),$("#wpgmza_map_type").on("change",function(event){self.onMapTypeChanged(event)}),$("body").on("click",".wpgmza_copy_shortcode",function(){var $temp=jQuery("<input>");jQuery('<span id="wpgmza_tmp" style="display:none; width:100%; text-align:center;">');jQuery("body").append($temp),$temp.val(jQuery(this).val()).select(),document.execCommand("copy"),$temp.remove(),WPGMZA.notification("Shortcode Copied")}),this.on("markerupdated",function(event){self.onMarkerUpdated(event)}),this.map&&(this.map.on("zoomchanged",function(event){self.onZoomChanged(event)}),this.map.on("boundschanged",function(event){self.onBoundsChanged(event)}),this.map.on("rightclick",function(event){self.onRightClick(event)})),$(element).on("click",".wpgmza_poly_del_btn",function(event){self.onDeletePolygon(event)}),$(element).on("click",".wpgmza_polyline_del_btn",function(event){self.onDeletePolyline(event)}),$(element).on("click",".wpgmza_dataset_del_btn",function(evevnt){self.onDeleteHeatmap(event)}),$(element).on("click",".wpgmza_circle_del_btn",function(event){self.onDeleteCircle(event)}),$(element).on("click",".wpgmza_rectangle_del_btn",function(event){self.onDeleteRectangle(event)}),$(element).on("click","#wpgmza-open-advanced-theme-data",function(event){event.preventDefault(),$(".wpgmza_theme_data_container").toggleClass("wpgmza_hidden")})},WPGMZA.extend(WPGMZA.MapEditPage,WPGMZA.EventDispatcher),WPGMZA.MapEditPage.createInstance=function(){return WPGMZA.isProVersion()&&WPGMZA.Version.compare(WPGMZA.pro_version,"8.0.0")>=WPGMZA.Version.EQUAL_TO?new WPGMZA.ProMapEditPage:new WPGMZA.MapEditPage},WPGMZA.MapEditPage.prototype.initDataTables=function(){var self=this;$("[data-wpgmza-datatable][data-wpgmza-rest-api-route]").each(function(index,el){var featureType=$(el).attr("data-wpgmza-feature-type");self[featureType+"AdminDataTable"]=new WPGMZA.AdminFeatureDataTable(el)})},WPGMZA.MapEditPage.prototype.initFeaturePanels=function(){var self=this;$(".wpgmza-feature-accordion[data-wpgmza-feature-type]").each(function(index,el){var featurePanelElement=$(el).find(".wpgmza-feature-panel-container > *"),featureType=$(el).attr("data-wpgmza-feature-type"),panelClassName=WPGMZA.capitalizeWords(featureType)+"Panel",instance=WPGMZA[panelClassName].createInstance(featurePanelElement,self);self[featureType+"Panel"]=instance})},WPGMZA.MapEditPage.prototype.initJQueryUIControls=function(){var mapContainer,self=this;$("#wpgmaps_tabs").tabs(),mapContainer=$("#wpgmza-map-container").detach(),$("#wpgmaps_tabs_markers").tabs(),$(".map_wrapper").prepend(mapContainer),$("#slider-range-max").slider({range:"max",min:1,max:21,value:$("input[name='map_start_zoom']").val(),slide:function(event,ui){$("input[name='map_start_zoom']").val(ui.value),self.map.setZoom(ui.value)}})},WPGMZA.MapEditPage.prototype.onShiftClick=function(event){var checkbox=event.currentTarget,row=jQuery(checkbox).closest("tr");if(this.lastSelectedRow&&event.shiftKey){var prevIndex=this.lastSelectedRow.index(),currIndex=row.index(),startIndex=Math.min(prevIndex,currIndex),endIndex=Math.max(prevIndex,currIndex),rows=jQuery("[data-wpgmza-admin-marker-datatable] tbody>tr");jQuery("[data-wpgmza-admin-marker-datatable] input[name='mark']").prop("checked",!1);for(var i=startIndex;i<=endIndex;i++)jQuery(rows[i]).find("input[name='mark']").prop("checked",!0)}this.lastSelectedRow=row},WPGMZA.MapEditPage.prototype.onMapTypeChanged=function(event){if("open-layers"!=WPGMZA.settings.engine){var mapTypeId;switch(event.target.value){case"2":mapTypeId=google.maps.MapTypeId.SATELLITE;break;case"3":mapTypeId=google.maps.MapTypeId.HYBRID;break;case"4":mapTypeId=google.maps.MapTypeId.TERRAIN;break;default:mapTypeId=google.maps.MapTypeId.ROADMAP}this.map.setOptions({mapTypeId:mapTypeId})}},WPGMZA.MapEditPage.prototype.onMarkerUpdated=function(event){this.markerDataTable.reload()},WPGMZA.MapEditPage.prototype.onZoomChanged=function(event){$(".map_start_zoom").val(this.map.getZoom())},WPGMZA.MapEditPage.prototype.onBoundsChanged=function(event){var location=this.map.getCenter();$("#wpgmza_start_location").val(location.lat+","+location.lng),$("input[name='map_start_lat']").val(location.lat),$("input[name='map_start_lng']").val(location.lng),$("#wpgmza_start_zoom").val(this.map.getZoom()),$("#wpgmaps_save_reminder").show()},WPGMZA.MapEditPage.prototype.onMapHeightTypeChange=function(event){"%"==event.target.value&&$("#wpgmza_height_warning").show()},WPGMZA.MapEditPage.prototype.onRightClick=function(event){var marker,self=this;this.drawingManager&&this.drawingManager.mode!=WPGMZA.DrawingManager.MODE_MARKER||(this.rightClickMarker||(this.rightClickMarker=WPGMZA.Marker.createInstance({draggable:!0}),this.rightClickMarker.on("dragend",function(event){$(".wpgmza-marker-panel [data-ajax-name='address']").val(event.latLng.lat+","+event.latLng.lng)}),this.map.on("click",function(event){self.rightClickMarker.setMap(null)})),(marker=this.rightClickMarker).setPosition(event.latLng),marker.setMap(this.map),$(".wpgmza-marker-panel [data-ajax-name='address']").val(event.latLng.lat+", "+event.latLng.lng))},WPGMZA.MapEditPage.prototype.onDeletePolygon=function(event){var cur_id=parseInt($(this).attr("id")),data={action:"delete_poly",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){WPGM_Path[cur_id].setMap(null),delete WPGM_PathData[cur_id],delete WPGM_Path[cur_id],$("#wpgmza_poly_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeletePolyline=function(event){var cur_id=$(this).attr("id"),data={action:"delete_polyline",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){WPGM_PathLine[cur_id].setMap(null),delete WPGM_PathLineData[cur_id],delete WPGM_PathLine[cur_id],$("#wpgmza_polyline_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeleteHeatmap=function(event){var cur_id=$(this).attr("id"),data={action:"delete_dataset",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){heatmap[cur_id].setMap(null),delete heatmap[cur_id],$("#wpgmza_heatmap_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeleteCircle=function(event){var circle_id=$(this).attr("id"),data={action:"delete_circle",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,circle_id:circle_id};$.post(ajaxurl,data,function(response){$("#tabs-m-5 table").replaceWith(response),circle_array.forEach(function(circle){if(circle.id==circle_id)return circle.setMap(null),!1})})},WPGMZA.MapEditPage.prototype.onDeleteRectangle=function(event){var rectangle_id=$(this).attr("id"),data={action:"delete_rectangle",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,rectangle_id:rectangle_id};$.post(ajaxurl,data,function(response){$("#tabs-m-6 table").replaceWith(response),rectangle_array.forEach(function(rectangle){if(rectangle.id==rectangle_id)return rectangle.setMap(null),!1})})},$(document).ready(function(event){WPGMZA.mapEditPage=WPGMZA.MapEditPage.createInstance()}))}),jQuery(function($){WPGMZA.PolygonPanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.PolygonPanel,WPGMZA.FeaturePanel),WPGMZA.PolygonPanel.createInstance=function(element,mapEditPage){return WPGMZA.isProVersion()?new WPGMZA.ProPolygonPanel(element,mapEditPage):new WPGMZA.PolygonPanel(element,mapEditPage)},Object.defineProperty(WPGMZA.PolygonPanel.prototype,"drawingManagerCompleteEvent",{get:function(){return"polygonclosed"}})}),jQuery(function($){WPGMZA.PolylinePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.PolylinePanel,WPGMZA.FeaturePanel),WPGMZA.PolylinePanel.createInstance=function(element,mapEditPage){return WPGMZA.isProVersion()?new WPGMZA.ProPolylinePanel(element,mapEditPage):new WPGMZA.PolylinePanel(element,mapEditPage)}}),jQuery(function($){WPGMZA.RectanglePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.RectanglePanel,WPGMZA.FeaturePanel),WPGMZA.RectanglePanel.createInstance=function(element,mapEditPage){return WPGMZA.isProVersion()?new WPGMZA.ProRectanglePanel(element,mapEditPage):new WPGMZA.RectanglePanel(element,mapEditPage)},WPGMZA.RectanglePanel.prototype.updateFields=function(){var bounds=this.feature.getBounds();bounds.north&&bounds.west&&bounds.south&&bounds.east&&($(this.element).find("[data-ajax-name='cornerA']").val(bounds.north+", "+bounds.west),$(this.element).find("[data-ajax-name='cornerB']").val(bounds.south+", "+bounds.east))},WPGMZA.RectanglePanel.prototype.setTargetFeature=function(feature){WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments),feature&&this.updateFields()},WPGMZA.RectanglePanel.prototype.onDrawingComplete=function(event){WPGMZA.FeaturePanel.prototype.onDrawingComplete.apply(this,arguments),this.updateFields()},WPGMZA.RectanglePanel.prototype.onFeatureChanged=function(event){WPGMZA.FeaturePanel.prototype.onFeatureChanged.apply(this,arguments),this.updateFields()}});
|
1 |
+
jQuery(function($){var core={MARKER_PULL_DATABASE:"0",MARKER_PULL_XML:"1",PAGE_MAP_LIST:"map-list",PAGE_MAP_EDIT:"map-edit",PAGE_SETTINGS:"map-settings",PAGE_SUPPORT:"map-support",PAGE_CATEGORIES:"categories",PAGE_ADVANCED:"advanced",PAGE_CUSTOM_FIELDS:"custom-fields",maps:[],events:null,settings:null,restAPI:null,localized_strings:null,loadingHTML:'<div class="wpgmza-preloader"><div class="wpgmza-loader">...</div></div>',preloaderHTML:"<div class='wpgmza-preloader'><div></div><div></div><div></div><div></div></div>",getCurrentPage:function(){switch(WPGMZA.getQueryParamValue("page")){case"wp-google-maps-menu":return window.location.href.match(/action=edit/)&&window.location.href.match(/map_id=\d+/)?WPGMZA.PAGE_MAP_EDIT:WPGMZA.PAGE_MAP_LIST;case"wp-google-maps-menu-settings":return WPGMZA.PAGE_SETTINGS;case"wp-google-maps-menu-support":return WPGMZA.PAGE_SUPPORT;case"wp-google-maps-menu-categories":return WPGMZA.PAGE_CATEGORIES;case"wp-google-maps-menu-advanced":return WPGMZA.PAGE_ADVANCED;case"wp-google-maps-menu-custom-fields":return WPGMZA.PAGE_CUSTOM_FIELDS;default:return null}},getScrollAnimationOffset:function(){return(WPGMZA.settings.scroll_animation_offset||0)+$("#wpadminbar").height()},getScrollAnimationDuration:function(){return WPGMZA.settings.scroll_animation_milliseconds?WPGMZA.settings.scroll_animation_milliseconds:500},animateScroll:function(element,milliseconds){var offset=WPGMZA.getScrollAnimationOffset();milliseconds=milliseconds||WPGMZA.getScrollAnimationDuration(),$("html, body").animate({scrollTop:$(element).offset().top-offset},milliseconds)},extend:function(child,parent){var constructor=child;child.prototype=Object.create(parent.prototype),child.prototype.constructor=constructor},guid:function(){var d=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(d+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=(d+16*Math.random())%16|0;return d=Math.floor(d/16),("x"===c?r:3&r|8).toString(16)})},hexOpacityToRGBA:function(colour,opacity){var hex=parseInt(colour.replace(/^#/,""),16);return[(16711680&hex)>>16,(65280&hex)>>8,255&hex,parseFloat(opacity)]},hexOpacityToString:function(colour,opacity){var arr=WPGMZA.hexOpacityToRGBA(colour,opacity);return"rgba("+arr[0]+", "+arr[1]+", "+arr[2]+", "+arr[3]+")"},hexToRgba:function(hex){var c;return/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)?(3==(c=hex.substring(1).split("")).length&&(c=[c[0],c[0],c[1],c[1],c[2],c[2]]),{r:(c="0x"+c.join(""))>>16&255,g:c>>8&255,b:255&c,a:1}):0},rgbaToString:function(rgba){return"rgba("+rgba.r+", "+rgba.g+", "+rgba.b+", "+rgba.a+")"},latLngRegexp:/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/,isLatLngString:function(str){if("string"!=typeof str)return null;str.match(/^\(.+\)$/)&&(str=str.replace(/^\(|\)$/,""));var m=str.match(WPGMZA.latLngRegexp);return m?new WPGMZA.LatLng({lat:parseFloat(m[1]),lng:parseFloat(m[3])}):null},stringToLatLng:function(str){var result=WPGMZA.isLatLngString(str);if(!result)throw new Error("Not a valid latLng");return result},isHexColorString:function(str){return"string"==typeof str&&!!str.match(/#[0-9A-F]{6}/i)},imageDimensionsCache:{},getImageDimensions:function(src,callback){if(WPGMZA.imageDimensionsCache[src])callback(WPGMZA.imageDimensionsCache[src]);else{var img=document.createElement("img");img.onload=function(event){var result={width:img.width,height:img.height};WPGMZA.imageDimensionsCache[src]=result,callback(result)},img.src=src}},decodeEntities:function(input){return input.replace(/&(nbsp|amp|quot|lt|gt);/g,function(m,e){return m[e]}).replace(/&#(\d+);/gi,function(m,e){return String.fromCharCode(parseInt(e,10))})},isDeveloperMode:function(){return this.settings.developer_mode||window.Cookies&&window.Cookies.get("wpgmza-developer-mode")},isProVersion:function(){return"1"==this._isProVersion},openMediaDialog:function(callback){var file_frame;if(file_frame)return file_frame.uploader.uploader.param("post_id",set_to_post_id),void file_frame.open();(file_frame=wp.media.frames.file_frame=wp.media({title:"Select a image to upload",button:{text:"Use this image"},multiple:!1})).on("select",function(){attachment=file_frame.state().get("selection").first().toJSON(),callback(attachment.id,attachment.url)}),file_frame.open()},getCurrentPosition:function(callback,error,watch){var nativeFunction="getCurrentPosition";if(WPGMZA.userLocationDenied)error&&error({code:1,message:"Location unavailable"});else if(watch&&(nativeFunction="watchPosition"),navigator.geolocation){var options={enableHighAccuracy:!0};navigator.geolocation[nativeFunction]?navigator.geolocation[nativeFunction](function(position){callback&&callback(position),WPGMZA.events.trigger("userlocationfound")},function(err){options.enableHighAccuracy=!1,navigator.geolocation[nativeFunction](function(position){callback&&callback(position),WPGMZA.events.trigger("userlocationfound")},function(err){console.warn(err.code,err.message),1==err.code&&(WPGMZA.userLocationDenied=!0),error&&error(err)},options)},options):console.warn(nativeFunction+" is not available")}else console.warn("No geolocation available on this device")},watchPosition:function(callback,error){return WPGMZA.getCurrentPosition(callback,error,!0)},runCatchableTask:function(callback,friendlyErrorContainer){if(WPGMZA.isDeveloperMode())callback();else try{callback()}catch(e){var friendlyError=new WPGMZA.FriendlyError(e);$(friendlyErrorContainer).html(""),$(friendlyErrorContainer).append(friendlyError.element),$(friendlyErrorContainer).show()}},capitalizeWords:function(string){return(string+"").replace(/^(.)|\s+(.)/g,function(m){return m.toUpperCase()})},pluralize:function(string){return WPGMZA.singularize(string)+"s"},singularize:function(string){return string.replace(/s$/,"")},assertInstanceOf:function(instance,instanceName){var engine,fullInstanceName,pro=WPGMZA.isProVersion()?"Pro":"";switch(WPGMZA.settings.engine){case"open-layers":engine="OL";break;default:engine="Google"}if("OLFeature"!=(fullInstanceName=WPGMZA[engine+pro+instanceName]&&engine+instanceName!="OLFeature"?engine+pro+instanceName:WPGMZA[pro+instanceName]?pro+instanceName:WPGMZA[engine+instanceName]&&WPGMZA[engine+instanceName].prototype?engine+instanceName:instanceName)&&!(instance instanceof WPGMZA[fullInstanceName]))throw new Error("Object must be an instance of "+fullInstanceName+" (did you call a constructor directly, rather than createInstance?)")},getMapByID:function(id){for(var i=0;i<WPGMZA.maps.length;i++)if(WPGMZA.maps[i].id==id)return WPGMZA.maps[i];return null},isGoogleAutocompleteSupported:function(){return!!window.google&&(!!google.maps&&(!!google.maps.places&&(!!google.maps.places.Autocomplete&&(!WPGMZA.CloudAPI||!WPGMZA.CloudAPI.isBeingUsed))))},googleAPIStatus:window.wpgmza_google_api_status,isSafari:function(){var ua=navigator.userAgent.toLowerCase();return ua.match(/safari/i)&&!ua.match(/chrome/i)},isTouchDevice:function(){return"ontouchstart"in window},isDeviceiOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},isModernComponentStyleAllowed:function(){return!WPGMZA.settings.user_interface_style||"legacy"==WPGMZA.settings.user_interface_style||"modern"==WPGMZA.settings.user_interface_style},isElementInView:function(element){var pageTop=$(window).scrollTop(),pageBottom=pageTop+$(window).height(),elementTop=$(element).offset().top,elementBottom=elementTop+$(element).height();return elementTop<pageTop&&pageBottom<elementBottom||(pageTop<=elementTop&&elementTop<=pageBottom||pageTop<=elementBottom&&elementBottom<=pageBottom)},isFullScreen:function(){return wpgmzaisFullScreen},getQueryParamValue:function(name){var m,regex=new RegExp(name+"=([^&#]*)");return(m=window.location.href.match(regex))?decodeURIComponent(m[1]):null},notification:function(text,time){switch(arguments.length){case 0:text="",time=4e3;break;case 1:time=4e3}var html='<div class="wpgmza-popup-notification">'+text+"</div>";jQuery("body").append(html),setTimeout(function(){jQuery("body").find(".wpgmza-popup-notification").remove()},time)}},wpgmzaisFullScreen=!1;for(var key in[]){console.warn("It appears that the built in JavaScript Array has been extended, this can create issues with for ... in loops, which may cause failure.");break}for(var key in window.WPGMZA?window.WPGMZA=$.extend(window.WPGMZA,core):window.WPGMZA=core,window.uc&&window.uc.reloadOnOptIn&&(window.uc.reloadOnOptIn("S1pcEj_jZX"),window.uc.reloadOnOptOut("S1pcEj_jZX")),WPGMZA_localized_data){var value=WPGMZA_localized_data[key];WPGMZA[key]=value}function onScroll(event){$(".wpgmza_map").each(function(index,el){var isInView=WPGMZA.isElementInView(el);el.wpgmzaScrollIntoViewTriggerFlag?isInView||(el.wpgmzaScrollIntoViewTriggerFlag=!1):isInView&&($(el).trigger("mapscrolledintoview.wpgmza"),el.wpgmzaScrollIntoViewTriggerFlag=!0)})}WPGMZA.settings.useLegacyGlobals=!0,jQuery(function($){$(window).trigger("ready.wpgmza"),$("script[src*='wp-google-maps.combined.js'], script[src*='wp-google-maps-pro.combined.js']").length&&console.warn("Minified script is out of date, using combined script instead.");var elements=$("script[src]").filter(function(){return this.src.match(/(^|\/)jquery\.(min\.)?js(\?|$)/i)});1<elements.length&&console.warn("Multiple jQuery versions detected: ",elements),WPGMZA.restAPI=WPGMZA.RestAPI.createInstance(),WPGMZA.CloudAPI&&(WPGMZA.cloudAPI=WPGMZA.CloudAPI.createInstance()),$(document).on("fullscreenchange",function(){wpgmzaisFullScreen=!!document.fullscreenElement}),$("body").on("click","#wpgmzaCloseChat",function(e){e.preventDefault(),$.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_hide_chat",nonce:WPGMZA_localized_data.ajaxnonce}}),$(".wpgmza-chat-help").remove()})}),$(document).ready(function(event){for(var key in[]){console.warn("The Array object has been extended incorrectly by your theme or another plugin. This can cause issues with functionality.");break}if("https:"!=window.location.protocol){var warning='<div class="notice notice-warning"><p>'+WPGMZA.localized_strings.unsecure_geolocation+"</p></div>";$(".wpgmza-geolocation-setting").first().after($(warning))}}),$(window).on("scroll",onScroll),$(document).ready(onScroll),$(function(){WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code?jQuery(".wpgmza-gdpr-compliance").length<=0&&($("#wpgmza_map, .wpgmza_map").each(function(index,el){$(el).append($(WPGMZA.api_consent_html)),$(el).css({height:"auto"})}),$("button.wpgmza-api-consent").on("click",function(event){Cookies.set("wpgmza-api-consent-given",!0),window.location.reload()})):function initMaps(){$(document.body).find(".wpgmza_map:not(.wpgmza-initialized)").each(function(index,el){el.wpgmzaMap?console.warn("Element missing class wpgmza-initialized but does have wpgmzaMap property. No new instance will be created"):el.wpgmzaMap=WPGMZA.Map.createInstance(el)}),WPGMZA.Map.nextInitTimeoutID=setTimeout(initMaps,3e3)}()}),$(document.body).on("click","button.wpgmza-api-consent",function(event){Cookies.set("wpgmza-api-consent-given",!0),window.location.reload()}),$(document.body).on("keydown",function(event){event.altKey&&(WPGMZA.altKeyDown=!0)}),$(document.body).on("keyup",function(event){event.altKey||(WPGMZA.altKeyDown=!1)})}),jQuery(function($){WPGMZA.Compatibility=function(){this.preventDocumentWriteGoogleMapsAPI()},WPGMZA.Compatibility.prototype.preventDocumentWriteGoogleMapsAPI=function(){var old=document.write;document.write=function(content){content.match&&content.match(/maps\.google/)||old.call(document,content)}},WPGMZA.compatiblityModule=new WPGMZA.Compatibility}),function(root,factory){"object"==typeof exports?module.exports=factory(root):"function"==typeof define&&define.amd?define([],factory.bind(root,root)):factory(root)}("undefined"!=typeof global?global:this,function(root){if(root.CSS&&root.CSS.escape)return root.CSS.escape;function cssEscape(value){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var codeUnit,string=String(value),length=string.length,index=-1,result="",firstCodeUnit=string.charCodeAt(0);++index<length;)0!=(codeUnit=string.charCodeAt(index))?result+=1<=codeUnit&&codeUnit<=31||127==codeUnit||0==index&&48<=codeUnit&&codeUnit<=57||1==index&&48<=codeUnit&&codeUnit<=57&&45==firstCodeUnit?"\\"+codeUnit.toString(16)+" ":(0!=index||1!=length||45!=codeUnit)&&(128<=codeUnit||45==codeUnit||95==codeUnit||48<=codeUnit&&codeUnit<=57||65<=codeUnit&&codeUnit<=90||97<=codeUnit&&codeUnit<=122)?string.charAt(index):"\\"+string.charAt(index):result+="�";return result}return root.CSS||(root.CSS={}),root.CSS.escape=cssEscape}),jQuery(function($){Math.PI;function deg2rad(deg){return deg*(Math.PI/180)}WPGMZA.Distance={MILES:!0,KILOMETERS:!1,MILES_PER_KILOMETER:.621371,KILOMETERS_PER_MILE:1.60934,uiToMeters:function(uiDistance){return parseFloat(uiDistance)/(WPGMZA.settings.distance_units==WPGMZA.Distance.MILES?WPGMZA.Distance.MILES_PER_KILOMETER:1)*1e3},uiToKilometers:function(uiDistance){return.001*WPGMZA.Distance.uiToMeters(uiDistance)},uiToMiles:function(uiDistance){return WPGMZA.Distance.uiToKilometers(uiDistance)*WPGMZA.Distance.MILES_PER_KILOMETER},kilometersToUI:function(km){return WPGMZA.settings.distance_units==WPGMZA.Distance.MILES?km*WPGMZA.Distance.MILES_PER_KILOMETER:km},between:function(a,b){if(!(a instanceof WPGMZA.LatLng||"lat"in a&&"lng"in a))throw new Error("First argument must be an instance of WPGMZA.LatLng or a literal");if(!(b instanceof WPGMZA.LatLng||"lat"in b&&"lng"in b))throw new Error("Second argument must be an instance of WPGMZA.LatLng or a literal");if(a===b)return 0;var lat1=a.lat,lon1=a.lng,lat2=b.lat,lon2=b.lng,dLat=deg2rad(lat2-lat1),dLon=deg2rad(lon2-lon1);a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(deg2rad(lat1))*Math.cos(deg2rad(lat2))*Math.sin(dLon/2)*Math.sin(dLon/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}}}),jQuery(function($){WPGMZA.EliasFano=function(){if(!WPGMZA.EliasFano.isSupported)throw new Error("Elias Fano encoding is not supported on browsers without Uint8Array");WPGMZA.EliasFano.decodingTablesInitialised||WPGMZA.EliasFano.createDecodingTable()},WPGMZA.EliasFano.isSupported="Uint8Array"in window,WPGMZA.EliasFano.decodingTableHighBits=[],WPGMZA.EliasFano.decodingTableDocIDNumber=null,WPGMZA.EliasFano.decodingTableHighBitsCarryover=null,WPGMZA.EliasFano.createDecodingTable=function(){WPGMZA.EliasFano.decodingTableDocIDNumber=new Uint8Array(256),WPGMZA.EliasFano.decodingTableHighBitsCarryover=new Uint8Array(256);for(var decodingTableHighBits=WPGMZA.EliasFano.decodingTableHighBits,decodingTableDocIDNumber=WPGMZA.EliasFano.decodingTableDocIDNumber,decodingTableHighBitsCarryover=WPGMZA.EliasFano.decodingTableHighBitsCarryover,i=0;i<256;i++){var zeroCount=0;decodingTableHighBits[i]=[];for(var j=7;0<=j;j--)zeroCount=0<(i&1<<j)?(decodingTableHighBits[i][decodingTableDocIDNumber[i]]=zeroCount,decodingTableDocIDNumber[i]++,0):(zeroCount+1)%255;decodingTableHighBitsCarryover[i]=zeroCount}WPGMZA.EliasFano.decodingTablesInitialised=!0},WPGMZA.EliasFano.prototype.encode=function(list){var lastDocID=0,buffer1=0,bufferLength1=0,buffer2=0,bufferLength2=0;if(0==list.length)return result;function toByte(n){return 255&n}var compressedBufferPointer1=0,compressedBufferPointer2=0,averageDelta=list[list.length-1]/list.length,averageDeltaLog=Math.log2(averageDelta),lowBitsLength=Math.floor(averageDeltaLog),lowBitsMask=(1<<lowBitsLength)-1,prev=null,maxCompressedSize=Math.floor((2+Math.ceil(Math.log2(averageDelta)))*list.length/8)+6,compressedBuffer=new Uint8Array(maxCompressedSize);lowBitsLength<0&&(lowBitsLength=0),compressedBufferPointer2=Math.floor(lowBitsLength*list.length/8+6),compressedBuffer[compressedBufferPointer1++]=toByte(list.length),compressedBuffer[compressedBufferPointer1++]=toByte(list.length>>8),compressedBuffer[compressedBufferPointer1++]=toByte(list.length>>16),compressedBuffer[compressedBufferPointer1++]=toByte(list.length>>24),compressedBuffer[compressedBufferPointer1++]=toByte(lowBitsLength),list.forEach(function(docID){var docIDDelta=docID-lastDocID-1;if(!$.isNumeric(docID))throw new Error("Value is not numeric");if(docID=parseInt(docID),null!==prev&&docID<=prev)throw new Error("Elias Fano encoding can only be used on a sorted, ascending list of unique integers.");for(prev=docID,buffer1<<=lowBitsLength,buffer1|=docIDDelta&lowBitsMask,bufferLength1+=lowBitsLength;7<bufferLength1;)bufferLength1-=8,compressedBuffer[compressedBufferPointer1++]=toByte(buffer1>>bufferLength1);var unaryCodeLength=1+(docIDDelta>>lowBitsLength);for(buffer2<<=unaryCodeLength,buffer2|=1,bufferLength2+=unaryCodeLength;7<bufferLength2;)bufferLength2-=8,compressedBuffer[compressedBufferPointer2++]=toByte(buffer2>>bufferLength2);lastDocID=docID}),0<bufferLength1&&(compressedBuffer[compressedBufferPointer1++]=toByte(buffer1<<8-bufferLength1)),0<bufferLength2&&(compressedBuffer[compressedBufferPointer2++]=toByte(buffer2<<8-bufferLength2));var result=new Uint8Array(compressedBuffer);return result.pointer=compressedBufferPointer2,result},WPGMZA.EliasFano.prototype.decode=function(compressedBuffer){var resultPointer=0,list=[],decodingTableHighBits=WPGMZA.EliasFano.decodingTableHighBits,decodingTableDocIDNumber=WPGMZA.EliasFano.decodingTableDocIDNumber,decodingTableHighBitsCarryover=WPGMZA.EliasFano.decodingTableHighBitsCarryover,lowBitsPointer=0,lastDocID=0,docID=0,docIDNumber=0,listCount=compressedBuffer[lowBitsPointer++];listCount|=compressedBuffer[lowBitsPointer++]<<8,listCount|=compressedBuffer[lowBitsPointer++]<<16,listCount|=compressedBuffer[lowBitsPointer++]<<24;var highBitsPointer,lowBitsLength=compressedBuffer[lowBitsPointer++],lowBitsCount=0,lowBits=0,cb=1;for(highBitsPointer=Math.floor(lowBitsLength*listCount/8+6);highBitsPointer<compressedBuffer.pointer;highBitsPointer++){docID+=decodingTableHighBitsCarryover[cb],docIDNumber=decodingTableDocIDNumber[cb=compressedBuffer[highBitsPointer]];for(var i=0;i<docIDNumber;i++){for(docID<<=lowBitsCount,docID|=lowBits&(1<<lowBitsCount)-1;lowBitsCount<lowBitsLength;)docID<<=8,docID|=lowBits=compressedBuffer[lowBitsPointer++],lowBitsCount+=8;docID>>=lowBitsCount-=lowBitsLength,docID+=(decodingTableHighBits[cb][i]<<lowBitsLength)+lastDocID+1,lastDocID=list[resultPointer++]=docID,docID=0}}return list}}),jQuery(function($){WPGMZA.EventDispatcher=function(){WPGMZA.assertInstanceOf(this,"EventDispatcher"),this._listenersByType={}},WPGMZA.EventDispatcher.prototype.addEventListener=function(type,listener,thisObject,useCapture){var types=type.split(/\s+/);if(1<types.length)for(var i=0;i<types.length;i++)this.addEventListener(types[i],listener,thisObject,useCapture);else{if(!(listener instanceof Function))throw new Error("Listener must be a function");var target;target=this._listenersByType.hasOwnProperty(type)?this._listenersByType[type]:this._listenersByType[type]=[];var obj={listener:listener,thisObject:thisObject||this,useCapture:!!useCapture};target.push(obj)}},WPGMZA.EventDispatcher.prototype.on=WPGMZA.EventDispatcher.prototype.addEventListener,WPGMZA.EventDispatcher.prototype.removeEventListener=function(type,listener,thisObject,useCapture){var arr,obj;if(arr=this._listenersByType[type]){thisObject=thisObject||this,useCapture=!!useCapture;for(var i=0;i<arr.length;i++)if(obj=arr[i],(1==arguments.length||obj.listener==listener)&&obj.thisObject==thisObject&&obj.useCapture==useCapture)return void arr.splice(i,1)}},WPGMZA.EventDispatcher.prototype.off=WPGMZA.EventDispatcher.prototype.removeEventListener,WPGMZA.EventDispatcher.prototype.hasEventListener=function(type){return!!_listenersByType[type]},WPGMZA.EventDispatcher.prototype.dispatchEvent=function(event){if(!(event instanceof WPGMZA.Event))if("string"==typeof event)event=new WPGMZA.Event(event);else{var src=event;for(var name in event=new WPGMZA.Event,src)event[name]=src[name]}for(var path=[],obj=(event.target=this).parent;null!=obj;obj=obj.parent)path.unshift(obj);event.phase=WPGMZA.Event.CAPTURING_PHASE;for(var i=0;i<path.length&&!event._cancelled;i++)path[i]._triggerListeners(event);if(!event._cancelled){for(event.phase=WPGMZA.Event.AT_TARGET,this._triggerListeners(event),event.phase=WPGMZA.Event.BUBBLING_PHASE,i=path.length-1;0<=i&&!event._cancelled;i--)path[i]._triggerListeners(event);var topMostElement=this.element;for(obj=this.parent;null!=obj;obj=obj.parent)obj.element&&(topMostElement=obj.element);if(topMostElement){var customEvent={};for(var key in event){var value=event[key];"type"==key&&(value+=".wpgmza"),customEvent[key]=value}$(topMostElement).trigger(customEvent)}}},WPGMZA.EventDispatcher.prototype.trigger=WPGMZA.EventDispatcher.prototype.dispatchEvent,WPGMZA.EventDispatcher.prototype._triggerListeners=function(event){var arr,obj;if(arr=this._listenersByType[event.type])for(var i=0;i<arr.length;i++)obj=arr[i],event.phase==WPGMZA.Event.CAPTURING_PHASE&&!obj.useCapture||obj.listener.call(arr[i].thisObject,event)},WPGMZA.events=new WPGMZA.EventDispatcher}),jQuery(function($){WPGMZA.AddressInput=function(element,map){if(!(element instanceof HTMLInputElement))throw new Error("Element is not an instance of HTMLInputElement");var json;this.element=element;var options={fields:["name","formatted_address"],types:["geocode","establishment"]};(json=$(element).attr("data-autocomplete-options"))&&(options=$.extend(options,JSON.parse(json))),map&&map.settings.wpgmza_store_locator_restrict&&(options.country=map.settings.wpgmza_store_locator_restrict),WPGMZA.isGoogleAutocompleteSupported()?"wpgmza_add_address_map_editor"!=this.id&&WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey&&(element.googleAutoComplete=new google.maps.places.Autocomplete(element,options),options.country&&element.googleAutoComplete.setComponentRestrictions({country:options.country})):WPGMZA.CloudAPI&&WPGMZA.CloudAPI.isBeingUsed&&(element.cloudAutoComplete=new WPGMZA.CloudAutocomplete(element,options))},WPGMZA.extend(WPGMZA.AddressInput,WPGMZA.EventDispatcher),WPGMZA.AddressInput.createInstance=function(element,map){return new WPGMZA.AddressInput(element,map)}}),jQuery(function($){WPGMZA.DrawingManager=function(map){WPGMZA.assertInstanceOf(this,"DrawingManager"),WPGMZA.EventDispatcher.call(this),this.map=map,this.mode=WPGMZA.DrawingManager.MODE_NONE},WPGMZA.DrawingManager.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.DrawingManager.prototype.constructor=WPGMZA.DrawingManager,WPGMZA.DrawingManager.MODE_NONE=null,WPGMZA.DrawingManager.MODE_MARKER="marker",WPGMZA.DrawingManager.MODE_POLYGON="polygon",WPGMZA.DrawingManager.MODE_POLYLINE="polyline",WPGMZA.DrawingManager.MODE_CIRCLE="circle",WPGMZA.DrawingManager.MODE_RECTANGLE="rectangle",WPGMZA.DrawingManager.MODE_HEATMAP="heatmap",WPGMZA.DrawingManager.getConstructor=function(){switch(WPGMZA.settings.engine){case"google-maps":return WPGMZA.GoogleDrawingManager;default:return WPGMZA.OLDrawingManager}},WPGMZA.DrawingManager.createInstance=function(map){return new(WPGMZA.DrawingManager.getConstructor())(map)},WPGMZA.DrawingManager.prototype.setDrawingMode=function(mode){this.mode=mode,this.trigger("drawingmodechanged")}}),jQuery(function($){WPGMZA.Event=function(options){if("string"==typeof options&&(this.type=options),this.bubbles=!0,this.cancelable=!0,this.phase=WPGMZA.Event.PHASE_CAPTURE,this.target=null,this._cancelled=!1,"object"==typeof options)for(var name in options)this[name]=options[name]},WPGMZA.Event.CAPTURING_PHASE=0,WPGMZA.Event.AT_TARGET=1,WPGMZA.Event.BUBBLING_PHASE=2,WPGMZA.Event.prototype.stopPropagation=function(){this._cancelled=!0}}),jQuery(function($){WPGMZA.FancyControls={formatToggleSwitch:function(el){var div=$("<div class='switch'></div>"),input=el,container=el.parentNode,text=$(container).text().trim(),label=$("<label></label>");$(input).addClass("cmn-toggle cmn-toggle-round-flat"),$(input).attr("id",$(input).attr("name")),$(label).attr("for",$(input).attr("name")),$(div).append(input),$(div).append(label),$(container).replaceWith(div),$(div).wrap($("<div></div>")),$(div).after(text)},formatToggleButton:function(el){var div=$("<div class='switch'></div>"),input=el,container=el.parentNode,text=$(container).text().trim(),label=$("<label></label>");$(input).addClass("cmn-toggle cmn-toggle-yes-no"),$(input).attr("id",$(input).attr("name")),$(label).attr("for",$(input).attr("name")),$(label).attr("data-on",WPGMZA.localized_strings.yes),$(label).attr("data-off",WPGMZA.localized_strings.no),$(div).append(input),$(div).append(label),$(container).replaceWith(div),$(div).wrap($("<div></div>")),$(div).after(text)}},$(".wpgmza-fancy-toggle-switch").each(function(index,el){WPGMZA.FancyControls.formatToggleSwitch(el)}),$(".wpgmza-fancy-toggle-button").each(function(index,el){WPGMZA.FancyControls.formatToggleButton(el)})}),jQuery(function($){WPGMZA.Feature=function(options){for(var key in WPGMZA.assertInstanceOf(this,"Feature"),WPGMZA.EventDispatcher.call(this),this.id=-1,options)this[key]=options[key]},WPGMZA.extend(WPGMZA.Feature,WPGMZA.EventDispatcher),WPGMZA.MapObject=WPGMZA.Feature,WPGMZA.Feature.prototype.parseGeometry=function(subject){if("string"==typeof subject&&subject.match(/^\[/))try{subject=JSON.parse(subject)}catch(e){}if("object"==typeof subject){for(var arr=subject,i=0;i<arr.length;i++)arr[i].lat=parseFloat(arr[i].lat),arr[i].lng=parseFloat(arr[i].lng);return arr}if("string"!=typeof subject)throw new Error("Invalid geometry");var pairs,coords,results=[];pairs=subject.replace(/[^ ,\d\.\-+e]/g,"").split(",");for(i=0;i<pairs.length;i++)coords=pairs[i].split(" "),results.push({lat:parseFloat(coords[1]),lng:parseFloat(coords[0])});return results},WPGMZA.Feature.prototype.setOptions=function(options){for(var key in options)this[key]=options[key];this.updateNativeFeature()},WPGMZA.Feature.prototype.setEditable=function(editable){this.setOptions({editable:editable})},WPGMZA.Feature.prototype.setDraggable=function(draggable){this.setOptions({draggable:draggable})},WPGMZA.Feature.prototype.getScalarProperties=function(){var options={};for(var key in this)switch(typeof this[key]){case"number":options[key]=parseFloat(this[key]);break;case"boolean":case"string":options[key]=this[key]}return options},WPGMZA.Feature.prototype.updateNativeFeature=function(){var props=this.getScalarProperties();switch(WPGMZA.settings.engine){case"open-layers":this.layer&&this.layer.setStyle(WPGMZA.OLFeature.getOLStyle(props));break;default:this.googleFeature.setOptions(props)}}}),jQuery(function($){var Parent=WPGMZA.Feature;WPGMZA.Circle=function(options,engineCircle){WPGMZA.assertInstanceOf(this,"Circle"),this.center=new WPGMZA.LatLng,this.radius=100,Parent.apply(this,arguments)},WPGMZA.extend(WPGMZA.Circle,WPGMZA.Feature),Object.defineProperty(WPGMZA.Circle.prototype,"fillColor",{enumerable:!0,get:function(){return this.color&&this.color.length?this.color:"#ff0000"},set:function(a){this.color=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity||0==this.opacity?parseFloat(this.opacity):.5},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"strokeColor",{enumerable:!0,get:function(){return this.lineColor?this.lineColor:"#000000"},set:function(a){this.lineColor=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.lineOpacity||0==this.lineOpacity?parseFloat(this.lineOpacity):0},set:function(a){this.lineOpacity=a}}),WPGMZA.Circle.createInstance=function(options,engineCircle){var constructor;switch(WPGMZA.settings.engine){case"open-layers":constructor=WPGMZA.OLCircle;break;default:constructor=WPGMZA.GoogleCircle}return new constructor(options,engineCircle)},WPGMZA.Circle.prototype.getCenter=function(){return this.center.clone()},WPGMZA.Circle.prototype.setCenter=function(latLng){this.center.lat=latLng.lat,this.center.lng=latLng.lng},WPGMZA.Circle.prototype.getRadius=function(){return this.radius},WPGMZA.Circle.prototype.setRadius=function(radius){this.radius=radius},WPGMZA.Circle.prototype.getMap=function(){return this.map},WPGMZA.Circle.prototype.setMap=function(map){this.map&&this.map.removeCircle(this),map&&map.addCircle(this)}}),jQuery(function($){WPGMZA.FriendlyError=function(){}}),jQuery(function($){WPGMZA.Geocoder=function(){WPGMZA.assertInstanceOf(this,"Geocoder")},WPGMZA.Geocoder.SUCCESS="success",WPGMZA.Geocoder.ZERO_RESULTS="zero-results",WPGMZA.Geocoder.FAIL="fail",WPGMZA.Geocoder.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.OLGeocoder;default:return WPGMZA.GoogleGeocoder}},WPGMZA.Geocoder.createInstance=function(){return new(WPGMZA.Geocoder.getConstructor())},WPGMZA.Geocoder.prototype.getLatLngFromAddress=function(options,callback){if(WPGMZA.isLatLngString(options.address)){var parts=options.address.split(/,\s*/),latLng=new WPGMZA.LatLng({lat:parseFloat(parts[0]),lng:parseFloat(parts[1])});callback([latLng.latLng=latLng],WPGMZA.Geocoder.SUCCESS)}},WPGMZA.Geocoder.prototype.getAddressFromLatLng=function(options,callback){callback([new WPGMZA.LatLng(options.latLng).toString()],WPGMZA.Geocoder.SUCCESS)},WPGMZA.Geocoder.prototype.geocode=function(options,callback){if("address"in options)return this.getLatLngFromAddress(options,callback);if("latLng"in options)return this.getAddressFromLatLng(options,callback);throw new Error("You must supply either a latLng or address")}}),jQuery(function($){WPGMZA.GoogleAPIErrorHandler=function(){var self=this;if("google-maps"==WPGMZA.settings.engine&&("map-edit"==WPGMZA.currentPage||0==WPGMZA.is_admin&&1==WPGMZA.userCanAdministrator)){this.element=$(WPGMZA.html.googleMapsAPIErrorDialog),1==WPGMZA.is_admin&&this.element.find(".wpgmza-front-end-only").remove(),this.errorMessageList=this.element.find(".wpgmza-google-api-error-list"),this.templateListItem=this.element.find("li.template").remove(),this.messagesAlreadyDisplayed={};var _error=console.error;console.error=function(message){self.onErrorMessage(message),_error.apply(this,arguments)},"google-maps"!=WPGMZA.settings.engine||WPGMZA.settings.wpgmza_google_maps_api_key&&WPGMZA.settings.wpgmza_google_maps_api_key.length||WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_EDIT||this.addErrorMessage(WPGMZA.localized_strings.no_google_maps_api_key,["https://www.wpgmaps.com/documentation/creating-a-google-maps-api-key/"])}},WPGMZA.GoogleAPIErrorHandler.prototype.onErrorMessage=function(message){var m;if(message)if((m=message.match(/You have exceeded your (daily )?request quota for this API/))||(m=message.match(/This API project is not authorized to use this API/))||(m=message.match(/^Geocoding Service: .+/))){var urls=message.match(/http(s)?:\/\/[^\s]+/gm);this.addErrorMessage(m[0],urls)}else(m=message.match(/^Google Maps.+error: (.+)\s+(http(s?):\/\/.+)/m))&&this.addErrorMessage(m[1].replace(/([A-Z])/g," $1"),[m[2]])},WPGMZA.GoogleAPIErrorHandler.prototype.addErrorMessage=function(message,urls){var self=this;if(!this.messagesAlreadyDisplayed[message]){var li=this.templateListItem.clone();$(li).find(".wpgmza-message").html(message);var buttonContainer=$(li).find(".wpgmza-documentation-buttons"),buttonTemplate=$(li).find(".wpgmza-documentation-buttons>a");if(buttonTemplate.remove(),urls&&urls.length){for(var i=0;i<urls.length;i++){urls[i];var button=buttonTemplate.clone(),text=WPGMZA.localized_strings.documentation;button.attr("href",urls[i]),$(button).find("i").addClass("fa-external-link"),$(button).append(text)}buttonContainer.append(button)}$(this.errorMessageList).append(li),$("#wpgmza_map, .wpgmza_map").each(function(index,el){var container=$(el).find(".wpgmza-google-maps-api-error-overlay");0==container.length&&(container=$("<div class='wpgmza-google-maps-api-error-overlay'></div>")).html(self.element.html()),setTimeout(function(){$(el).append(container)},1e3)}),$(".gm-err-container").parent().css({"z-index":1}),this.messagesAlreadyDisplayed[message]=!0}},WPGMZA.googleAPIErrorHandler=new WPGMZA.GoogleAPIErrorHandler}),jQuery(function($){WPGMZA.InfoWindow=function(feature){var self=this;WPGMZA.EventDispatcher.call(this),WPGMZA.assertInstanceOf(this,"InfoWindow"),this.on("infowindowopen",function(event){self.onOpen(event)}),feature&&(this.feature=feature,this.state=WPGMZA.InfoWindow.STATE_CLOSED,feature.map?setTimeout(function(){self.onFeatureAdded(event)},100):feature.addEventListener("added",function(event){self.onFeatureAdded(event)}))},WPGMZA.InfoWindow.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.InfoWindow.prototype.constructor=WPGMZA.InfoWindow,WPGMZA.InfoWindow.OPEN_BY_CLICK=1,WPGMZA.InfoWindow.OPEN_BY_HOVER=2,WPGMZA.InfoWindow.STATE_OPEN="open",WPGMZA.InfoWindow.STATE_CLOSED="closed",WPGMZA.InfoWindow.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.isProVersion()?WPGMZA.OLProInfoWindow:WPGMZA.OLInfoWindow;default:return WPGMZA.isProVersion()?WPGMZA.GoogleProInfoWindow:WPGMZA.GoogleInfoWindow}},WPGMZA.InfoWindow.createInstance=function(feature){return new(this.getConstructor())(feature)},Object.defineProperty(WPGMZA.InfoWindow.prototype,"content",{get:function(){return this.getContent()},set:function(value){this.contentHtml=value}}),WPGMZA.InfoWindow.prototype.addEditButton=function(){return"map-edit"==WPGMZA.currentPage&&this.feature instanceof WPGMZA.Marker?' <a title="Edit this marker" style="width:15px;" class="wpgmza_edit_btn" data-edit-marker-id="'+this.feature.id+'"><i class="fa fa-edit"></i></a>':""},WPGMZA.InfoWindow.prototype.workOutDistanceBetweenTwoMarkers=function(location1,location2){if(location1&&location2){var distanceToDisplay=WPGMZA.Distance.between(location1,location2);return this.distanceUnits==WPGMZA.Distance.MILES&&(distanceToDisplay/=WPGMZA.Distance.KILOMETERS_PER_MILE),Math.round(distanceToDisplay,2)}},WPGMZA.InfoWindow.prototype.getContent=function(callback){var html="",extra_html="";if(this.feature instanceof WPGMZA.Marker){if(this.feature.map.settings.store_locator_show_distance&&this.feature.map.storeLocator&&this.feature.map.storeLocator.state==WPGMZA.StoreLocator.STATE_APPLIED){var currentLatLng=this.feature.getPosition(),distance=this.workOutDistanceBetweenTwoMarkers(this.feature.map.storeLocator.center,currentLatLng);extra_html+="<p>"+(this.feature.map.settings.store_locator_distance==WPGMZA.Distance.KILOMETERS?distance+WPGMZA.localized_strings.kilometers_away:distance+" "+WPGMZA.localized_strings.miles_away)+"</p>"}html=this.feature.address+extra_html}return this.contentHtml&&(html=this.contentHtml),callback&&callback(html),html},WPGMZA.InfoWindow.prototype.open=function(map,feature){return this.feature=feature,!WPGMZA.settings.disable_infowindows&&"1"!=WPGMZA.settings.wpgmza_settings_disable_infowindows&&(!this.feature.disableInfoWindow&&(this.state=WPGMZA.InfoWindow.STATE_OPEN,!0))},WPGMZA.InfoWindow.prototype.close=function(){this.state!=WPGMZA.InfoWindow.STATE_CLOSED&&(this.state=WPGMZA.InfoWindow.STATE_CLOSED,this.trigger("infowindowclose"))},WPGMZA.InfoWindow.prototype.setContent=function(options){},WPGMZA.InfoWindow.prototype.setOptions=function(options){},WPGMZA.InfoWindow.prototype.onFeatureAdded=function(){1==this.feature.settings.infoopen&&this.open()},WPGMZA.InfoWindow.prototype.onOpen=function(){}}),jQuery(function($){WPGMZA.LatLng=function(arg,lng){if(this._lat=0,(this._lng=0)!=arguments.length)if(1==arguments.length){if("string"==typeof arg){var m;if(!(m=arg.match(WPGMZA.LatLng.REGEXP)))throw new Error("Invalid LatLng string");arg={lat:m[1],lng:m[3]}}if("object"!=typeof arg||!("lat"in arg&&"lng"in arg))throw new Error("Argument must be a LatLng literal");this.lat=arg.lat,this.lng=arg.lng}else this.lat=arg,this.lng=lng},WPGMZA.LatLng.REGEXP=/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/,WPGMZA.LatLng.isValid=function(obj){return"object"==typeof obj&&("lat"in obj&&"lng"in obj)},WPGMZA.LatLng.isLatLngString=function(str){return"string"==typeof str&&!!str.match(WPGMZA.LatLng.REGEXP)},Object.defineProperty(WPGMZA.LatLng.prototype,"lat",{get:function(){return this._lat},set:function(val){if(!$.isNumeric(val))throw new Error("Latitude must be numeric");this._lat=parseFloat(val)}}),Object.defineProperty(WPGMZA.LatLng.prototype,"lng",{get:function(){return this._lng},set:function(val){if(!$.isNumeric(val))throw new Error("Longitude must be numeric");this._lng=parseFloat(val)}}),WPGMZA.LatLng.fromString=function(string){if(!WPGMZA.LatLng.isLatLngString(string))throw new Error("Not a valid latlng string");var m=string.match(WPGMZA.LatLng.REGEXP);return new WPGMZA.LatLng({lat:parseFloat(m[1]),lng:parseFloat(m[3])})},WPGMZA.LatLng.prototype.toString=function(){return this._lat+", "+this._lng},WPGMZA.LatLng.fromCurrentPosition=function(callback,options){options=options||{},callback&&WPGMZA.getCurrentPosition(function(position){var latLng=new WPGMZA.LatLng({lat:position.coords.latitude,lng:position.coords.longitude});options.geocodeAddress?WPGMZA.Geocoder.createInstance().getAddressFromLatLng({latLng:latLng},function(results){results.length&&(latLng.address=results[0]),callback(latLng)}):callback(latLng)})},WPGMZA.LatLng.fromGoogleLatLng=function(googleLatLng){return new WPGMZA.LatLng(googleLatLng.lat(),googleLatLng.lng())},WPGMZA.LatLng.toGoogleLatLngArray=function(arr){var result=[];return arr.forEach(function(nativeLatLng){if(!(nativeLatLng instanceof WPGMZA.LatLng||"lat"in nativeLatLng&&"lng"in nativeLatLng))throw new Error("Unexpected input");result.push(new google.maps.LatLng({lat:parseFloat(nativeLatLng.lat),lng:parseFloat(nativeLatLng.lng)}))}),result},WPGMZA.LatLng.prototype.toGoogleLatLng=function(){return new google.maps.LatLng({lat:this.lat,lng:this.lng})},WPGMZA.LatLng.prototype.toLatLngLiteral=function(){return{lat:this.lat,lng:this.lng}},WPGMZA.LatLng.prototype.moveByDistance=function(kilometers,heading){var delta=parseFloat(kilometers)/6371,theta=parseFloat(heading)/180*Math.PI,phi1=this.lat/180*Math.PI,lambda1=this.lng/180*Math.PI,sinPhi1=Math.sin(phi1),cosPhi1=Math.cos(phi1),sinDelta=Math.sin(delta),cosDelta=Math.cos(delta),sinTheta=Math.sin(theta),sinPhi2=sinPhi1*cosDelta+cosPhi1*sinDelta*Math.cos(theta),phi2=Math.asin(sinPhi2),y=sinTheta*sinDelta*cosPhi1,x=cosDelta-sinPhi1*sinPhi2,lambda2=lambda1+Math.atan2(y,x);this.lat=180*phi2/Math.PI,this.lng=180*lambda2/Math.PI},WPGMZA.LatLng.prototype.getGreatCircleDistance=function(arg1,arg2){var other,lat1=this.lat,lon1=this.lng;if(1==arguments.length)other=new WPGMZA.LatLng(arg1);else{if(2!=arguments.length)throw new Error("Invalid number of arguments");other=new WPGMZA.LatLng(arg1,arg2)}var lat2=other.lat,lon2=other.lng,phi1=lat1.toRadians(),phi2=lat2.toRadians(),deltaPhi=(lat2-lat1).toRadians(),deltaLambda=(lon2-lon1).toRadians(),a=Math.sin(deltaPhi/2)*Math.sin(deltaPhi/2)+Math.cos(phi1)*Math.cos(phi2)*Math.sin(deltaLambda/2)*Math.sin(deltaLambda/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}}),jQuery(function($){WPGMZA.LatLngBounds=function(southWest,northEast){if(southWest instanceof WPGMZA.LatLngBounds){var other=southWest;this.south=other.south,this.north=other.north,this.west=other.west,this.east=other.east}else southWest&&northEast&&(this.south=southWest.lat,this.north=northEast.lat,this.west=southWest.lng,this.east=northEast.lng)},WPGMZA.LatLngBounds.fromGoogleLatLngBounds=function(googleLatLngBounds){if(!(googleLatLngBounds instanceof google.maps.LatLngBounds))throw new Error("Argument must be an instance of google.maps.LatLngBounds");var result=new WPGMZA.LatLngBounds,southWest=googleLatLngBounds.getSouthWest(),northEast=googleLatLngBounds.getNorthEast();return result.north=northEast.lat(),result.south=southWest.lat(),result.west=southWest.lng(),result.east=northEast.lng(),result},WPGMZA.LatLngBounds.fromGoogleLatLngBoundsLiteral=function(obj){var result=new WPGMZA.LatLngBounds,southWest=obj.southwest,northEast=obj.northeast;return result.north=northEast.lat,result.south=southWest.lat,result.west=southWest.lng,result.east=northEast.lng,result},WPGMZA.LatLngBounds.prototype.isInInitialState=function(){return null==this.north&&null==this.south&&null==this.west&&null==this.east},WPGMZA.LatLngBounds.prototype.extend=function(latLng){if(latLng instanceof WPGMZA.LatLng||(latLng=new WPGMZA.LatLng(latLng)),this.isInInitialState())return this.north=this.south=latLng.lat,void(this.west=this.east=latLng.lng);latLng.lat<this.north&&(this.north=latLng.lat),latLng.lat>this.south&&(this.south=latLng.lat),latLng.lng<this.west&&(this.west=latLng.lng),latLng.lng>this.east&&(this.east=latLng.lng)},WPGMZA.LatLngBounds.prototype.extendByPixelMargin=function(map,x,arg){var y=x;if(!(map instanceof WPGMZA.Map))throw new Error("First argument must be an instance of WPGMZA.Map");if(this.isInInitialState())throw new Error("Cannot extend by pixels in initial state");3<=arguments.length&&(y=arg);var southWest=new WPGMZA.LatLng(this.south,this.west),northEast=new WPGMZA.LatLng(this.north,this.east);southWest=map.latLngToPixels(southWest),northEast=map.latLngToPixels(northEast),southWest.x-=x,southWest.y+=y,northEast.x+=x,northEast.y-=y,southWest=map.pixelsToLatLng(southWest.x,southWest.y),northEast=map.pixelsToLatLng(northEast.x,northEast.y);this.toString();this.north=northEast.lat,this.south=southWest.lat,this.west=southWest.lng,this.east=northEast.lng},WPGMZA.LatLngBounds.prototype.contains=function(latLng){if(!(latLng instanceof WPGMZA.LatLng))throw new Error("Argument must be an instance of WPGMZA.LatLng");return!(latLng.lat<Math.min(this.north,this.south))&&(!(latLng.lat>Math.max(this.north,this.south))&&(this.west<this.east?latLng.lng>=this.west&&latLng.lng<=this.east:latLng.lng<=this.west||latLng.lng>=this.east))},WPGMZA.LatLngBounds.prototype.toString=function(){return this.north+"N "+this.south+"S "+this.west+"W "+this.east+"E"},WPGMZA.LatLngBounds.prototype.toLiteral=function(){return{north:this.north,south:this.south,west:this.west,east:this.east}}}),jQuery(function($){var legacyGlobals={marker_pull:"0",marker_array:[],MYMAP:[],infoWindow_poly:[],markerClusterer:[],heatmap:[],WPGM_Path:[],WPGM_Path_Polygon:[],WPGM_PathLine:[],WPGM_PathLineData:[],WPGM_PathData:[],original_iw:null,wpgmza_user_marker:null,wpgmaps_localize_marker_data:[],wpgmaps_localize_polygon_settings:[],wpgmaps_localize_heatmap_settings:[],wpgmaps_localize_polyline_settings:[],wpgmza_cirtcle_data_array:[],wpgmza_rectangle_data_array:[],wpgmzaForceLegacyMarkerClusterer:!1};function bindLegacyGlobalProperty(key){key in window?console.warn("Cannot redefine legacy global "+key):Object.defineProperty(window,key,{get:function(){return console.warn("This property is deprecated and should no longer be used"),legacyGlobals[key]},set:function(value){console.warn("This property is deprecated and should no longer be used"),legacyGlobals[key]=value}})}for(var key in legacyGlobals)bindLegacyGlobalProperty(key);WPGMZA.legacyGlobals=legacyGlobals,window.InitMap=window.resetLocations=window.searchLocations=window.fillInAddress=window.searchLocationsNear=function(){console.warn("This function is deprecated and should no longer be used")}}),jQuery(function($){WPGMZA.MapListPage=function(){$("body").on("click",".wpgmza_copy_shortcode",function(){var $temp=jQuery("<input>");jQuery('<span id="wpgmza_tmp" style="display:none; width:100%; text-align:center;">');jQuery("body").append($temp),$temp.val(jQuery(this).val()).select(),document.execCommand("copy"),$temp.remove(),WPGMZA.notification("Shortcode Copied")})},WPGMZA.MapListPage.createInstance=function(){return new WPGMZA.MapListPage},$(document).ready(function(event){WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_LIST&&(WPGMZA.mapListPage=WPGMZA.MapListPage.createInstance())})}),jQuery(function($){WPGMZA.MapSettings=function(element){var json,self=this,str=element.getAttribute("data-settings");try{json=JSON.parse(str)}catch(e){str=(str=str.replace(/\\%/g,"%")).replace(/\\\\"/g,'\\"');try{json=JSON.parse(str)}catch(e){json={},console.warn("Failed to parse map settings JSON")}}function addSettings(input){if(input)for(var key in input)if("other_settings"!=key){var value=input[key];String(value).match(/^-?\d+$/)&&(value=parseInt(value)),self[key]=value}}WPGMZA.assertInstanceOf(this,"MapSettings"),addSettings(WPGMZA.settings),addSettings(json),json&&json.other_settings&&addSettings(json.other_settings)},WPGMZA.MapSettings.prototype.toOLViewOptions=function(){var self=this,options={center:ol.proj.fromLonLat([-119.4179,36.7783]),zoom:4};function empty(name){return"object"!=typeof self[name]&&(!self[name]||!self[name].length)}if("string"==typeof this.start_location){var coords=this.start_location.replace(/^\(|\)$/g,"").split(",");WPGMZA.isLatLngString(this.start_location)?options.center=ol.proj.fromLonLat([parseFloat(coords[1]),parseFloat(coords[0])]):console.warn("Invalid start location")}return this.center&&(options.center=ol.proj.fromLonLat([parseFloat(this.center.lng),parseFloat(this.center.lat)])),empty("map_start_lat")||empty("map_start_lng")||(options.center=ol.proj.fromLonLat([parseFloat(this.map_start_lng),parseFloat(this.map_start_lat)])),this.zoom&&(options.zoom=parseInt(this.zoom)),this.start_zoom&&(options.zoom=parseInt(this.start_zoom)),this.map_start_zoom&&(options.zoom=parseInt(this.map_start_zoom)),this.map_min_zoom&&this.map_max_zoom&&(options.minZoom=Math.min(this.map_min_zoom,this.map_max_zoom),options.maxZoom=Math.max(this.map_min_zoom,this.map_max_zoom)),options},WPGMZA.MapSettings.prototype.toGoogleMapsOptions=function(){var self=this,latLngCoords=this.start_location&&this.start_location.length?this.start_location.split(","):[36.7783,-119.4179];function empty(name){return"object"!=typeof self[name]&&(!self[name]||!self[name].length)}function formatCoord(coord){return $.isNumeric(coord)?coord:parseFloat(String(coord).replace(/[\(\)\s]/,""))}var latLng=new google.maps.LatLng(formatCoord(latLngCoords[0]),formatCoord(latLngCoords[1])),zoom=this.start_zoom?parseInt(this.start_zoom):4;!this.start_zoom&&this.zoom&&(zoom=parseInt(this.zoom)),this.map_start_zoom&&(zoom=parseInt(this.map_start_zoom));var options={zoom:zoom,center:latLng};function isSettingDisabled(value){return"yes"===value||!!value}switch(empty("center")||(options.center=new google.maps.LatLng({lat:parseFloat(this.center.lat),lng:parseFloat(this.center.lng)})),empty("map_start_lat")||empty("map_start_lng")||(options.center=new google.maps.LatLng({lat:parseFloat(this.map_start_lat),lng:parseFloat(this.map_start_lng)})),this.map_min_zoom&&this.map_max_zoom&&(options.minZoom=Math.min(this.map_min_zoom,this.map_max_zoom),options.maxZoom=Math.max(this.map_min_zoom,this.map_max_zoom)),options.zoomControl=!isSettingDisabled(this.wpgmza_settings_map_zoom),options.panControl=!isSettingDisabled(this.wpgmza_settings_map_pan),options.mapTypeControl=!isSettingDisabled(this.wpgmza_settings_map_type),options.streetViewControl=!isSettingDisabled(this.wpgmza_settings_map_streetview),options.fullscreenControl=!isSettingDisabled(this.wpgmza_settings_map_full_screen_control),options.draggable=!isSettingDisabled(this.wpgmza_settings_map_draggable),options.disableDoubleClickZoom=isSettingDisabled(this.wpgmza_settings_map_clickzoom),isSettingDisabled(this.wpgmza_settings_map_tilt_controls)&&(options.rotateControl=!1,options.tilt=0),this.wpgmza_settings_map_scroll&&(options.scrollwheel=!1),"greedy"==this.wpgmza_force_greedy_gestures||"yes"==this.wpgmza_force_greedy_gestures||1==this.wpgmza_force_greedy_gestures?(options.gestureHandling="greedy",!this.wpgmza_settings_map_scroll&&"scrollwheel"in options&&delete options.scrollwheel):options.gestureHandling="cooperative",parseInt(this.type)){case 2:options.mapTypeId=google.maps.MapTypeId.SATELLITE;break;case 3:options.mapTypeId=google.maps.MapTypeId.HYBRID;break;case 4:options.mapTypeId=google.maps.MapTypeId.TERRAIN;break;default:options.mapTypeId=google.maps.MapTypeId.ROADMAP}return this.wpgmza_theme_data&&this.wpgmza_theme_data.length&&(options.styles=WPGMZA.GoogleMap.parseThemeData(this.wpgmza_theme_data)),options}}),jQuery(function($){WPGMZA.Map=function(element,options){var self=this;if(WPGMZA.assertInstanceOf(this,"Map"),WPGMZA.EventDispatcher.call(this),!(element instanceof HTMLElement))throw new Error("Argument must be a HTMLElement");if(element.hasAttribute("data-map-id")?this.id=element.getAttribute("data-map-id"):this.id=1,!/\d+/.test(this.id))throw new Error("Map ID must be an integer");if(WPGMZA.maps.push(this),this.element=element,this.element.wpgmzaMap=this,$(this.element).addClass("wpgmza-initialized"),this.engineElement=element,this.markers=[],this.polygons=[],this.polylines=[],this.circles=[],this.rectangles=[],this.loadSettings(options),this.shortcodeAttributes={},$(this.element).attr("data-shortcode-attributes"))try{this.shortcodeAttributes=JSON.parse($(this.element).attr("data-shortcode-attributes")),this.shortcodeAttributes.zoom&&(this.settings.map_start_zoom=parseInt(this.shortcodeAttributes.zoom))}catch(e){console.warn("Error parsing shortcode attributes")}WPGMZA.getCurrentPage()!=WPGMZA.PAGE_MAP_EDIT&&this.initStoreLocator(),this.setDimensions(),this.setAlignment(),this.markerFilter=WPGMZA.MarkerFilter.createInstance(this),WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code&&($(element).append($(WPGMZA.api_consent_html)),$(element).css({height:"auto"})),this.on("init",function(event){self.onInit(event)}),this.on("click",function(event){self.onClick(event)}),WPGMZA.useLegacyGlobals&&(wpgmzaLegacyGlobals.MYMAP[this.id]={map:null,bounds:null,mc:null},wpgmzaLegacyGlobals.MYMAP.init=wpgmzaLegacyGlobals.MYMAP[this.id].init=wpgmzaLegacyGlobals.MYMAP.placeMarkers=wpgmzaLegacyGlobals.MYMAP[this.id].placeMarkers=function(){console.warn("This function is deprecated and should no longer be used")})},WPGMZA.Map.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.Map.prototype.constructor=WPGMZA.Map,WPGMZA.Map.nightTimeThemeData=[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"landscape",elementType:"geometry.fill",stylers:[{color:"#575663"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#80823e"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"geometry.fill",stylers:[{color:"#1b737a"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}],WPGMZA.Map.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.isProVersion()?WPGMZA.OLProMap:WPGMZA.OLMap;default:return WPGMZA.isProVersion()?WPGMZA.GoogleProMap:WPGMZA.GoogleMap}},WPGMZA.Map.createInstance=function(element,options){return new(WPGMZA.Map.getConstructor())(element,options)},Object.defineProperty(WPGMZA.Map.prototype,"markersPlaced",{get:function(){return this._markersPlaced},set:function(value){throw new Error("Value is read only")}}),Object.defineProperty(WPGMZA.Map.prototype,"lat",{get:function(){return this.getCenter().lat},set:function(value){var center=this.getCenter();center.lat=value,this.setCenter(center)}}),Object.defineProperty(WPGMZA.Map.prototype,"lng",{get:function(){return this.getCenter().lng},set:function(value){var center=this.getCenter();center.lng=value,this.setCenter(center)}}),Object.defineProperty(WPGMZA.Map.prototype,"zoom",{get:function(){return this.getZoom()},set:function(value){this.setZoom(value)}}),WPGMZA.Map.prototype.onInit=function(event){this.initPreloader(),"autoFetchFeatures"in this.settings&&!1===this.settings.autoFetchFeatures||this.fetchFeatures()},WPGMZA.Map.prototype.initPreloader=function(){this.preloader=$(WPGMZA.preloaderHTML),$(this.preloader).hide(),$(this.element).append(this.preloader)},WPGMZA.Map.prototype.showPreloader=function(show){show?$(this.preloader).show():$(this.preloader).hide()},WPGMZA.Map.prototype.loadSettings=function(options){var settings=new WPGMZA.MapSettings(this.element);settings.other_settings;if(delete settings.other_settings,options)for(var key in options)settings[key]=options[key];this.settings=settings},WPGMZA.Map.prototype.initStoreLocator=function(){var storeLocatorElement=$(".wpgmza_sl_main_div");storeLocatorElement.length&&(this.storeLocator=WPGMZA.StoreLocator.createInstance(this,storeLocatorElement[0]))},WPGMZA.Map.prototype.getFeatureArrays=function(){var arrays=WPGMZA.Map.prototype.getFeatureArrays.call(this);return arrays.heatmaps=this.heatmaps,arrays},WPGMZA.Map.prototype.setOptions=function(options){for(var name in options)this.settings[name]=options[name]},WPGMZA.Map.prototype.getRESTParameters=function(options){var defaults={};return options&&options.filter||(defaults.filter=JSON.stringify(this.markerFilter.getFilteringParameters())),$.extend(!0,defaults,options)},WPGMZA.Map.prototype.fetchFeaturesViaREST=function(){var data,self=this,filter=this.markerFilter.getFilteringParameters();if("1"==WPGMZA.is_admin&&(filter.includeUnapproved=!0,filter.excludeIntegrated=!0),this.shortcodeAttributes.acf_post_id&&(filter.acfPostID=this.shortcodeAttributes.acf_post_id),this.showPreloader(!0),this.fetchFeaturesXhr&&this.fetchFeaturesXhr.abort(),WPGMZA.settings.fetchMarkersBatchSize){var offset=0,limit=WPGMZA.settings.fetchMarkersBatchSize;!function fetchNextBatch(){filter.offset=offset,filter.limit=limit,data=this.getRESTParameters({filter:JSON.stringify(filter)}),self.fetchFeaturesXhr=WPGMZA.restAPI.call("/markers/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){result.length?(self.onMarkersFetched(result,!0),offset+=limit,fetchNextBatch()):(self.onMarkersFetched(result),data.exclude="markers",WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}}))}})}()}else data=this.getRESTParameters({filter:JSON.stringify(filter)}),this.fetchFeaturesXhr=WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}})},WPGMZA.Map.prototype.fetchFeaturesViaXML=function(){var self=this,urls=[WPGMZA.markerXMLPathURL+this.id+"markers.xml"];function fetchFeaturesExcludingMarkersViaREST(){var filter={map_id:this.id,mashup_ids:this.mashupIDs},data={filter:JSON.stringify(filter),exclude:"markers"};WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}})}if(this.mashupIDs&&this.mashupIDs.forEach(function(id){urls.push(WPGMZA.markerXMLPathURL+id+"markers.xml")}),urls=urls.filter(function(item,index){return urls.indexOf(item)==index}),window.Worker&&window.Blob&&window.URL&&WPGMZA.settings.enable_asynchronous_xml_parsing){var source=WPGMZA.loadXMLAsWebWorker.toString().replace(/function\(\)\s*{([\s\S]+)}/,"$1"),blob=new Blob([source],{type:"text/javascript"}),worker=new Worker(URL.createObjectURL(blob));worker.onmessage=function(event){self.onMarkersFetched(event.data),fetchFeaturesExcludingMarkersViaREST()},worker.postMessage({command:"load",protocol:window.location.protocol,urls:urls})}else for(var filesLoaded=0,converter=new WPGMZA.XMLCacheConverter,converted=[],i=0;i<urls.length;i++)$.ajax(urls[i],{success:function(response,status,xhr){converted=converted.concat(converter.convert(response)),++filesLoaded==urls.length&&(self.onMarkersFetched(converted),fetchFeaturesExcludingMarkersViaREST())}})},WPGMZA.Map.prototype.fetchFeatures=function(){WPGMZA.settings.wpgmza_settings_marker_pull!=WPGMZA.MARKER_PULL_XML||"1"==WPGMZA.is_admin?this.fetchFeaturesViaREST():this.fetchFeaturesViaXML()},WPGMZA.Map.prototype.onFeaturesFetched=function(data){for(var type in data.markers&&this.onMarkersFetched(data.markers),data)if("markers"!=type)for(var module=type.substr(0,1).toUpperCase()+type.substr(1).replace(/s$/,""),i=0;i<data[type].length;i++){var instance=WPGMZA[module].createInstance(data[type][i]);this["add"+module](instance)}},WPGMZA.Map.prototype.onMarkersFetched=function(data,expectMoreBatches){for(var self=this,startFiltered=this.shortcodeAttributes.cat&&this.shortcodeAttributes.cat.length,i=0;i<data.length;i++){var obj=data[i],marker=WPGMZA.Marker.createInstance(obj);startFiltered&&(marker.isFiltered=!0,marker.setVisible(!1)),this.addMarker(marker)}if(!expectMoreBatches){this.showPreloader(!1);var triggerEvent=function(){self._markersPlaced=!0,self.trigger("markersplaced"),self.off("filteringcomplete",triggerEvent)};if(this.shortcodeAttributes.cat){var categories=this.shortcodeAttributes.cat.split(","),select=$("select[mid='"+this.id+"'][name='wpgmza_filter_select']");for(i=0;i<categories.length;i++)$("input[type='checkbox'][mid='"+this.id+"'][value='"+categories[i]+"']").prop("checked",!0),select.val(categories[i]);this.on("filteringcomplete",triggerEvent),this.markerFilter.update({categories:categories})}else triggerEvent();if(this.shortcodeAttributes.markers){var arr=this.shortcodeAttributes.markers.split(","),markers=[];for(i=0;i<arr.length;i++){var id=arr[i];id=id.replace(" ","");marker=this.getMarkerByID(id);markers.push(marker)}this.fitMapBoundsToMarkers(markers)}}},WPGMZA.Map.prototype.fetchFeaturesViaXML=function(){var self=this,urls=[WPGMZA.markerXMLPathURL+this.id+"markers.xml"];function fetchFeaturesExcludingMarkersViaREST(){var filter={map_id:this.id,mashup_ids:this.mashupIDs},data={filter:JSON.stringify(filter),exclude:"markers"};WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}})}if(this.mashupIDs&&this.mashupIDs.forEach(function(id){urls.push(WPGMZA.markerXMLPathURL+id+"markers.xml")}),urls=urls.filter(function(item,index){return urls.indexOf(item)==index}),window.Worker&&window.Blob&&window.URL&&WPGMZA.settings.enable_asynchronous_xml_parsing){var source=WPGMZA.loadXMLAsWebWorker.toString().replace(/function\(\)\s*{([\s\S]+)}/,"$1"),blob=new Blob([source],{type:"text/javascript"}),worker=new Worker(URL.createObjectURL(blob));worker.onmessage=function(event){self.onMarkersFetched(event.data),fetchFeaturesExcludingMarkersViaREST()},worker.postMessage({command:"load",protocol:window.location.protocol,urls:urls})}else for(var filesLoaded=0,converter=new WPGMZA.XMLCacheConverter,converted=[],i=0;i<urls.length;i++)$.ajax(urls[i],{success:function(response,status,xhr){converted=converted.concat(converter.convert(response)),++filesLoaded==urls.length&&(self.onMarkersFetched(converted),fetchFeaturesExcludingMarkersViaREST())}})},WPGMZA.Map.prototype.fetchFeatures=function(){WPGMZA.settings.wpgmza_settings_marker_pull!=WPGMZA.MARKER_PULL_XML||"1"==WPGMZA.is_admin?this.fetchFeaturesViaREST():this.fetchFeaturesViaXML()},WPGMZA.Map.prototype.onFeaturesFetched=function(data){for(var type in data.markers&&this.onMarkersFetched(data.markers),data)if("markers"!=type)for(var module=type.substr(0,1).toUpperCase()+type.substr(1).replace(/s$/,""),i=0;i<data[type].length;i++){var instance=WPGMZA[module].createInstance(data[type][i]);this["add"+module](instance)}},WPGMZA.Map.prototype.onMarkersFetched=function(data,expectMoreBatches){for(var self=this,startFiltered=this.shortcodeAttributes.cat&&this.shortcodeAttributes.cat.length,i=0;i<data.length;i++){var obj=data[i],marker=WPGMZA.Marker.createInstance(obj);startFiltered&&(marker.isFiltered=!0,marker.setVisible(!1)),this.addMarker(marker)}if(!expectMoreBatches){this.showPreloader(!1);var triggerEvent=function(){self._markersPlaced=!0,self.trigger("markersplaced"),self.off("filteringcomplete",triggerEvent)};if(this.shortcodeAttributes.cat){var categories=this.shortcodeAttributes.cat.split(","),select=$("select[mid='"+this.id+"'][name='wpgmza_filter_select']");for(i=0;i<categories.length;i++)$("input[type='checkbox'][mid='"+this.id+"'][value='"+categories[i]+"']").prop("checked",!0),select.val(categories[i]);this.on("filteringcomplete",triggerEvent),this.markerFilter.update({categories:categories})}else triggerEvent();if(this.shortcodeAttributes.markers){var arr=this.shortcodeAttributes.markers.split(","),markers=[];for(i=0;i<arr.length;i++){var id=arr[i];id=id.replace(" ","");marker=this.getMarkerByID(id);markers.push(marker)}this.fitMapBoundsToMarkers(markers)}}};Math.PI;function deg2rad(deg){return deg*(Math.PI/180)}WPGMZA.Map.getGeographicDistance=function(lat1,lon1,lat2,lon2){var dLat=deg2rad(lat2-lat1),dLon=deg2rad(lon2-lon1),a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(deg2rad(lat1))*Math.cos(deg2rad(lat2))*Math.sin(dLon/2)*Math.sin(dLon/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))},WPGMZA.Map.prototype.setCenter=function(latLng){if(!("lat"in latLng&&"lng"in latLng))throw new Error("Argument is not an object with lat and lng")},WPGMZA.Map.prototype.setDimensions=function(width,height){0==arguments.length&&(width=this.settings.map_width?this.settings.map_width:"100",this.settings.map_width_type?width+=this.settings.map_width_type.replace("\\",""):width+="%",height=this.settings.map_height?this.settings.map_height:"400",this.settings.map_height_type?height+=this.settings.map_height_type.replace("\\",""):height+="px"),$(this.engineElement).css({width:width,height:height})},WPGMZA.Map.prototype.setAlignment=function(){switch(parseInt(this.settings.wpgmza_map_align)){case 1:$(this.element).css({float:"left"});break;case 2:$(this.element).css({"margin-left":"auto","margin-right":"auto"});break;case 3:$(this.element).css({float:"right"})}},WPGMZA.Map.prototype.addMarker=function(marker){if(!(marker instanceof WPGMZA.Marker))throw new Error("Argument must be an instance of WPGMZA.Marker");marker.map=this,(marker.parent=this).markers.push(marker),this.dispatchEvent({type:"markeradded",marker:marker}),marker.dispatchEvent({type:"added"})},WPGMZA.Map.prototype.removeMarker=function(marker){if(!(marker instanceof WPGMZA.Marker))throw new Error("Argument must be an instance of WPGMZA.Marker");if(marker.map!==this)throw new Error("Wrong map error");marker.infoWindow&&marker.infoWindow.close(),marker.map=null,marker.parent=null;var index=this.markers.indexOf(marker);if(-1==index)throw new Error("Marker not found in marker array");this.markers.splice(index,1),this.dispatchEvent({type:"markerremoved",marker:marker}),marker.dispatchEvent({type:"removed"})},WPGMZA.Map.prototype.removeAllMarkers=function(options){for(var i=this.markers.length-1;0<=i;i--)this.removeMarker(this.markers[i])},WPGMZA.Map.prototype.getMarkerByID=function(id){for(var i=0;i<this.markers.length;i++)if(this.markers[i].id==id)return this.markers[i];return null},WPGMZA.Map.prototype.getMarkerByTitle=function(title){if("string"==typeof title){for(var i=0;i<this.markers.length;i++)if(this.markers[i].title==title)return this.markers[i]}else{if(!(title instanceof RegExp))throw new Error("Invalid argument");for(i=0;i<this.markers.length;i++)if(title.test(this.markers[i].title))return this.markers[i]}return null},WPGMZA.Map.prototype.removeMarkerByID=function(id){var marker=this.getMarkerByID(id);marker&&this.removeMarker(marker)},WPGMZA.Map.prototype.addPolygon=function(polygon){if(!(polygon instanceof WPGMZA.Polygon))throw new Error("Argument must be an instance of WPGMZA.Polygon");(polygon.map=this).polygons.push(polygon),this.dispatchEvent({type:"polygonadded",polygon:polygon})},WPGMZA.Map.prototype.removePolygon=function(polygon){if(!(polygon instanceof WPGMZA.Polygon))throw new Error("Argument must be an instance of WPGMZA.Polygon");if(polygon.map!==this)throw new Error("Wrong map error");polygon.map=null,this.polygons.splice(this.polygons.indexOf(polygon),1),this.dispatchEvent({type:"polygonremoved",polygon:polygon})},WPGMZA.Map.prototype.getPolygonByID=function(id){for(var i=0;i<this.polygons.length;i++)if(this.polygons[i].id==id)return this.polygons[i];return null},WPGMZA.Map.prototype.removePolygonByID=function(id){var polygon=this.getPolygonByID(id);polygon&&this.removePolygon(polygon)},WPGMZA.Map.prototype.getPolylineByID=function(id){for(var i=0;i<this.polylines.length;i++)if(this.polylines[i].id==id)return this.polylines[i];return null},WPGMZA.Map.prototype.addPolyline=function(polyline){if(!(polyline instanceof WPGMZA.Polyline))throw new Error("Argument must be an instance of WPGMZA.Polyline");(polyline.map=this).polylines.push(polyline),this.dispatchEvent({type:"polylineadded",polyline:polyline})},WPGMZA.Map.prototype.removePolyline=function(polyline){if(!(polyline instanceof WPGMZA.Polyline))throw new Error("Argument must be an instance of WPGMZA.Polyline");if(polyline.map!==this)throw new Error("Wrong map error");polyline.map=null,this.polylines.splice(this.polylines.indexOf(polyline),1),this.dispatchEvent({type:"polylineremoved",polyline:polyline})},WPGMZA.Map.prototype.getPolylineByID=function(id){for(var i=0;i<this.polylines.length;i++)if(this.polylines[i].id==id)return this.polylines[i];return null},WPGMZA.Map.prototype.removePolylineByID=function(id){var polyline=this.getPolylineByID(id);polyline&&this.removePolyline(polyline)},WPGMZA.Map.prototype.addCircle=function(circle){if(!(circle instanceof WPGMZA.Circle))throw new Error("Argument must be an instance of WPGMZA.Circle");(circle.map=this).circles.push(circle),this.dispatchEvent({type:"circleadded",circle:circle})},WPGMZA.Map.prototype.removeCircle=function(circle){if(!(circle instanceof WPGMZA.Circle))throw new Error("Argument must be an instance of WPGMZA.Circle");if(circle.map!==this)throw new Error("Wrong map error");circle.map=null,this.circles.splice(this.circles.indexOf(circle),1),this.dispatchEvent({type:"circleremoved",circle:circle})},WPGMZA.Map.prototype.getCircleByID=function(id){for(var i=0;i<this.circles.length;i++)if(this.circles[i].id==id)return this.circles[i];return null},WPGMZA.Map.prototype.removeCircleByID=function(id){var circle=this.getCircleByID(id);circle&&this.removeCircle(circle)},WPGMZA.Map.prototype.addRectangle=function(rectangle){if(!(rectangle instanceof WPGMZA.Rectangle))throw new Error("Argument must be an instance of WPGMZA.Rectangle");(rectangle.map=this).rectangles.push(rectangle),this.dispatchEvent({type:"rectangleadded",rectangle:rectangle})},WPGMZA.Map.prototype.removeRectangle=function(rectangle){if(!(rectangle instanceof WPGMZA.Rectangle))throw new Error("Argument must be an instance of WPGMZA.Rectangle");if(rectangle.map!==this)throw new Error("Wrong map error");rectangle.map=null,this.rectangles.splice(this.rectangles.indexOf(rectangle),1),this.dispatchEvent({type:"rectangleremoved",rectangle:rectangle})},WPGMZA.Map.prototype.getRectangleByID=function(id){for(var i=0;i<this.rectangles.length;i++)if(this.rectangles[i].id==id)return this.rectangles[i];return null},WPGMZA.Map.prototype.removeRectangleByID=function(id){var rectangle=this.getRectangleByID(id);rectangle&&this.removeRectangle(rectangle)},WPGMZA.Map.prototype.resetBounds=function(){var latlng=new WPGMZA.LatLng(this.settings.map_start_lat,this.settings.map_start_lng);this.panTo(latlng),this.setZoom(this.settings.map_start_zoom)},WPGMZA.Map.prototype.nudge=function(x,y){var nudged=this.nudgeLatLng(this.getCenter(),x,y);this.setCenter(nudged)},WPGMZA.Map.prototype.nudgeLatLng=function(latLng,x,y){var pixels=this.latLngToPixels(latLng);if(pixels.x+=parseFloat(x),pixels.y+=parseFloat(y),isNaN(pixels.x)||isNaN(pixels.y))throw new Error("Invalid coordinates supplied");return this.pixelsToLatLng(pixels)},WPGMZA.Map.prototype.animateNudge=function(x,y,origin,milliseconds){var nudged;if(origin){if(!(origin instanceof WPGMZA.LatLng))throw new Error("Origin must be an instance of WPGMZA.LatLng")}else origin=this.getCenter();nudged=this.nudgeLatLng(origin,x,y),milliseconds=milliseconds||WPGMZA.getScrollAnimationDuration(),$(this).animate({lat:nudged.lat,lng:nudged.lng},milliseconds)},WPGMZA.Map.prototype.onWindowResize=function(event){},WPGMZA.Map.prototype.onElementResized=function(event){},WPGMZA.Map.prototype.onBoundsChanged=function(event){this.trigger("boundschanged"),this.trigger("bounds_changed")},WPGMZA.Map.prototype.onIdle=function(event){this.trigger("idle")},WPGMZA.Map.prototype.onClick=function(event){},WPGMZA.Map.prototype.hasVisibleMarkers=function(){for(var marker,length=this.markers.length,i=0;i<length;i++)if((marker=this.markers[i]).isFilterable&&marker.getVisible())return!0;return!1},WPGMZA.Map.prototype.closeAllInfoWindows=function(){this.markers.forEach(function(marker){marker.infoWindow&&marker.infoWindow.close()})},$(document).ready(function(event){if(!WPGMZA.visibilityWorkaroundIntervalID){var invisibleMaps=jQuery(".wpgmza_map:hidden");WPGMZA.visibilityWorkaroundIntervalID=setInterval(function(){jQuery(invisibleMaps).each(function(index,el){if(jQuery(el).is(":visible")){var id=jQuery(el).attr("data-map-id");WPGMZA.getMapByID(id).onElementResized(),invisibleMaps.splice(invisibleMaps.toArray().indexOf(el),1)}})},1e3)}})}),jQuery(function($){WPGMZA.MapsEngineDialog=function(element){var self=this;this.element=element,window.wpgmzaUnbindSaveReminder&&window.wpgmzaUnbindSaveReminder(),$(element).show(),$(element).remodal().open(),$(element).find("input:radio").on("change",function(event){$("#wpgmza-confirm-engine").prop("disabled",!1),$("#wpgmza-confirm-engine").click()}),$("#wpgmza-confirm-engine").on("click",function(event){self.onButtonClicked(event)})},WPGMZA.MapsEngineDialog.prototype.onButtonClicked=function(event){$(event.target).prop("disabled",!0),$.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_maps_engine_dialog_set_engine",engine:$("[name='wpgmza_maps_engine']:checked").val(),nonce:$("#wpgmza-maps-engine-dialog").attr("data-ajax-nonce")},success:function(response,status,xhr){window.location.reload()}})},$(document).ready(function(event){var element=$("#wpgmza-maps-engine-dialog");element.length&&(WPGMZA.settings.wpgmza_maps_engine_dialog_done||WPGMZA.settings.wpgmza_google_maps_api_key&&WPGMZA.settings.wpgmza_google_maps_api_key.length||(WPGMZA.mapsEngineDialog=new WPGMZA.MapsEngineDialog(element)))})}),jQuery(function($){WPGMZA.MarkerFilter=function(map){WPGMZA.EventDispatcher.call(this),this.map=map},WPGMZA.MarkerFilter.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.MarkerFilter.prototype.constructor=WPGMZA.MarkerFilter,WPGMZA.MarkerFilter.createInstance=function(map){return new WPGMZA.MarkerFilter(map)},WPGMZA.MarkerFilter.prototype.getFilteringParameters=function(){var params={map_id:this.map.id};return this.map.storeLocator&&(params=$.extend(params,this.map.storeLocator.getFilteringParameters())),params},WPGMZA.MarkerFilter.prototype.update=function(params,source){var self=this;function dispatchEvent(result){var event=new WPGMZA.Event("filteringcomplete");event.map=self.map,event.source=source,event.filteredMarkers=result,event.filteringParams=params,self.onFilteringComplete(event),self.trigger(event),self.map.trigger(event)}this.updateTimeoutID||(params=params||{},this.xhr&&(this.xhr.abort(),delete this.xhr),this.updateTimeoutID=setTimeout(function(){if((params=$.extend(self.getFilteringParameters(),params)).center instanceof WPGMZA.LatLng&&(params.center=params.center.toLatLngLiteral()),params.hideAll)return dispatchEvent([]),void delete self.updateTimeoutID;self.map.showPreloader(!0),self.xhr=WPGMZA.restAPI.call("/markers",{data:{fields:["id"],filter:JSON.stringify(params)},success:function(result,status,xhr){self.map.showPreloader(!1),dispatchEvent(result)},useCompressedPathVariable:!0}),delete self.updateTimeoutID},0))},WPGMZA.MarkerFilter.prototype.onFilteringComplete=function(event){var map=[];event.filteredMarkers.forEach(function(data){map[data.id]=!0}),this.map.markers.forEach(function(marker){if(marker.isFilterable){var allowByFilter=!!map[marker.id];marker.isFiltered=!allowByFilter,marker.setVisible(allowByFilter)}})}}),jQuery(function($){WPGMZA.Marker=function(row){var self=this;this._offset={x:0,y:0},WPGMZA.assertInstanceOf(this,"Marker"),this.lat="36.778261",this.lng="-119.4179323999",this.address="California",this.title=null,this.description="",this.link="",this.icon="",this.approved=1,this.pic=null,this.isFilterable=!0,this.disableInfoWindow=!1,WPGMZA.Feature.apply(this,arguments),row&&row.heatmap||(row&&this.on("init",function(event){row.position&&this.setPosition(row.position),row.map&&row.map.addMarker(this)}),this.addEventListener("added",function(event){self.onAdded(event)}),this.handleLegacyGlobals(row))},WPGMZA.Marker.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Marker.prototype.constructor=WPGMZA.Marker,WPGMZA.Marker.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.isProVersion()?WPGMZA.OLProMarker:WPGMZA.OLMarker;default:return WPGMZA.isProVersion()?WPGMZA.GoogleProMarker:WPGMZA.GoogleMarker}},WPGMZA.Marker.createInstance=function(row){return new(WPGMZA.Marker.getConstructor())(row)},WPGMZA.Marker.ANIMATION_NONE="0",WPGMZA.Marker.ANIMATION_BOUNCE="1",WPGMZA.Marker.ANIMATION_DROP="2",Object.defineProperty(WPGMZA.Marker.prototype,"offsetX",{get:function(){return this._offset.x},set:function(value){this._offset.x=value,this.updateOffset()}}),Object.defineProperty(WPGMZA.Marker.prototype,"offsetY",{get:function(){return this._offset.y},set:function(value){this._offset.y=value,this.updateOffset()}}),WPGMZA.Marker.prototype.onAdded=function(event){var self=this;this.addEventListener("click",function(event){self.onClick(event)}),this.addEventListener("mouseover",function(event){self.onMouseOver(event)}),this.addEventListener("select",function(event){self.onSelect(event)}),this.map.settings.marker==this.id&&self.trigger("select"),"1"==this.infoopen&&this.openInfoWindow(!0)},WPGMZA.Marker.prototype.handleLegacyGlobals=function(row){var m;if(WPGMZA.settings.useLegacyGlobals&&this.map_id&&this.id&&!(WPGMZA.pro_version&&(m=WPGMZA.pro_version.match(/\d+/))&&m[0]<=7)){WPGMZA.legacyGlobals.marker_array[this.map_id]||(WPGMZA.legacyGlobals.marker_array[this.map_id]=[]),WPGMZA.legacyGlobals.marker_array[this.map_id][this.id]=this,WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id]||(WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id]=[]);var cloned=$.extend({marker_id:this.id},row);WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id][this.id]=cloned}},WPGMZA.Marker.prototype.initInfoWindow=function(){this.infoWindow||(this.infoWindow=WPGMZA.InfoWindow.createInstance())},WPGMZA.Marker.prototype.openInfoWindow=function(autoOpen){this.map?(autoOpen||(this.map.lastInteractedMarker&&this.map.lastInteractedMarker.infoWindow.close(),this.map.lastInteractedMarker=this),this.initInfoWindow(),this.infoWindow.open(this.map,this)):console.warn("Cannot open infowindow for marker with no map")},WPGMZA.Marker.prototype.onClick=function(event){},WPGMZA.Marker.prototype.onSelect=function(event){this.openInfoWindow()},WPGMZA.Marker.prototype.onMouseOver=function(event){WPGMZA.settings.wpgmza_settings_map_open_marker_by==WPGMZA.InfoWindow.OPEN_BY_HOVER&&this.openInfoWindow()},WPGMZA.Marker.prototype.getIcon=function(){function stripProtocol(url){return"string"!=typeof url?url:url.replace(/^http(s?):/,"")}return WPGMZA.defaultMarkerIcon?stripProtocol(WPGMZA.defaultMarkerIcon):stripProtocol(WPGMZA.settings.default_marker_icon)},WPGMZA.Marker.prototype.getPosition=function(){return new WPGMZA.LatLng({lat:parseFloat(this.lat),lng:parseFloat(this.lng)})},WPGMZA.Marker.prototype.setPosition=function(latLng){latLng instanceof WPGMZA.LatLng?(this.lat=latLng.lat,this.lng=latLng.lng):(this.lat=parseFloat(latLng.lat),this.lng=parseFloat(latLng.lng))},WPGMZA.Marker.prototype.setOffset=function(x,y){this._offset.x=x,this._offset.y=y,this.updateOffset()},WPGMZA.Marker.prototype.updateOffset=function(){},WPGMZA.Marker.prototype.getAnimation=function(){return this.anim},WPGMZA.Marker.prototype.setAnimation=function(animation){},WPGMZA.Marker.prototype.getVisible=function(){},WPGMZA.Marker.prototype.setVisible=function(visible){!visible&&this.infoWindow&&this.infoWindow.close()},WPGMZA.Marker.prototype.getMap=function(){return this.map},WPGMZA.Marker.prototype.setMap=function(map){map?map.addMarker(this):this.map&&this.map.removeMarker(this),this.map=map},WPGMZA.Marker.prototype.getDraggable=function(){},WPGMZA.Marker.prototype.setDraggable=function(draggable){},WPGMZA.Marker.prototype.setOptions=function(options){},WPGMZA.Marker.prototype.setOpacity=function(opacity){},WPGMZA.Marker.prototype.panIntoView=function(){if(!this.map)throw new Error("Marker hasn't been added to a map");this.map.setCenter(this.getPosition())},WPGMZA.Marker.prototype.toJSON=function(){var result=WPGMZA.Feature.prototype.toJSON.call(this),position=this.getPosition();return $.extend(result,{lat:position.lat,lng:position.lng,address:this.address,title:this.title,description:this.description,link:this.link,icon:this.icon,pic:this.pic,approved:this.approved}),result}}),jQuery(function($){WPGMZA.ModernStoreLocatorCircle=function(map_id,settings){var map;map=WPGMZA.isProVersion()?this.map=WPGMZA.getMapByID(map_id):this.map=WPGMZA.maps[0],this.map_id=map_id,this.mapElement=map.element,this.mapSize={width:$(this.mapElement).width(),height:$(this.mapElement).height()},this.initCanvasLayer(),this.settings={center:new WPGMZA.LatLng(0,0),radius:1,color:"#ff0000",shadowColor:"white",shadowBlur:4,centerRingRadius:10,centerRingLineWidth:3,numInnerRings:9,innerRingLineWidth:1,innerRingFade:!0,numOuterRings:7,ringLineWidth:1,mainRingLineWidth:2,numSpokes:6,spokesStartAngle:Math.PI/2,numRadiusLabels:6,radiusLabelsStartAngle:Math.PI/2,radiusLabelFont:"13px sans-serif",visible:!1},settings&&this.setOptions(settings)},WPGMZA.ModernStoreLocatorCircle.createInstance=function(map,settings){return"google-maps"==WPGMZA.settings.engine?new WPGMZA.GoogleModernStoreLocatorCircle(map,settings):new WPGMZA.OLModernStoreLocatorCircle(map,settings)},WPGMZA.ModernStoreLocatorCircle.prototype.initCanvasLayer=function(){},WPGMZA.ModernStoreLocatorCircle.prototype.onResize=function(event){this.draw()},WPGMZA.ModernStoreLocatorCircle.prototype.onUpdate=function(event){this.draw()},WPGMZA.ModernStoreLocatorCircle.prototype.setOptions=function(options){for(var name in options){var functionName="set"+name.substr(0,1).toUpperCase()+name.substr(1);"function"==typeof this[functionName]?this[functionName](options[name]):this.settings[name]=options[name]}},WPGMZA.ModernStoreLocatorCircle.prototype.getResolutionScale=function(){return window.devicePixelRatio||1},WPGMZA.ModernStoreLocatorCircle.prototype.getCenter=function(){return this.getPosition()},WPGMZA.ModernStoreLocatorCircle.prototype.setCenter=function(value){this.setPosition(value)},WPGMZA.ModernStoreLocatorCircle.prototype.getPosition=function(){return this.settings.center},WPGMZA.ModernStoreLocatorCircle.prototype.setPosition=function(position){this.settings.center=position},WPGMZA.ModernStoreLocatorCircle.prototype.getRadius=function(){return this.settings.radius},WPGMZA.ModernStoreLocatorCircle.prototype.setRadius=function(radius){if(isNaN(radius))throw new Error("Invalid radius");this.settings.radius=radius},WPGMZA.ModernStoreLocatorCircle.prototype.getVisible=function(){return this.settings.visible},WPGMZA.ModernStoreLocatorCircle.prototype.setVisible=function(visible){this.settings.visible=visible},WPGMZA.ModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.getContext=function(type){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.validateSettings=function(){WPGMZA.isHexColorString(this.settings.color)||(this.settings.color="#ff0000")},WPGMZA.ModernStoreLocatorCircle.prototype.draw=function(){this.validateSettings();var settings=this.settings,canvasDimensions=this.getCanvasDimensions(),canvasWidth=canvasDimensions.width,canvasHeight=canvasDimensions.height;this.map,this.getResolutionScale();if(context=this.getContext("2d"),context.clearRect(0,0,canvasWidth,canvasHeight),settings.visible){context.shadowColor=settings.shadowColor,context.shadowBlur=settings.shadowBlur,context.setTransform(1,0,0,1,0,0);var scale=this.getScale();context.scale(scale,scale);var offset=this.getWorldOriginOffset();context.translate(offset.x,offset.y);new WPGMZA.LatLng(this.settings.center);var worldPoint=this.getCenterPixels(),rgba=WPGMZA.hexToRgba(settings.color),ringSpacing=this.getTransformedRadius(settings.radius)/(settings.numInnerRings+1);context.strokeStyle=settings.color,context.lineWidth=1/scale*settings.centerRingLineWidth,context.beginPath(),context.arc(worldPoint.x,worldPoint.y,this.getTransformedRadius(settings.centerRingRadius)/scale,0,2*Math.PI),context.stroke(),context.closePath();var end,radius=this.getTransformedRadius(settings.radius)+ringSpacing*settings.numOuterRings+1,grad=context.createRadialGradient(0,0,0,0,0,radius),start=(rgba=WPGMZA.hexToRgba(settings.color),WPGMZA.rgbaToString(rgba));rgba.a=0,end=WPGMZA.rgbaToString(rgba),grad.addColorStop(0,start),grad.addColorStop(1,end),context.save(),context.translate(worldPoint.x,worldPoint.y),context.strokeStyle=grad,context.lineWidth=2/scale;for(var i=0;i<settings.numSpokes;i++)spokeAngle=settings.spokesStartAngle+2*Math.PI*(i/settings.numSpokes),x=Math.cos(spokeAngle)*radius,y=Math.sin(spokeAngle)*radius,context.setLineDash([2/scale,15/scale]),context.beginPath(),context.moveTo(0,0),context.lineTo(x,y),context.stroke();context.setLineDash([]),context.restore(),context.lineWidth=1/scale*settings.innerRingLineWidth;for(i=1;i<=settings.numInnerRings;i++){radius=i*ringSpacing;settings.innerRingFade&&(rgba.a=1-(i-1)/settings.numInnerRings),context.strokeStyle=WPGMZA.rgbaToString(rgba),context.beginPath(),context.arc(worldPoint.x,worldPoint.y,radius,0,2*Math.PI),context.stroke(),context.closePath()}context.strokeStyle=settings.color,context.lineWidth=1/scale*settings.centerRingLineWidth,context.beginPath(),context.arc(worldPoint.x,worldPoint.y,this.getTransformedRadius(settings.radius),0,2*Math.PI),context.stroke(),context.closePath();for(radius=radius+ringSpacing,i=0;i<settings.numOuterRings;i++)settings.innerRingFade&&(rgba.a=1-i/settings.numOuterRings),context.strokeStyle=WPGMZA.rgbaToString(rgba),context.beginPath(),context.arc(worldPoint.x,worldPoint.y,radius,0,2*Math.PI),context.stroke(),context.closePath(),radius+=ringSpacing;if(0<settings.numRadiusLabels){var m,x,y;radius=this.getTransformedRadius(settings.radius);(m=settings.radiusLabelFont.match(/(\d+)px/))&&parseInt(m[1]),context.font=settings.radiusLabelFont,context.textAlign="center",context.textBaseline="middle",context.fillStyle=settings.color,context.save(),context.translate(worldPoint.x,worldPoint.y);for(i=0;i<settings.numRadiusLabels;i++){var spokeAngle,width,textAngle=(spokeAngle=settings.radiusLabelsStartAngle+2*Math.PI*(i/settings.numRadiusLabels))+Math.PI/2,text=settings.radiusString;0<Math.sin(spokeAngle)&&(textAngle-=Math.PI),x=Math.cos(spokeAngle)*radius,y=Math.sin(spokeAngle)*radius,context.save(),context.translate(x,y),context.rotate(textAngle),context.scale(1/scale,1/scale),width=context.measureText(text).width,height=width/2,context.clearRect(-width,-height,2*width,2*height),context.fillText(settings.radiusString,0,0),context.restore()}context.restore()}}}}),jQuery(function($){WPGMZA.ModernStoreLocator=function(map_id){var original,self=this,map=WPGMZA.getMapByID(map_id);if(WPGMZA.assertInstanceOf(this,"ModernStoreLocator"),(original=WPGMZA.isProVersion()?$(".wpgmza_sl_search_button[mid='"+map_id+"'], .wpgmza_sl_search_button_"+map_id).closest(".wpgmza_sl_main_div"):$(".wpgmza_sl_search_button").closest(".wpgmza_sl_main_div")).length){this.element=$("<div class='wpgmza-modern-store-locator'><div class='wpgmza-inner wpgmza-modern-hover-opaque'/></div>")[0];var addressInput,inner=$(this.element).find(".wpgmza-inner");addressInput=WPGMZA.isProVersion()?$(original).find(".addressInput"):$(original).find("#addressInput"),map.settings.store_locator_query_string&&map.settings.store_locator_query_string.length&&addressInput.attr("placeholder",map.settings.store_locator_query_string),inner.append(addressInput);var button,titleSearch=$(original).find("[id='nameInput_"+map_id+"']");if(titleSearch.length){var placeholder=map.settings.store_locator_name_string;placeholder&&placeholder.length&&titleSearch.attr("placeholder",placeholder),inner.append(titleSearch)}(button=$(original).find("button.wpgmza-use-my-location"))&&inner.append(button),$(addressInput).on("keydown keypress",function(event){13==event.keyCode&&self.searchButton.is(":visible")&&self.searchButton.trigger("click")}),$(addressInput).on("input",function(event){self.searchButton.show(),self.resetButton.hide()}),inner.append($(original).find("select.wpgmza_sl_radius_select")),this.searchButton=$(original).find(".wpgmza_sl_search_button, .wpgmza_sl_search_button_div"),inner.append(this.searchButton),this.resetButton=$(original).find(".wpgmza_sl_reset_button_div"),inner.append(this.resetButton),this.resetButton.on("click",function(event){resetLocations(map_id)}),this.resetButton.hide(),WPGMZA.isProVersion()&&(this.searchButton.on("click",function(event){0!=$("addressInput_"+map_id).val()&&(self.searchButton.hide(),self.resetButton.show(),map.storeLocator.state=WPGMZA.StoreLocator.STATE_APPLIED)}),this.resetButton.on("click",function(event){self.resetButton.hide(),self.searchButton.show(),map.storeLocator.state=WPGMZA.StoreLocator.STATE_INITIAL})),inner.append($("#wpgmza_distance_type_"+map_id));var container=$(original).find(".wpgmza_cat_checkbox_holder"),items=($(container).children("ul"),$(container).find("li")),numCategories=0,icons=[];items.each(function(index,el){var id=$(el).attr("class").match(/\d+/);for(var category_id in wpgmza_category_data)if(id==category_id){var src=wpgmza_category_data[category_id].image,icon=$('<div class="wpgmza-chip-icon"/>');icon.css({"background-image":"url('"+src+"')",width:$("#wpgmza_cat_checkbox_"+category_id+" + label").height()+"px"}),icons.push(icon),null!=src&&""!=src&&$("#wpgmza_cat_checkbox_"+category_id+" + label").prepend(icon),numCategories++;break}}),$(this.element).append(container),numCategories&&(this.optionsButton=$('<span class="wpgmza_store_locator_options_button"><i class="fa fa-list"></i></span>'),$(this.searchButton).before(this.optionsButton)),setInterval(function(){icons.forEach(function(icon){var height=$(icon).height();$(icon).css({width:height+"px"}),$(icon).closest("label").css({"padding-left":height+8+"px"})}),$(container).css("width",$(self.element).find(".wpgmza-inner").outerWidth()+"px")},1e3),$(this.element).find(".wpgmza_store_locator_options_button").on("click",function(event){container.hasClass("wpgmza-open")?container.removeClass("wpgmza-open"):container.addClass("wpgmza-open")}),$(original).remove(),$(this.element).find("input, select").on("focus",function(){$(inner).addClass("active")}),$(this.element).find("input, select").on("blur",function(){$(inner).removeClass("active")}),$(this.element).on("mouseover","li.wpgmza_cat_checkbox_item_holder",function(event){self.onMouseOverCategory(event)}),$(this.element).on("mouseleave","li.wpgmza_cat_checkbox_item_holder",function(event){self.onMouseLeaveCategory(event)}),$("body").on("click",".wpgmza_store_locator_options_button",function(event){setTimeout(function(){if($(".wpgmza_cat_checkbox_holder").hasClass("wpgmza-open")){var p_cat=$(".wpgmza_cat_checkbox_holder"),position_cat=p_cat.position().top+p_cat.outerHeight(!0)+$(".wpgmza-modern-store-locator").height(),$p_map=$(".wpgmza_map");$p_map.position().top+$p_map.outerHeight(!0)<=position_cat&&($(".wpgmza_cat_ul").css("overflow","scroll "),$(".wpgmza_cat_ul").css("height","100%"),$(".wpgmza-modern-store-locator").css("height","100%"),$(".wpgmza_cat_checkbox_holder.wpgmza-open").css({"padding-bottom":"50px",height:"100%"}))}},500)})}},WPGMZA.ModernStoreLocator.createInstance=function(map_id){switch(WPGMZA.settings.engine){case"open-layers":return new WPGMZA.OLModernStoreLocator(map_id);default:return new WPGMZA.GoogleModernStoreLocator(map_id)}},WPGMZA.ModernStoreLocator.prototype.onMouseOverCategory=function(event){var li=event.currentTarget;$(li).children("ul.wpgmza_cat_checkbox_item_holder").stop(!0,!1).fadeIn()},WPGMZA.ModernStoreLocator.prototype.onMouseLeaveCategory=function(event){var li=event.currentTarget;$(li).children("ul.wpgmza_cat_checkbox_item_holder").stop(!0,!1).fadeOut()}}),jQuery(function($){WPGMZA.NativeMapsAppIcon=function(){navigator.userAgent.match(/^Apple|iPhone|iPad|iPod/)?(this.type="apple",this.element=$('<span><i class="fab fa fa-apple" aria-hidden="true"></i></span>')):(this.type="google",this.element=$('<span><i class="fab fa fa-google" aria-hidden="true"></i></span>'))}}),jQuery(function($){Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:function(begin,end){return new Uint8Array(Array.prototype.slice.call(this,begin,end))}}),WPGMZA.isSafari()&&!window.external&&(window.external={})}),jQuery(function($){WPGMZA.Polygon=function(row,enginePolygon){WPGMZA.assertInstanceOf(this,"Polygon"),this.paths=null,WPGMZA.Feature.apply(this,arguments)},WPGMZA.Polygon.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Polygon.prototype.constructor=WPGMZA.Polygon,Object.defineProperty(WPGMZA.Polygon.prototype,"fillColor",{enumerable:!0,get:function(){return this.fillcolor&&this.fillcolor.length?"#"+this.fillcolor.replace(/^#/,""):"#ff0000"},set:function(a){this.fillcolor=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity&&this.opacity.length?this.opacity:.6},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"strokeColor",{enumerable:!0,get:function(){return this.linecolor&&this.linecolor.length?"#"+this.linecolor.replace(/^#/,""):"#ff0000"},set:function(a){this.linecolor=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.lineopacity&&this.lineopacity.length?this.lineopacity:.6},set:function(a){this.lineopacity=a}}),WPGMZA.Polygon.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.isProVersion()?WPGMZA.OLProPolygon:WPGMZA.OLPolygon;default:return WPGMZA.isProVersion()?WPGMZA.GoogleProPolygon:WPGMZA.GooglePolygon}},WPGMZA.Polygon.createInstance=function(row,engineObject){return new(WPGMZA.Polygon.getConstructor())(row,engineObject)}}),jQuery(function($){WPGMZA.Polyline=function(options,googlePolyline){WPGMZA.assertInstanceOf(this,"Polyline"),WPGMZA.Feature.apply(this,arguments)},WPGMZA.Polyline.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Polyline.prototype.constructor=WPGMZA.Polyline,Object.defineProperty(WPGMZA.Polyline.prototype,"strokeColor",{enumerable:!0,get:function(){return this.linecolor&&this.linecolor.length?"#"+this.linecolor.replace(/^#/,""):"#ff0000"},set:function(a){this.linecolor=a}}),Object.defineProperty(WPGMZA.Polyline.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.opacity&&this.opacity.length?this.opacity:.6},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Polyline.prototype,"strokeWeight",{enumerable:!0,get:function(){return this.linethickness&&this.linethickness.length?parseInt(this.linethickness):1},set:function(a){this.linethickness=a}}),WPGMZA.Polyline.getConstructor=function(){switch(WPGMZA.settings.engine){case"open-layers":return WPGMZA.OLPolyline;default:return WPGMZA.GooglePolyline}},WPGMZA.Polyline.createInstance=function(options,engineObject){return new(WPGMZA.Polyline.getConstructor())(options,engineObject)},WPGMZA.Polyline.prototype.getPoints=function(){return this.toJSON().points},WPGMZA.Polyline.prototype.toJSON=function(){var result=WPGMZA.Feature.prototype.toJSON.call(this);return result.title=this.title,result}}),jQuery(function($){WPGMZA.PopoutPanel=function(element){this.element=element},WPGMZA.PopoutPanel.prototype.open=function(){$(this.element).addClass("wpgmza-open")},WPGMZA.PopoutPanel.prototype.close=function(){$(this.element).removeClass("wpgmza-open")}}),jQuery(function($){var Parent=WPGMZA.Feature;WPGMZA.Rectangle=function(options,engineRectangle){WPGMZA.assertInstanceOf(this,"Rectangle"),this.name="",this.cornerA=new WPGMZA.LatLng,this.cornerB=new WPGMZA.LatLng,this.color="#ff0000",this.opacity=.5,Parent.apply(this,arguments)},WPGMZA.extend(WPGMZA.Rectangle,WPGMZA.Feature),Object.defineProperty(WPGMZA.Rectangle.prototype,"fillColor",{enumerable:!0,get:function(){return this.color&&this.color.length?this.color:"#ff0000"},set:function(a){this.color=a}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity||0==this.opacity?parseFloat(this.opacity):.5},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"strokeColor",{enumerable:!0,get:function(){return"#000000"}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"strokeOpacity",{enumerable:!0,get:function(){return 0}}),WPGMZA.Rectangle.createInstance=function(options,engineRectangle){var constructor;switch(WPGMZA.settings.engine){case"open-layers":constructor=WPGMZA.OLRectangle;break;default:constructor=WPGMZA.GoogleRectangle}return new constructor(options,engineRectangle)}}),jQuery(function($){function sendAJAXFallbackRequest(route,params){if((params=$.extend({},params)).data||(params.data={}),"route"in params.data)throw new Error("Cannot send route through this method");if("action"in params.data)throw new Error("Cannot send action through this method");return params.data.route=route,params.data.action="wpgmza_rest_api_request",WPGMZA.restAPI.addNonce(route,params,WPGMZA.RestAPI.CONTEXT_AJAX),$.ajax(WPGMZA.ajaxurl,params)}WPGMZA.RestAPI=function(){WPGMZA.RestAPI.URL=WPGMZA.resturl,this.useAJAXFallback=!1},WPGMZA.RestAPI.CONTEXT_REST="REST",WPGMZA.RestAPI.CONTEXT_AJAX="AJAX",WPGMZA.RestAPI.createInstance=function(){return new WPGMZA.RestAPI},Object.defineProperty(WPGMZA.RestAPI.prototype,"isCompressedPathVariableSupported",{get:function(){return WPGMZA.serverCanInflate&&"Uint8Array"in window&&"TextEncoder"in window}}),Object.defineProperty(WPGMZA.RestAPI.prototype,"isCompressedPathVariableAllowed",{get:function(){return!WPGMZA.pro_version||WPGMZA.Version.compare(WPGMZA.pro_version,"8.0.0")>=WPGMZA.Version.EQUAL_TO?!WPGMZA.settings.disable_compressed_path_variables:WPGMZA.settings.enable_compressed_path_variables}}),Object.defineProperty(WPGMZA.RestAPI.prototype,"maxURLLength",{get:function(){return 2083}}),WPGMZA.RestAPI.prototype.compressParams=function(params){var suffix="";if(params.markerIDs){var markerIDs=params.markerIDs.split(",");if(1<markerIDs.length){var encoded=(new WPGMZA.EliasFano).encode(markerIDs),compressed=pako.deflate(encoded),string=Array.prototype.map.call(compressed,function(ch){return String.fromCharCode(ch)}).join("");suffix="/"+btoa(string).replace(/\//g,"-").replace(/=+$/,""),params.midcbp=encoded.pointer,delete params.markerIDs}}string=JSON.stringify(params);var input=(new TextEncoder).encode(string),raw=(compressed=pako.deflate(input),Array.prototype.map.call(compressed,function(ch){return String.fromCharCode(ch)}).join(""));return btoa(raw).replace(/\//g,"-").replace(/=+$/,"")+suffix},WPGMZA.RestAPI.prototype.getNonce=function(route){var matches=[];for(var pattern in WPGMZA.restnoncetable){var regex=new RegExp(pattern);route.match(regex)&&matches.push({pattern:pattern,nonce:WPGMZA.restnoncetable[pattern],length:pattern.length})}if(!matches.length)throw new Error("No nonce found for route");return matches.sort(function(a,b){return b.length-a.length}),matches[0].nonce},WPGMZA.RestAPI.prototype.addNonce=function(route,params,context){function setRESTNonce(xhr){context==WPGMZA.RestAPI.CONTEXT_REST&&self.shouldAddNonce(route)&&xhr.setRequestHeader("X-WP-Nonce",WPGMZA.restnonce),params&¶ms.method&&!params.method.match(/^GET$/i)&&xhr.setRequestHeader("X-WPGMZA-Action-Nonce",self.getNonce(route))}var self=this;if(params.beforeSend){var base=params.beforeSend;params.beforeSend=function(xhr){base(xhr),setRESTNonce(xhr)}}else params.beforeSend=setRESTNonce},WPGMZA.RestAPI.prototype.shouldAddNonce=function(route){route=route.replace(/\//g,"");var isAdmin=!1;WPGMZA.is_admin&&1===parseInt(WPGMZA.is_admin)&&(isAdmin=!0);return!(route&&["markers","features","marker-listing","datatables"].includes(route)&&!isAdmin)},WPGMZA.RestAPI.prototype.call=function(route,params){if(this.useAJAXFallback)return sendAJAXFallbackRequest(route,params);var attemptedCompressedPathVariable=!1,fallbackRoute=route,fallbackParams=$.extend({},params);if("string"!=typeof route||!route.match(/^\//)&&!route.match(/^http/))throw new Error("Invalid route");if(WPGMZA.RestAPI.URL.match(/\/$/)&&(route=route.replace(/^\//,"")),params=params||{},this.addNonce(route,params,WPGMZA.RestAPI.CONTEXT_REST),params.error||(params.error=function(xhr,status,message){if("abort"!=status){switch(xhr.status){case 401:case 403:case 405:return($.post(WPGMZA.ajaxurl,{action:"wpgmza_report_rest_api_blocked"},function(response){}),console.warn("The REST API was blocked. This is usually due to security plugins blocking REST requests for non-authenticated users."),"DELETE"===params.method)?(console.warn("The REST API rejected a DELETE request, attempting again with POST fallback"),params.method="POST",params.data||(params.data={}),params.data.simulateDelete="yes",WPGMZA.restAPI.call(route,params)):(this.useAJAXFallback=!0,sendAJAXFallbackRequest(fallbackRoute,fallbackParams));case 414:if(!attemptedCompressedPathVariable)break;return fallbackParams.method="POST",fallbackParams.useCompressedPathVariable=!1,WPGMZA.restAPI.call(fallbackRoute,fallbackParams)}throw new Error(message)}}),params.useCompressedPathVariable&&this.isCompressedPathVariableSupported&&this.isCompressedPathVariableAllowed){var compressedParams=$.extend({},params),data=params.data,base64=this.compressParams(data);WPGMZA.isServerIIS&&(base64=base64.replace(/\+/g,"%20"));var compressedRoute=route.replace(/\/$/,"")+"/base64"+base64;WPGMZA.RestAPI.URL;compressedParams.method="GET",delete compressedParams.data,!1===params.cache&&(compressedParams.data={skip_cache:1}),compressedRoute.length<this.maxURLLength?(attemptedCompressedPathVariable=!0,route=compressedRoute,params=compressedParams):(WPGMZA.RestAPI.compressedPathVariableURLLimitWarningDisplayed||console.warn("Compressed path variable route would exceed URL length limit"),WPGMZA.RestAPI.compressedPathVariableURLLimitWarningDisplayed=!0)}var onSuccess=null;return params.success&&(onSuccess=params.success),params.success=function(result,status,xhr){if("object"!=typeof result){var rawResult=result;try{result=JSON.parse(result)}catch(parseExc){result=rawResult}}onSuccess&&"function"==typeof onSuccess&&onSuccess(result,status,xhr)},WPGMZA.RestAPI.URL.match(/\?/)&&(route=route.replace(/\?/,"&")),$.ajax(WPGMZA.RestAPI.URL+route,params)};var nativeCallFunction=WPGMZA.RestAPI.call;WPGMZA.RestAPI.call=function(){console.warn("WPGMZA.RestAPI.call was called statically, did you mean to call the function on WPGMZA.restAPI?"),nativeCallFunction.apply(this,arguments)},$(document.body).on("click","#wpgmza-rest-api-blocked button.notice-dismiss",function(event){WPGMZA.restAPI.call("/rest-api/",{method:"POST",data:{dismiss_blocked_notice:!0}})})});var $_GET={};if(-1!==document.location.toString().indexOf("?"))for(var query=document.location.toString().replace(/^.*?\?/,"").replace(/#.*$/,"").split("&"),wpgmza_i=0,wpgmza_l=query.length;wpgmza_i<wpgmza_l;wpgmza_i++){var aux=decodeURIComponent(query[wpgmza_i]).split("=");$_GET[aux[0]]=aux[1]}jQuery(function($){WPGMZA.SettingsPage=function(){var self=this;this._keypressHistory=[],this.updateEngineSpecificControls(),this.updateStorageControls(),this.updateGDPRControls(),$(window).on("keypress",function(event){self.onKeyPress(event)}),jQuery("body").on("click",".wpgmza_destroy_data",function(e){e.preventDefault();var ttype=jQuery(this).attr("danger"),warning="Are you sure?";"wpgmza_destroy_all_data"==ttype&&(warning="Are you sure? This will delete ALL data and settings for WP Google Maps!"),window.confirm(warning)&&jQuery.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_maps_settings_danger_zone_delete_data",type:ttype,nonce:wpgmza_dz_nonce},success:function(response,status,xhr){"wpgmza_destroy_all_data"==ttype?window.location.replace("admin.php?page=wp-google-maps-menu&action=welcome_page"):"wpgmza_reset_all_settings"==ttype?window.location.reload():alert("Complete.")}})}),$("select[name='wpgmza_maps_engine']").on("change",function(event){self.updateEngineSpecificControls()}),$('[name="wpgmza_settings_marker_pull"]').on("click",function(event){self.updateStorageControls()}),$("input[name='wpgmza_gdpr_require_consent_before_load'], input[name='wpgmza_gdpr_require_consent_before_vgm_submit'], input[name='wpgmza_gdpr_override_notice']").on("change",function(event){self.updateGDPRControls()}),$('select[name="tile_server_url"]').on("change",function(event){"custom_override"===$('select[name="tile_server_url"]').val()?$(".wpgmza_tile_server_override_component").removeClass("wpgmza-hidden"):$(".wpgmza_tile_server_override_component").addClass("wpgmza-hidden")}),$('select[name="tile_server_url"]').trigger("change"),jQuery("#wpgmza_flush_cache_btn").on("click",function(){jQuery(this).attr("disabled","disabled"),WPGMZA.settingsPage.flushGeocodeCache()}),$("#wpgmza-global-settings").tabs({create:function(event,ui){if(void 0!==$_GET.highlight){var elmnt=document.getElementById($_GET.highlight);elmnt.classList.add("highlight-item"),setTimeout(function(){elmnt.classList.add("highlight-item-step-2")},1e3);var y=elmnt.getBoundingClientRect().top+window.pageYOffset+-100;window.scrollTo({top:y,behavior:"smooth"})}}}),$("#wpgmza-global-setting").bind("create",function(event,ui){alert("now")}),$("#wpgmza-global-settings fieldset").each(function(index,el){$(el).children(":not(legend)").wrapAll("<span class='settings-group'></span>")})},WPGMZA.SettingsPage.createInstance=function(){return new WPGMZA.SettingsPage},WPGMZA.SettingsPage.prototype.updateEngineSpecificControls=function(){var engine=$("select[name='wpgmza_maps_engine']").val();$("[data-required-maps-engine][data-required-maps-engine!='"+engine+"']").hide(),$("[data-required-maps-engine='"+engine+"']").show()},WPGMZA.SettingsPage.prototype.updateStorageControls=function(){$("input[name='wpgmza_settings_marker_pull'][value='1']").is(":checked")?$("#xml-cache-settings").show():$("#xml-cache-settings").hide()},WPGMZA.SettingsPage.prototype.updateGDPRControls=function(){var showNoticeControls=$("input[name='wpgmza_gdpr_require_consent_before_load']").prop("checked"),vgmCheckbox=$("input[name='wpgmza_gdpr_require_consent_before_vgm_submit']");vgmCheckbox.length&&(showNoticeControls=showNoticeControls||vgmCheckbox.prop("checked"));var showOverrideTextarea=showNoticeControls&&$("input[name='wpgmza_gdpr_override_notice']").prop("checked");showNoticeControls?$("#wpgmza-gdpr-compliance-notice").show("slow"):$("#wpgmza-gdpr-compliance-notice").hide("slow"),showOverrideTextarea?$("#wpgmza_gdpr_override_notice_text").show("slow"):$("#wpgmza_gdpr_override_notice_text").hide("slow")},WPGMZA.SettingsPage.prototype.flushGeocodeCache=function(){(new WPGMZA.OLGeocoder).clearCache(function(response){jQuery("#wpgmza_flush_cache_btn").removeAttr("disabled")})},WPGMZA.SettingsPage.prototype.onKeyPress=function(event){this._keypressHistory.push(event.key),9<this._keypressHistory.length&&(this._keypressHistory=this._keypressHistory.slice(this._keypressHistory.length-9)),"codecabin"!=this._keypressHistory.join("")||this._developerModeRevealed||($("fieldset#wpgmza-developer-mode").show(),this._developerModeRevealed=!0)},$(document).ready(function(event){WPGMZA.getCurrentPage()&&(WPGMZA.settingsPage=WPGMZA.SettingsPage.createInstance())})}),jQuery(function($){WPGMZA.StoreLocator=function(map,element){var self=this;WPGMZA.EventDispatcher.call(this),this._center=null,this.map=map,this.element=element,this.state=WPGMZA.StoreLocator.STATE_INITIAL,this.distanceUnits=this.map.settings.store_locator_distance,this.addressInput=WPGMZA.AddressInput.createInstance(this.addressElement,this.map),$(element).find(".wpgmza-not-found-msg").hide(),this.radiusElement&&this.map.settings.wpgmza_store_locator_default_radius&&0<this.radiusElement.find("option[value='"+this.map.settings.wpgmza_store_locator_default_radius+"']").length&&this.radiusElement.val(this.map.settings.wpgmza_store_locator_default_radius),this.map.on("storelocatorgeocodecomplete",function(event){self.onGeocodeComplete(event)}),this.map.on("init",function(event){self.map.markerFilter.on("filteringcomplete",function(event){self.onFilteringComplete(event)}),void 0!==self.map.settings.store_locator_style&&"modern"!=self.map.settings.store_locator_style&&"modern"!==WPGMZA.settings.user_interface_style||"default"!==WPGMZA.settings.user_interface_style&&"modern"!=WPGMZA.settings.user_interface_style&&"legacy"!=WPGMZA.settings.user_interface_style||(self.legacyModernAdapter=WPGMZA.ModernStoreLocator.createInstance(map.id))}),$(document.body).on("click",".wpgmza_sl_search_button_"+map.id+", [data-map-id='"+map.id+"'] .wpgmza_sl_search_button",function(event){self.onSearch(event)}),$(document.body).on("click",".wpgmza_sl_reset_button_"+map.id+", [data-map-id='"+map.id+"'] .wpgmza_sl_reset_button_div",function(event){self.onReset(event)}),$(this.addressElement).on("keypress",function(event){13==event.which&&self.onSearch(event)})},WPGMZA.StoreLocator.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.StoreLocator.prototype.constructor=WPGMZA.StoreLocator,WPGMZA.StoreLocator.STATE_INITIAL="initial",WPGMZA.StoreLocator.STATE_APPLIED="applied",WPGMZA.StoreLocator.createInstance=function(map,element){return new WPGMZA.StoreLocator(map,element)},Object.defineProperty(WPGMZA.StoreLocator.prototype,"address",{get:function(){return $(this.addressElement).val()}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"addressElement",{get:function(){return this.legacyModernAdapter?$(this.legacyModernAdapter.element).find("input.wpgmza-address")[0]:$(this.element).find("input.wpgmza-address")[0]}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"countryRestriction",{get:function(){return this.map.settings.wpgmza_store_locator_restrict}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"radiusElement",{get:function(){return $("#radiusSelect, #radiusSelect_"+this.map.id)}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"radius",{get:function(){return parseFloat(this.radiusElement.val())}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"center",{get:function(){return this._center}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"bounds",{get:function(){return this._bounds}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"marker",{get:function(){if(1!=this.map.settings.store_locator_bounce)return null;if(this._marker)return this._marker;return this._marker=WPGMZA.Marker.createInstance({visible:!1}),this._marker.disableInfoWindow=!0,this._marker.isFilterable=!1,this._marker.setAnimation(WPGMZA.Marker.ANIMATION_BOUNCE),this._marker}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"circle",{get:function(){return this._circle||("modern"!=this.map.settings.wpgmza_store_locator_radius_style||WPGMZA.isDeviceiOS()?this._circle=WPGMZA.Circle.createInstance({strokeColor:"#ff0000",strokeOpacity:"0.25",strokeWeight:2,fillColor:"#ff0000",fillOpacity:"0.15",visible:!1,clickable:!1,center:new WPGMZA.LatLng}):(this._circle=WPGMZA.ModernStoreLocatorCircle.createInstance(this.map.id),this._circle.settings.color=this.circleStrokeColor)),this._circle}}),WPGMZA.StoreLocator.prototype.onGeocodeComplete=function(event){if(!event.results||!event.results.length)return this._center=null,void(this._bounds=null);this._center=new WPGMZA.LatLng(event.results[0].latLng),this._bounds=new WPGMZA.LatLngBounds(event.results[0].bounds),this.map.markerFilter.update({},this)},WPGMZA.StoreLocator.prototype.onSearch=function(event){var self=this;if(this.state=WPGMZA.StoreLocator.STATE_APPLIED,!this.address||!this.address.length)return this.addressElement.focus(),!1;function callback(results,status){self.map.trigger({type:"storelocatorgeocodecomplete",results:results,status:status})}if(void 0!==this.map.settings.store_locator_style&&"modern"!==this.map.settings.store_locator_style&&"modern"!==WPGMZA.settings.user_interface_style&&"default"===WPGMZA.settings.user_interface_style&&WPGMZA.animateScroll(this.map.element),$(this.element).find(".wpgmza-not-found-msg").hide(),WPGMZA.LatLng.isLatLngString(this.address))callback([WPGMZA.LatLng.fromString(this.address)],WPGMZA.Geocoder.SUCCESS);else{var geocoder=WPGMZA.Geocoder.createInstance(),options={address:this.address};this.countryRestriction&&(options.country=this.countryRestriction),geocoder.geocode(options,function(results,status){status==WPGMZA.Geocoder.SUCCESS?callback(results,status):alert(WPGMZA.localized_strings.address_not_found)})}return!0},WPGMZA.StoreLocator.prototype.onReset=function(event){this.state=WPGMZA.StoreLocator.STATE_INITIAL,this._center=null,this._bounds=null,this.map.setZoom(this.map.settings.map_start_zoom),$(this.element).find(".wpgmza-not-found-msg").hide(),this.circle&&this.circle.setVisible(!1),this.marker&&this.marker.map&&this.map.removeMarker(this.marker),this.map.markerFilter.update({},this)},WPGMZA.StoreLocator.prototype.getFilteringParameters=function(){return this.center?{center:this.center,radius:this.radius}:{}},WPGMZA.StoreLocator.prototype.getZoomFromRadius=function(radius){return this.distanceUnits==WPGMZA.Distance.MILES&&(radius*=WPGMZA.Distance.KILOMETERS_PER_MILE),Math.round(14-Math.log(radius)/Math.LN2)},WPGMZA.StoreLocator.prototype.onFilteringComplete=function(event){var params=event.filteringParams,marker=this.marker;marker&&marker.setVisible(!1),params.center&&(this.map.setCenter(params.center),marker&&(marker.setPosition(params.center),marker.setVisible(!0),marker.map!=this.map&&this.map.addMarker(marker))),params.radius&&this.map.setZoom(this.getZoomFromRadius(params.radius));var circle=this.circle;if(circle){circle.setVisible(!1);var factor=this.distanceUnits==WPGMZA.Distance.MILES?WPGMZA.Distance.KILOMETERS_PER_MILE:1;params.center&¶ms.radius&&(circle.setRadius(params.radius*factor),circle.setCenter(params.center),circle.setVisible(!0),circle instanceof WPGMZA.ModernStoreLocatorCircle||circle.map==this.map||this.map.addCircle(circle)),circle instanceof WPGMZA.ModernStoreLocatorCircle&&(circle.settings.radiusString=this.radius)}0==event.filteredMarkers.length&&this.state===WPGMZA.StoreLocator.STATE_APPLIED&&(0<$(this.element).find(".wpgmza-no-results").length&&"legacy"===WPGMZA.settings.user_interface_style?$(this.element).find(".wpgmza-no-results").show():alert(this.map.settings.store_locator_not_found_message?this.map.settings.store_locator_not_found_message:WPGMZA.localized_strings.zero_results))}}),jQuery(function($){WPGMZA.Text=function(options){if(options)for(var name in options)this[name]=options[name]},WPGMZA.Text.createInstance=function(options){switch(WPGMZA.settings.engine){case"open-layers":return new WPGMZA.OLText(options);default:return new WPGMZA.GoogleText(options)}}}),jQuery(function($){WPGMZA.ThemeEditor=function(){WPGMZA.EventDispatcher.call(this),this.element=$("#wpgmza-theme-editor"),"open-layers"!=WPGMZA.settings.engine?this.element.length?(this.json=[{}],this.mapElement=WPGMZA.maps[0].element,this.element.appendTo("#wpgmza-map-theme-editor__holder"),$(window).on("scroll",function(event){}),setInterval(function(){},200),this.initHTML(),WPGMZA.themeEditor=this):console.warn("No element to initialise theme editor on"):this.element.remove()},WPGMZA.extend(WPGMZA.ThemeEditor,WPGMZA.EventDispatcher),WPGMZA.ThemeEditor.prototype.updatePosition=function(){},WPGMZA.ThemeEditor.features={all:[],administrative:["country","land_parcel","locality","neighborhood","province"],landscape:["man_made","natural","natural.landcover","natural.terrain"],poi:["attraction","business","government","medical","park","place_of_worship","school","sports_complex"],road:["arterial","highway","highway.controlled_access","local"],transit:["line","station","station.airport","station.bus","station.rail"],water:[]},WPGMZA.ThemeEditor.elements={all:[],geometry:["fill","stroke"],labels:["icon","text","text.fill","text.stroke"]},WPGMZA.ThemeEditor.prototype.parse=function(){$("#wpgmza_theme_editor_feature option, #wpgmza_theme_editor_element option").css("font-weight","normal"),$("#wpgmza_theme_editor_error").hide(),$("#wpgmza_theme_editor").show(),$("#wpgmza_theme_editor_do_hue").prop("checked",!1),$("#wpgmza_theme_editor_hue").val("#000000"),$("#wpgmza_theme_editor_lightness").val(""),$("#wpgmza_theme_editor_saturation").val(""),$("#wpgmza_theme_editor_gamma").val(""),$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!1),$("#wpgmza_theme_editor_visibility").val("inherit"),$("#wpgmza_theme_editor_do_color").prop("checked",!1),$("#wpgmza_theme_editor_color").val("#000000"),$("#wpgmza_theme_editor_weight").val("");var textarea=$('textarea[name="wpgmza_theme_data"]');if(!textarea.val()||textarea.val().length<1)this.json=[{}];else{try{this.json=$.parseJSON($('textarea[name="wpgmza_theme_data"]').val())}catch(e){return this.json=[{}],$("#wpgmza_theme_editor").hide(),void $("#wpgmza_theme_editor_error").show()}if(!$.isArray(this.json)){var jsonCopy=this.json;this.json=[],this.json.push(jsonCopy)}this.highlightFeatures(),this.highlightElements(),this.loadElementStylers()}},WPGMZA.ThemeEditor.prototype.highlightFeatures=function(){$("#wpgmza_theme_editor_feature option").css("font-weight","normal"),$.each(this.json,function(i,v){v.hasOwnProperty("featureType")?$('#wpgmza_theme_editor_feature option[value="'+v.featureType+'"]').css("font-weight","bold"):$('#wpgmza_theme_editor_feature option[value="all"]').css("font-weight","bold")})},WPGMZA.ThemeEditor.prototype.highlightElements=function(){var feature=$("#wpgmza_theme_editor_feature").val();$("#wpgmza_theme_editor_element option").css("font-weight","normal"),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")?$('#wpgmza_theme_editor_element option[value="'+v.elementType+'"]').css("font-weight","bold"):$('#wpgmza_theme_editor_element option[value="all"]').css("font-weight","bold"))})},WPGMZA.ThemeEditor.prototype.loadElementStylers=function(){var feature=$("#wpgmza_theme_editor_feature").val(),element=$("#wpgmza_theme_editor_element").val();$("#wpgmza_theme_editor_do_hue").prop("checked",!1),$("#wpgmza_theme_editor_hue").val("#000000"),$("#wpgmza_theme_editor_lightness").val(""),$("#wpgmza_theme_editor_saturation").val(""),$("#wpgmza_theme_editor_gamma").val(""),$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!1),$("#wpgmza_theme_editor_visibility").val("inherit"),$("#wpgmza_theme_editor_do_color").prop("checked",!1),$("#wpgmza_theme_editor_color").val("#000000"),$("#wpgmza_theme_editor_weight").val(""),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")&&v.elementType==element||"all"==element&&!v.hasOwnProperty("elementType"))&&v.hasOwnProperty("stylers")&&$.isArray(v.stylers)&&0<v.stylers.length&&$.each(v.stylers,function(ii,vv){vv.hasOwnProperty("hue")&&($("#wpgmza_theme_editor_do_hue").prop("checked",!0),$("#wpgmza_theme_editor_hue").val(vv.hue)),vv.hasOwnProperty("lightness")&&$("#wpgmza_theme_editor_lightness").val(vv.lightness),vv.hasOwnProperty("saturation")&&$("#wpgmza_theme_editor_saturation").val(vv.xaturation),vv.hasOwnProperty("gamma")&&$("#wpgmza_theme_editor_gamma").val(vv.gamma),vv.hasOwnProperty("invert_lightness")&&$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!0),vv.hasOwnProperty("visibility")&&$("#wpgmza_theme_editor_visibility").val(vv.visibility),vv.hasOwnProperty("color")&&($("#wpgmza_theme_editor_do_color").prop("checked",!0),$("#wpgmza_theme_editor_color").val(vv.color)),vv.hasOwnProperty("weight")&&$("#wpgmza_theme_editor_weight").val(vv.weight)})})},WPGMZA.ThemeEditor.prototype.writeElementStylers=function(){var feature=$("#wpgmza_theme_editor_feature").val(),element=$("#wpgmza_theme_editor_element").val(),indexJSON=null,stylers=[];if("inherit"!=$("#wpgmza_theme_editor_visibility").val()&&stylers.push({visibility:$("#wpgmza_theme_editor_visibility").val()}),!0===$("#wpgmza_theme_editor_do_color").prop("checked")&&stylers.push({color:$("#wpgmza_theme_editor_color").val()}),!0===$("#wpgmza_theme_editor_do_hue").prop("checked")&&stylers.push({hue:$("#wpgmza_theme_editor_hue").val()}),0<$("#wpgmza_theme_editor_gamma").val().length&&stylers.push({gamma:parseFloat($("#wpgmza_theme_editor_gamma").val())}),0<$("#wpgmza_theme_editor_weight").val().length&&stylers.push({weight:parseFloat($("#wpgmza_theme_editor_weight").val())}),0<$("#wpgmza_theme_editor_saturation").val().length&&stylers.push({saturation:parseFloat($("#wpgmza_theme_editor_saturation").val())}),0<$("#wpgmza_theme_editor_lightness").val().length&&stylers.push({lightness:parseFloat($("#wpgmza_theme_editor_lightness").val())}),!0===$("#wpgmza_theme_editor_do_invert_lightness").prop("checked")&&stylers.push({invert_lightness:!0}),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")&&v.elementType==element||"all"==element&&!v.hasOwnProperty("elementType"))&&(indexJSON=i)}),null===indexJSON){if(0<stylers.length){var new_feature_element_stylers={};"all"!=feature&&(new_feature_element_stylers.featureType=feature),"all"!=element&&(new_feature_element_stylers.elementType=element),new_feature_element_stylers.stylers=stylers,this.json.push(new_feature_element_stylers)}}else 0<stylers.length?this.json[indexJSON].stylers=stylers:this.json.splice(indexJSON,1);$('textarea[name="wpgmza_theme_data"]').val(JSON.stringify(this.json).replace(/:/g,": ").replace(/,/g,", ")),this.highlightFeatures(),this.highlightElements(),WPGMZA.themePanel.updateMapTheme()},WPGMZA.ThemeEditor.prototype.initHTML=function(){var self=this;$.each(WPGMZA.ThemeEditor.features,function(i,v){$("#wpgmza_theme_editor_feature").append('<option value="'+i+'">'+i+"</option>"),0<v.length&&$.each(v,function(ii,vv){$("#wpgmza_theme_editor_feature").append('<option value="'+i+"."+vv+'">'+i+"."+vv+"</option>")})}),$.each(WPGMZA.ThemeEditor.elements,function(i,v){$("#wpgmza_theme_editor_element").append('<option value="'+i+'">'+i+"</option>"),0<v.length&&$.each(v,function(ii,vv){$("#wpgmza_theme_editor_element").append('<option value="'+i+"."+vv+'">'+i+"."+vv+"</option>")})}),this.parse(),$('textarea[name="wpgmza_theme_data"]').on("input selectionchange propertychange",function(){self.parse()}),$(".wpgmza_theme_selection").click(function(){setTimeout(function(){$('textarea[name="wpgmza_theme_data"]').trigger("input")},1e3)}),$("#wpgmza-theme-editor__toggle").click(function(){$("#wpgmza-theme-editor").removeClass("active")}),$("#wpgmza_theme_editor_feature").on("change",function(){self.highlightElements(),self.loadElementStylers()}),$("#wpgmza_theme_editor_element").on("change",function(){self.loadElementStylers()}),$("#wpgmza_theme_editor_do_hue, #wpgmza_theme_editor_hue, #wpgmza_theme_editor_lightness, #wpgmza_theme_editor_saturation, #wpgmza_theme_editor_gamma, #wpgmza_theme_editor_do_invert_lightness, #wpgmza_theme_editor_visibility, #wpgmza_theme_editor_do_color, #wpgmza_theme_editor_color, #wpgmza_theme_editor_weight").on("input selectionchange propertychange",function(){self.writeElementStylers()}),"open-layers"==WPGMZA.settings.engine&&$("#wpgmza_theme_editor :input").prop("disabled",!0)}}),jQuery(function($){WPGMZA.ThemePanel=function(){var self=this;this.element=$("#wpgmza-theme-panel"),this.map=WPGMZA.maps[0],"open-layers"!=WPGMZA.settings.engine?this.element.length?($("#wpgmza-theme-presets").owlCarousel({items:6,dots:!0}),this.element.on("click","#wpgmza-theme-presets label",function(event){self.onThemePresetClick(event)}),$("#wpgmza-open-theme-editor").on("click",function(event){$("#wpgmza-map-theme-editor__holder").addClass("active"),$("#wpgmza-theme-editor").addClass("active"),WPGMZA.animateScroll($("#wpgmza-theme-editor"))}),WPGMZA.themePanel=this):console.warn("No element to initialise theme panel on"):this.element.remove()},WPGMZA.ThemePanel.previewImageCenter={lat:33.701806462148646,lng:-118.15949896058983},WPGMZA.ThemePanel.previewImageZoom=11,WPGMZA.ThemePanel.prototype.onThemePresetClick=function(event){var selectedData=$(event.currentTarget).find("[data-theme-json]").attr("data-theme-json"),textarea=$(this.element).find("textarea[name='wpgmza_theme_data']"),existingData=textarea.val(),allPresetData=[];$(this.element).find("[data-theme-json]").each(function(index,el){allPresetData.push($(el).attr("data-theme-json"))}),existingData.length&&-1==allPresetData.indexOf(existingData)&&!confirm(WPGMZA.localized_strings.overwrite_theme_data)||(textarea.val(selectedData),this.updateMapTheme(),WPGMZA.themeEditor.parse())},WPGMZA.ThemePanel.prototype.updateMapTheme=function(){var data;try{data=JSON.parse($("textarea[name='wpgmza_theme_data']").val())}catch(e){return void alert(WPGMZA.localized_strings.invalid_theme_data)}this.map.setOptions({styles:data})}}),jQuery(function($){WPGMZA.Version=function(){},WPGMZA.Version.GREATER_THAN=1,WPGMZA.Version.EQUAL_TO=0,WPGMZA.Version.LESS_THAN=-1,WPGMZA.Version.compare=function(v1,v2){for(var v1parts=v1.match(/\d+/g),v2parts=v2.match(/\d+/g),i=0;i<v1parts.length;++i){if(v2parts.length===i)return 1;if(v1parts[i]!==v2parts[i])return v1parts[i]>v2parts[i]?1:-1}return v1parts.length!=v2parts.length?-1:0}}),jQuery(function($){WPGMZA.XMLCacheConverter=function(){},WPGMZA.XMLCacheConverter.prototype.convert=function(xml){var markers=[],remap={marker_id:"id",linkd:"link"};return $(xml).find("marker").each(function(index,el){var data={};$(el).children().each(function(j,child){var key=child.nodeName;remap[key]&&(key=remap[key]),child.hasAttribute("data-json")?data[key]=JSON.parse($(child).text()):data[key]=$(child).text()}),markers.push(data)}),markers}}),jQuery(function($){WPGMZA.loadXMLAsWebWorker=function(){function tXml(a,d){function c(){for(var l=[];a[b];){if(60==a.charCodeAt(b)){if(47===a.charCodeAt(b+1)){b=a.indexOf(">",b);break}if(33===a.charCodeAt(b+1)){if(45==a.charCodeAt(b+2)){for(;62!==a.charCodeAt(b)||45!=a.charCodeAt(b-1)||45!=a.charCodeAt(b-2)||-1==b;)b=a.indexOf(">",b+1);-1===b&&(b=a.length)}else for(b+=2;62!==a.charCodeAt(b);)b++;b++;continue}var c=f();l.push(c)}else c=b,-2===(b=a.indexOf("<",b)-1)&&(b=a.length),0<(c=a.slice(c,b+1)).trim().length&&l.push(c);b++}return l}function l(){for(var c=b;-1===g.indexOf(a[b]);)b++;return a.slice(c,b)}function f(){var d={};b++,d.tagName=l();for(var f=!1;62!==a.charCodeAt(b);){if(64<(e=a.charCodeAt(b))&&e<91||96<e&&e<123){for(var g=l(),e=a.charCodeAt(b);39!==e&&34!==e&&!(64<e&&e<91||96<e&&e<123)&&62!==e;)b++,e=a.charCodeAt(b);if(f||(d.attributes={},f=!0),39===e||34===e){e=a[b];var h=++b;b=a.indexOf(e,h),e=a.slice(h,b)}else e=null,b--;d.attributes[g]=e}b++}return 47!==a.charCodeAt(b-1)&&("script"==d.tagName?(f=b+1,b=a.indexOf("<\/script>",b),d.children=[a.slice(f,b-1)],b+=8):"style"==d.tagName?(f=b+1,b=a.indexOf("</style>",b),d.children=[a.slice(f,b-1)],b+=7):-1==k.indexOf(d.tagName)&&(b++,d.children=c())),d}var g="\n\t>/= ",k=["img","br","input","meta","link"],h=null;if((d=d||{}).searchId){var b=new RegExp("s*ids*=s*['\"]"+d.searchId+"['\"]").exec(a).index;return-1!==b&&(-1!==(b=a.lastIndexOf("<",b))&&(h=f())),b}return b=0,h=c(),d.filter&&(h=tXml.filter(h,d.filter)),d.simplify&&(h=tXml.simplefy(h)),h}tXml.simplify=function(a){var d={};if(1===a.length&&"string"==typeof a[0])return a[0];for(var c in a.forEach(function(a){if(d[a.tagName]||(d[a.tagName]=[]),"object"==typeof a){var c=tXml.simplefy(a.children);d[a.tagName].push(c),a.attributes&&(c._attributes=a.attributes)}else d[a.tagName].push(a)}),d)1==d[c].length&&(d[c]=d[c][0]);return d},tXml.filter=function(a,d){var c=[];return a.forEach(function(a){"object"==typeof a&&d(a)&&c.push(a),a.children&&(a=tXml.filter(a.children,d),c=c.concat(a))}),c},tXml.domToXml=function(a){var c="";return function d(a){if(a)for(var f=0;f<a.length;f++)if("string"==typeof a[f])c+=a[f].trim();else{var g=a[f];c+="<"+g.tagName;var k=void 0;for(k in g.attributes)c=-1===g.attributes[k].indexOf('"')?c+(" "+k+'="'+g.attributes[k].trim())+'"':c+(" "+k+"='"+g.attributes[k].trim())+"'";c+=">",d(g.children),c+="</"+g.tagName+">"}}(O),c},"object"!=typeof window&&(module.exports=tXml);var inputData,totalFiles,worker=self,dataForMainThread=[],filesLoaded=0;function onXMLLoaded(request){if(4==request.readyState&&200==request.status){(new Date).getTime();!function(xml){for(var markers=xml[0].children[0],remap={marker_id:"id",linkd:"link"},i=0;i<markers.children.length;i++){var data={};markers.children[i].children.forEach(function(node){var key=node.tagName;remap[key]&&(key=remap[key]),node.attributes["data-json"]?data[key]=JSON.parse(node.children[0]):node.children.length?data[key]=node.children[0]:data[key]=""}),dataForMainThread.push(data)}}(tXml(request.responseText)),++filesLoaded>=totalFiles?worker.postMessage(dataForMainThread):loadNextFile()}}function loadNextFile(){var url=inputData.urls[filesLoaded],request=new XMLHttpRequest;request.onreadystatechange=function(){onXMLLoaded(this)},request.open("GET",inputData.protocol+url,!0),request.send()}self.addEventListener("message",function(event){var data=event.data;switch(data.command){case"load":dataForMainThread=[],filesLoaded=0,totalFiles=(inputData=data).urls.length,loadNextFile();break;default:throw new Error("Unknown command")}},!1)}}),jQuery(function($){WPGMZA.Integration={},WPGMZA.integrationModules={}}),jQuery(function($){if(window.wp&&wp.i18n&&wp.blocks&&wp.editor&&wp.components){var __=wp.i18n.__,registerBlockType=wp.blocks.registerBlockType,_wp$editor=wp.editor,InspectorControls=_wp$editor.InspectorControls,_wp$components=(_wp$editor.BlockControls,wp.components),Dashicon=_wp$components.Dashicon,PanelBody=(_wp$components.Toolbar,_wp$components.Button,_wp$components.Tooltip,_wp$components.PanelBody);_wp$components.TextareaControl,_wp$components.CheckboxControl,_wp$components.TextControl,_wp$components.SelectControl,_wp$components.RichText;WPGMZA.Integration.Gutenberg=function(){registerBlockType("gutenberg-wpgmza/block",this.getBlockDefinition())},WPGMZA.Integration.Gutenberg.prototype.getBlockTitle=function(){return __("WP Google Maps")},WPGMZA.Integration.Gutenberg.prototype.getBlockInspectorControls=function(props){return React.createElement(InspectorControls,{key:"inspector"},React.createElement(PanelBody,{title:__("Map Settings")},React.createElement("p",{class:"map-block-gutenberg-button-container"},React.createElement("a",{href:WPGMZA.adminurl+"admin.php?page=wp-google-maps-menu&action=edit&map_id=1",target:"_blank",class:"button button-primary"},React.createElement("i",{class:"fa fa-pencil-square-o","aria-hidden":"true"}),__("Go to Map Editor"))),React.createElement("p",{class:"map-block-gutenberg-button-container"},React.createElement("a",{href:"https://www.wpgmaps.com/documentation/creating-your-first-map/",target:"_blank",class:"button button-primary"},React.createElement("i",{class:"fa fa-book","aria-hidden":"true"}),__("View Documentation")))))},WPGMZA.Integration.Gutenberg.prototype.getBlockAttributes=function(){return{}},WPGMZA.Integration.Gutenberg.prototype.getBlockDefinition=function(props){var _this=this;return{title:__("WP Google Maps"),description:__("The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss."),category:"common",icon:"location-alt",keywords:[__("Map"),__("Maps"),__("Google")],attributes:this.getBlockAttributes(),edit:function(props){return[!!props.isSelected&&_this.getBlockInspectorControls(props),React.createElement("div",{className:props.className+" wpgmza-gutenberg-block"},React.createElement(Dashicon,{icon:"location-alt"}),React.createElement("span",{class:"wpgmza-gutenberg-block-title"},__("Your map will appear here on your websites front end")))]},save:function(){return null}}},WPGMZA.Integration.Gutenberg.getConstructor=function(){return WPGMZA.Integration.Gutenberg},WPGMZA.Integration.Gutenberg.createInstance=function(){return new(WPGMZA.Integration.Gutenberg.getConstructor())},WPGMZA.isProVersion()||/^6/.test(WPGMZA.pro_version)||(WPGMZA.integrationModules.gutenberg=WPGMZA.Integration.Gutenberg.createInstance())}}),jQuery(function($){$(document).ready(function(event){var parent=document.body.onclick;parent&&(document.body.onclick=function(event){event.target instanceof WPGMZA.Marker||parent(event)})})}),jQuery(function($){WPGMZA.GoogleUICompatibility=function(){if(!(navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"))){var style=$("<style id='wpgmza-google-ui-compatiblity-fix'/>");style.html(".wpgmza_map img:not(button img) { padding:0 !important; }"),$(document.head).append(style)}},WPGMZA.googleUICompatibility=new WPGMZA.GoogleUICompatibility}),jQuery(function($){WPGMZA.GoogleCircle=function(options,googleCircle){var self=this;WPGMZA.Circle.call(this,options,googleCircle),googleCircle?(this.googleCircle=googleCircle,options&&(options.center=WPGMZA.LatLng.fromGoogleLatLng(googleCircle.getCenter()),options.radius=googleCircle.getRadius()/1e3)):(this.googleCircle=new google.maps.Circle,this.googleCircle.wpgmzaCircle=this),this.googleFeature=this.googleCircle,options&&this.setOptions(options),google.maps.event.addListener(this.googleCircle,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GoogleCircle.prototype=Object.create(WPGMZA.Circle.prototype),WPGMZA.GoogleCircle.prototype.constructor=WPGMZA.GoogleCircle,WPGMZA.GoogleCircle.prototype.getCenter=function(){return WPGMZA.LatLng.fromGoogleLatLng(this.googleCircle.getCenter())},WPGMZA.GoogleCircle.prototype.setCenter=function(center){WPGMZA.Circle.prototype.setCenter.apply(this,arguments),this.googleCircle.setCenter(center)},WPGMZA.GoogleCircle.prototype.getRadius=function(){return this.googleCircle.getRadius()/1e3},WPGMZA.GoogleCircle.prototype.setRadius=function(radius){WPGMZA.Circle.prototype.setRadius.apply(this,arguments),this.googleCircle.setRadius(1e3*parseFloat(radius))},WPGMZA.GoogleCircle.prototype.setVisible=function(visible){this.googleCircle.setVisible(!!visible)},WPGMZA.GoogleCircle.prototype.setDraggable=function(value){this.googleCircle.setDraggable(!!value)},WPGMZA.GoogleCircle.prototype.setEditable=function(value){var self=this;this.googleCircle.setOptions({editable:value}),value&&(google.maps.event.addListener(this.googleCircle,"center_changed",function(event){self.center=WPGMZA.LatLng.fromGoogleLatLng(self.googleCircle.getCenter()),self.trigger("change")}),google.maps.event.addListener(this.googleCircle,"radius_changed",function(event){self.radius=self.googleCircle.getRadius()/1e3,self.trigger("change")}))},WPGMZA.GoogleCircle.prototype.setOptions=function(options){WPGMZA.Circle.prototype.setOptions.apply(this,arguments),options.center&&(this.center=new WPGMZA.LatLng(options.center))},WPGMZA.GoogleCircle.prototype.updateNativeFeature=function(){var googleOptions=this.getScalarProperties(),center=new WPGMZA.LatLng(this.center);googleOptions.radius*=1e3,googleOptions.center=center.toGoogleLatLng(),this.googleCircle.setOptions(googleOptions)}}),jQuery(function($){WPGMZA.GoogleDrawingManager=function(map){var self=this;WPGMZA.DrawingManager.call(this,map),this.mode=null,this.googleDrawingManager=new google.maps.drawing.DrawingManager({drawingControl:!1,polygonOptions:{editable:!0},polylineOptions:{editable:!0},circleOptions:{editable:!0},rectangleOptions:{editable:!0}}),this.googleDrawingManager.setMap(map.googleMap),google.maps.event.addListener(this.googleDrawingManager,"polygoncomplete",function(polygon){self.onPolygonClosed(polygon)}),google.maps.event.addListener(this.googleDrawingManager,"polylinecomplete",function(polyline){self.onPolylineComplete(polyline)}),google.maps.event.addListener(this.googleDrawingManager,"circlecomplete",function(circle){self.onCircleComplete(circle)}),google.maps.event.addListener(this.googleDrawingManager,"rectanglecomplete",function(rectangle){self.onRectangleComplete(rectangle)})},WPGMZA.GoogleDrawingManager.prototype=Object.create(WPGMZA.DrawingManager.prototype),WPGMZA.GoogleDrawingManager.prototype.constructor=WPGMZA.GoogleDrawingManager,WPGMZA.GoogleDrawingManager.prototype.setDrawingMode=function(mode){var googleMode;switch(WPGMZA.DrawingManager.prototype.setDrawingMode.call(this,mode),mode){case WPGMZA.DrawingManager.MODE_NONE:case WPGMZA.DrawingManager.MODE_MARKER:googleMode=null;break;case WPGMZA.DrawingManager.MODE_POLYGON:googleMode=google.maps.drawing.OverlayType.POLYGON;break;case WPGMZA.DrawingManager.MODE_POLYLINE:googleMode=google.maps.drawing.OverlayType.POLYLINE;break;case WPGMZA.DrawingManager.MODE_CIRCLE:googleMode=google.maps.drawing.OverlayType.CIRCLE;break;case WPGMZA.DrawingManager.MODE_RECTANGLE:googleMode=google.maps.drawing.OverlayType.RECTANGLE;break;case WPGMZA.DrawingManager.MODE_HEATMAP:googleMode=null;break;default:throw new Error("Invalid drawing mode")}this.googleDrawingManager.setDrawingMode(googleMode)},WPGMZA.GoogleDrawingManager.prototype.setOptions=function(options){this.googleDrawingManager.setOptions({polygonOptions:options,polylineOptions:options})},WPGMZA.GoogleDrawingManager.prototype.onVertexClicked=function(event){},WPGMZA.GoogleDrawingManager.prototype.onPolygonClosed=function(googlePolygon){var event=new WPGMZA.Event("polygonclosed");event.enginePolygon=googlePolygon,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onPolylineComplete=function(googlePolyline){var event=new WPGMZA.Event("polylinecomplete");event.enginePolyline=googlePolyline,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onCircleComplete=function(googleCircle){var event=new WPGMZA.Event("circlecomplete");event.engineCircle=googleCircle,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onRectangleComplete=function(googleRectangle){var event=new WPGMZA.Event("rectanglecomplete");event.engineRectangle=googleRectangle,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onHeatmapPointAdded=function(googleMarker){var position=WPGMZA.LatLng.fromGoogleLatLng(googleMarker.getPosition());googleMarker.setMap(null);var marker=WPGMZA.Marker.createInstance();marker.setPosition(position);var image={url:WPGMZA.imageFolderURL+"heatmap-point.png",origin:new google.maps.Point(0,0),anchor:new google.maps.Point(13,13)};marker.googleMarker.setIcon(image),this.map.addMarker(marker);var event=new WPGMZA.Event("heatmappointadded");event.position=position,this.trigger(event)}}),jQuery(function($){WPGMZA.GoogleGeocoder=function(){},WPGMZA.GoogleGeocoder.prototype=Object.create(WPGMZA.Geocoder.prototype),WPGMZA.GoogleGeocoder.prototype.constructor=WPGMZA.GoogleGeocoder,WPGMZA.GoogleGeocoder.prototype.getLatLngFromAddress=function(options,callback){if(!options||!options.address)return nativeStatus=WPGMZA.Geocoder.NO_ADDRESS,void callback(null,nativeStatus);if(options.lat&&options.lng){var latLng={lat:options.lat,lng:options.lng};callback([{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng,bounds:null}],WPGMZA.Geocoder.SUCCESS)}if(WPGMZA.isLatLngString(options.address))return WPGMZA.Geocoder.prototype.getLatLngFromAddress.call(this,options,callback);options.country&&(options.componentRestrictions={country:options.country}),(new google.maps.Geocoder).geocode(options,function(results,status){if(status==google.maps.GeocoderStatus.OK){var location=results[0].geometry.location,latLng={lat:location.lat(),lng:location.lng()},bounds=null;results[0].geometry.bounds&&(bounds=WPGMZA.LatLngBounds.fromGoogleLatLngBounds(results[0].geometry.bounds)),callback(results=[{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng,bounds:bounds}],WPGMZA.Geocoder.SUCCESS)}else{var nativeStatus=WPGMZA.Geocoder.FAIL;status==google.maps.GeocoderStatus.ZERO_RESULTS&&(nativeStatus=WPGMZA.Geocoder.ZERO_RESULTS),callback(null,nativeStatus)}})},WPGMZA.GoogleGeocoder.prototype.getAddressFromLatLng=function(options,callback){if(!options||!options.latLng)throw new Error("No latLng specified");var latLng=new WPGMZA.LatLng(options.latLng),geocoder=new google.maps.Geocoder;delete(options=$.extend(options,{location:{lat:latLng.lat,lng:latLng.lng}})).latLng,geocoder.geocode(options,function(results,status){"OK"!==status&&callback(null,WPGMZA.Geocoder.FAIL),results&&results.length||callback([],WPGMZA.Geocoder.NO_RESULTS),callback([results[0].formatted_address],WPGMZA.Geocoder.SUCCESS)})}}),jQuery(function($){WPGMZA.settings.engine&&"google-maps"!=WPGMZA.settings.engine||window.google&&window.google.maps&&(WPGMZA.GoogleHTMLOverlay=function(map){this.element=$("<div class='wpgmza-google-html-overlay'></div>"),this.visible=!0,this.position=new WPGMZA.LatLng,this.setMap(map.googleMap),this.wpgmzaMap=map},WPGMZA.GoogleHTMLOverlay.prototype=new google.maps.OverlayView,WPGMZA.GoogleHTMLOverlay.prototype.onAdd=function(){this.getPanes().overlayMouseTarget.appendChild(this.element[0])},WPGMZA.GoogleHTMLOverlay.prototype.onRemove=function(){this.element&&$(this.element).parent().length&&($(this.element).remove(),this.element=null)},WPGMZA.GoogleHTMLOverlay.prototype.draw=function(){this.updateElementPosition()},WPGMZA.GoogleHTMLOverlay.prototype.updateElementPosition=function(){var projection=this.getProjection();if(projection){var pixels=projection.fromLatLngToDivPixel(this.position.toGoogleLatLng());$(this.element).css({left:pixels.x,top:pixels.y})}})}),jQuery(function($){var Parent;WPGMZA.GoogleInfoWindow=function(feature){Parent.call(this,feature),this.setFeature(feature)},WPGMZA.GoogleInfoWindow.Z_INDEX=99,Parent=WPGMZA.isProVersion()?WPGMZA.ProInfoWindow:WPGMZA.InfoWindow,WPGMZA.GoogleInfoWindow.prototype=Object.create(Parent.prototype),WPGMZA.GoogleInfoWindow.prototype.constructor=WPGMZA.GoogleInfoWindow,WPGMZA.GoogleInfoWindow.prototype.setFeature=function(feature){(this.feature=feature)instanceof WPGMZA.Marker?this.googleObject=feature.googleMarker:feature instanceof WPGMZA.Polygon?this.googleObject=feature.googlePolygon:feature instanceof WPGMZA.Polyline&&(this.googleObject=feature.googlePolyline)},WPGMZA.GoogleInfoWindow.prototype.createGoogleInfoWindow=function(){var self=this;this.googleInfoWindow||(this.googleInfoWindow=new google.maps.InfoWindow,this.googleInfoWindow.setZIndex(WPGMZA.GoogleInfoWindow.Z_INDEX),google.maps.event.addListener(this.googleInfoWindow,"domready",function(event){self.trigger("domready")}),google.maps.event.addListener(this.googleInfoWindow,"closeclick",function(event){self.state!=WPGMZA.InfoWindow.STATE_CLOSED&&(self.state=WPGMZA.InfoWindow.STATE_CLOSED,self.feature.map.trigger("infowindowclose"))}))},WPGMZA.GoogleInfoWindow.prototype.open=function(map,feature){var self=this;if(!Parent.prototype.open.call(this,map,feature))return!1;this.parent=map,this.createGoogleInfoWindow(),this.setFeature(feature),this.googleInfoWindow.open(this.feature.map.googleMap,this.googleObject);var intervalID,guid=WPGMZA.guid(),eaBtn=WPGMZA.isProVersion()?"":this.addEditButton(),html="<div id='"+guid+"'>"+eaBtn+" "+this.content+"</div>";return this.googleInfoWindow.setContent(html),intervalID=setInterval(function(event){div=$("#"+guid),div.length&&(clearInterval(intervalID),div[0].wpgmzaFeature=self.feature,div.addClass("wpgmza-infowindow"),self.element=div[0],self.trigger("infowindowopen"))},50),!0},WPGMZA.GoogleInfoWindow.prototype.close=function(){this.googleInfoWindow&&(WPGMZA.InfoWindow.prototype.close.call(this),this.googleInfoWindow.close())},WPGMZA.GoogleInfoWindow.prototype.setContent=function(html){Parent.prototype.setContent.call(this,html),this.content=html,this.createGoogleInfoWindow(),this.googleInfoWindow.setContent(html)},WPGMZA.GoogleInfoWindow.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),this.createGoogleInfoWindow(),this.googleInfoWindow.setOptions(options)}}),jQuery(function($){var Parent;WPGMZA.GoogleMap=function(element,options){var self=this;Parent.call(this,element,options),this.loadGoogleMap(),options?this.setOptions(options,!0):this.setOptions({},!0),google.maps.event.addListener(this.googleMap,"click",function(event){var wpgmzaEvent=new WPGMZA.Event("click");wpgmzaEvent.latLng={lat:event.latLng.lat(),lng:event.latLng.lng()},self.dispatchEvent(wpgmzaEvent)}),google.maps.event.addListener(this.googleMap,"rightclick",function(event){var wpgmzaEvent=new WPGMZA.Event("rightclick");wpgmzaEvent.latLng={lat:event.latLng.lat(),lng:event.latLng.lng()},self.dispatchEvent(wpgmzaEvent)}),google.maps.event.addListener(this.googleMap,"dragend",function(event){self.dispatchEvent("dragend")}),google.maps.event.addListener(this.googleMap,"zoom_changed",function(event){self.dispatchEvent("zoom_changed"),self.dispatchEvent("zoomchanged")}),google.maps.event.addListener(this.googleMap,"idle",function(event){self.onIdle(event)}),WPGMZA.isProVersion()||(this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded"))},WPGMZA.isProVersion()?(Parent=WPGMZA.ProMap,WPGMZA.GoogleMap.prototype=Object.create(WPGMZA.ProMap.prototype)):(Parent=WPGMZA.Map,WPGMZA.GoogleMap.prototype=Object.create(WPGMZA.Map.prototype)),WPGMZA.GoogleMap.prototype.constructor=WPGMZA.GoogleMap,WPGMZA.GoogleMap.parseThemeData=function(raw){var json;try{json=JSON.parse(raw)}catch(e){try{json=eval(raw)}catch(e){var str=raw;str=str.replace(/\\'/g,"'"),str=str.replace(/\\"/g,'"'),str=str.replace(/\\0/g,"\0"),str=str.replace(/\\\\/g,"\\");try{json=eval(str)}catch(e){return console.warn("Couldn't parse theme data"),[]}}}return json},WPGMZA.GoogleMap.prototype.loadGoogleMap=function(){var self=this,options=this.settings.toGoogleMapsOptions();this.googleMap=new google.maps.Map(this.engineElement,options),google.maps.event.addListener(this.googleMap,"bounds_changed",function(){self.onBoundsChanged()}),1==this.settings.bicycle&&this.enableBicycleLayer(!0),1==this.settings.traffic&&this.enableTrafficLayer(!0),this.settings.transport_layer&&this.enablePublicTransportLayer(!0),this.showPointsOfInterest(this.settings.wpgmza_show_point_of_interest),$(this.engineElement).append($(this.element).find(".wpgmza-loader"))},WPGMZA.GoogleMap.prototype.setOptions=function(options,initializing){if(Parent.prototype.setOptions.call(this,options),options.scrollwheel&&delete options.scrollwheel,initializing){var converted=$.extend(options,this.settings.toGoogleMapsOptions()),clone=$.extend({},converted);if(!clone.center instanceof google.maps.LatLng&&(clone.center instanceof WPGMZA.LatLng||"object"==typeof clone.center)&&(clone.center={lat:parseFloat(clone.center.lat),lng:parseFloat(clone.center.lng)}),this.settings.hide_point_of_interest){clone.styles||(clone.styles=[]),clone.styles.push({featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]})}this.googleMap.setOptions(clone)}else this.googleMap.setOptions(options)},WPGMZA.GoogleMap.prototype.addMarker=function(marker){marker.googleMarker.setMap(this.googleMap),Parent.prototype.addMarker.call(this,marker)},WPGMZA.GoogleMap.prototype.removeMarker=function(marker){marker.googleMarker.setMap(null),Parent.prototype.removeMarker.call(this,marker)},WPGMZA.GoogleMap.prototype.addPolygon=function(polygon){polygon.googlePolygon.setMap(this.googleMap),Parent.prototype.addPolygon.call(this,polygon)},WPGMZA.GoogleMap.prototype.removePolygon=function(polygon){polygon.googlePolygon.setMap(null),Parent.prototype.removePolygon.call(this,polygon)},WPGMZA.GoogleMap.prototype.addPolyline=function(polyline){polyline.googlePolyline.setMap(this.googleMap),Parent.prototype.addPolyline.call(this,polyline)},WPGMZA.GoogleMap.prototype.removePolyline=function(polyline){polyline.googlePolyline.setMap(null),Parent.prototype.removePolyline.call(this,polyline)},WPGMZA.GoogleMap.prototype.addCircle=function(circle){circle.googleCircle.setMap(this.googleMap),Parent.prototype.addCircle.call(this,circle)},WPGMZA.GoogleMap.prototype.removeCircle=function(circle){circle.googleCircle.setMap(null),Parent.prototype.removeCircle.call(this,circle)},WPGMZA.GoogleMap.prototype.addRectangle=function(rectangle){rectangle.googleRectangle.setMap(this.googleMap),Parent.prototype.addRectangle.call(this,rectangle)},WPGMZA.GoogleMap.prototype.removeRectangle=function(rectangle){rectangle.googleRectangle.setMap(null),Parent.prototype.removeRectangle.call(this,rectangle)},WPGMZA.GoogleMap.prototype.getCenter=function(){var latLng=this.googleMap.getCenter();return{lat:latLng.lat(),lng:latLng.lng()}},WPGMZA.GoogleMap.prototype.setCenter=function(latLng){WPGMZA.Map.prototype.setCenter.call(this,latLng),latLng instanceof WPGMZA.LatLng?this.googleMap.setCenter({lat:latLng.lat,lng:latLng.lng}):this.googleMap.setCenter(latLng)},WPGMZA.GoogleMap.prototype.panTo=function(latLng){latLng instanceof WPGMZA.LatLng?this.googleMap.panTo({lat:latLng.lat,lng:latLng.lng}):this.googleMap.panTo(latLng)},WPGMZA.GoogleMap.prototype.getZoom=function(){return this.googleMap.getZoom()},WPGMZA.GoogleMap.prototype.setZoom=function(value){if(isNaN(value))throw new Error("Value must not be NaN");return this.googleMap.setZoom(parseInt(value))},WPGMZA.GoogleMap.prototype.getBounds=function(){var bounds=this.googleMap.getBounds(),northEast=bounds.getNorthEast(),southWest=bounds.getSouthWest(),nativeBounds=new WPGMZA.LatLngBounds({});return nativeBounds.north=northEast.lat(),nativeBounds.south=southWest.lat(),nativeBounds.west=southWest.lng(),nativeBounds.east=northEast.lng(),nativeBounds.topLeft={lat:northEast.lat(),lng:southWest.lng()},nativeBounds.bottomRight={lat:southWest.lat(),lng:northEast.lng()},nativeBounds},WPGMZA.GoogleMap.prototype.fitBounds=function(southWest,northEast){if(southWest instanceof WPGMZA.LatLng&&(southWest={lat:southWest.lat,lng:southWest.lng}),northEast instanceof WPGMZA.LatLng)northEast={lat:northEast.lat,lng:northEast.lng};else if(southWest instanceof WPGMZA.LatLngBounds){var bounds=southWest;southWest={lat:bounds.south,lng:bounds.west},northEast={lat:bounds.north,lng:bounds.east}}var nativeBounds=new google.maps.LatLngBounds(southWest,northEast);this.googleMap.fitBounds(nativeBounds)},WPGMZA.GoogleMap.prototype.fitBoundsToVisibleMarkers=function(){for(var bounds=new google.maps.LatLngBounds,i=0;i<this.markers.length;i++)markers[i].getVisible()&&bounds.extend(markers[i].getPosition());this.googleMap.fitBounds(bounds)},WPGMZA.GoogleMap.prototype.enableBicycleLayer=function(enable){this.bicycleLayer||(this.bicycleLayer=new google.maps.BicyclingLayer),this.bicycleLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.enableTrafficLayer=function(enable){this.trafficLayer||(this.trafficLayer=new google.maps.TrafficLayer),this.trafficLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.enablePublicTransportLayer=function(enable){this.publicTransportLayer||(this.publicTransportLayer=new google.maps.TransitLayer),this.publicTransportLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.showPointsOfInterest=function(show){var text=$("textarea[name='theme_data']").val();if(text){var styles=JSON.parse(text);styles.push({featureType:"poi",stylers:[{visibility:show?"on":"off"}]}),this.googleMap.setOptions({styles:styles})}},WPGMZA.GoogleMap.prototype.getMinZoom=function(){return parseInt(this.settings.min_zoom)},WPGMZA.GoogleMap.prototype.setMinZoom=function(value){this.googleMap.setOptions({minZoom:value,maxZoom:this.getMaxZoom()})},WPGMZA.GoogleMap.prototype.getMaxZoom=function(){return parseInt(this.settings.max_zoom)},WPGMZA.GoogleMap.prototype.setMaxZoom=function(value){this.googleMap.setOptions({minZoom:this.getMinZoom(),maxZoom:value})},WPGMZA.GoogleMap.prototype.latLngToPixels=function(latLng){var map=this.googleMap,nativeLatLng=new google.maps.LatLng({lat:parseFloat(latLng.lat),lng:parseFloat(latLng.lng)}),topRight=map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast()),bottomLeft=map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest()),scale=Math.pow(2,map.getZoom()),worldPoint=map.getProjection().fromLatLngToPoint(nativeLatLng);return{x:(worldPoint.x-bottomLeft.x)*scale,y:(worldPoint.y-topRight.y)*scale}},WPGMZA.GoogleMap.prototype.pixelsToLatLng=function(x,y){null==y&&("x"in x&&"y"in x?(y=x.y,x=x.x):console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)"));var map=this.googleMap,topRight=map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast()),bottomLeft=map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest()),scale=Math.pow(2,map.getZoom()),worldPoint=new google.maps.Point(x/scale+bottomLeft.x,y/scale+topRight.y),latLng=map.getProjection().fromPointToLatLng(worldPoint);return{lat:latLng.lat(),lng:latLng.lng()}},WPGMZA.GoogleMap.prototype.onElementResized=function(event){this.googleMap&&google.maps.event.trigger(this.googleMap,"resize")},WPGMZA.GoogleMap.prototype.enableAllInteractions=function(){var options={scrollwheel:!0,draggable:!0,disableDoubleClickZoom:!1};this.googleMap.setOptions(options)}}),jQuery(function($){var Parent;WPGMZA.GoogleMarker=function(options){var self=this;Parent.call(this,options);var settings={};if(options)for(var name in options)options[name]instanceof WPGMZA.LatLng?settings[name]=options[name].toGoogleLatLng():options[name]instanceof WPGMZA.Map||"icon"==name||(settings[name]=options[name]);this.googleMarker=new google.maps.Marker(settings),(this.googleMarker.wpgmzaMarker=this).googleFeature=this.googleMarker,this.googleMarker.setPosition(new google.maps.LatLng({lat:parseFloat(this.lat),lng:parseFloat(this.lng)})),this.anim&&this.googleMarker.setAnimation(this.anim),this.animation&&this.googleMarker.setAnimation(this.animation),google.maps.event.addListener(this.googleMarker,"click",function(){self.dispatchEvent("click"),self.dispatchEvent("select")}),google.maps.event.addListener(this.googleMarker,"mouseover",function(){self.dispatchEvent("mouseover")}),google.maps.event.addListener(this.googleMarker,"dragend",function(){var googleMarkerPosition=self.googleMarker.getPosition();self.setPosition({lat:googleMarkerPosition.lat(),lng:googleMarkerPosition.lng()}),self.dispatchEvent({type:"dragend",latLng:self.getPosition()}),self.trigger("change")}),this.setOptions(settings),this.trigger("init")},Parent=WPGMZA.isProVersion()?WPGMZA.ProMarker:WPGMZA.Marker,WPGMZA.GoogleMarker.prototype=Object.create(Parent.prototype),WPGMZA.GoogleMarker.prototype.constructor=WPGMZA.GoogleMarker,Object.defineProperty(WPGMZA.GoogleMarker.prototype,"opacity",{get:function(){return this._opacity},set:function(value){this._opacity=value,this.googleMarker.setOpacity(value)}}),WPGMZA.GoogleMarker.prototype.setLabel=function(label){label?(this.googleMarker.setLabel({text:label}),this.googleMarker.getIcon()||this.googleMarker.setIcon(WPGMZA.settings.default_marker_icon)):this.googleMarker.setLabel(null)},WPGMZA.GoogleMarker.prototype.setPosition=function(latLng){Parent.prototype.setPosition.call(this,latLng),this.googleMarker.setPosition({lat:this.lat,lng:this.lng})},WPGMZA.GoogleMarker.prototype.updateOffset=function(){var params,self=this,icon=this.googleMarker.getIcon(),img=new Image,x=this._offset.x,y=this._offset.y;icon=icon||WPGMZA.settings.default_marker_icon,params="string"==typeof icon?{url:icon}:icon,img.onload=function(){var defaultAnchor_x=img.width/2,defaultAnchor_y=img.height;params.anchor=new google.maps.Point(defaultAnchor_x-x,defaultAnchor_y-y),self.googleMarker.setIcon(params)},img.src=params.url},WPGMZA.GoogleMarker.prototype.setOptions=function(options){this.googleMarker.setOptions(options)},WPGMZA.GoogleMarker.prototype.setAnimation=function(animation){Parent.prototype.setAnimation.call(this,animation),this.googleMarker.setAnimation(animation)},WPGMZA.GoogleMarker.prototype.setVisible=function(visible){Parent.prototype.setVisible.call(this,visible),this.googleMarker.setVisible(!!visible)},WPGMZA.GoogleMarker.prototype.getVisible=function(visible){return this.googleMarker.getVisible()},WPGMZA.GoogleMarker.prototype.setDraggable=function(draggable){this.googleMarker.setDraggable(draggable)},WPGMZA.GoogleMarker.prototype.setOpacity=function(opacity){this.googleMarker.setOpacity(opacity)}}),jQuery(function($){WPGMZA.GoogleModernStoreLocatorCircle=function(map,settings){var self=this;WPGMZA.ModernStoreLocatorCircle.call(this,map,settings),this.intervalID=setInterval(function(){var mapSize={width:$(self.mapElement).width(),height:$(self.mapElement).height()};mapSize.width==self.mapSize.width&&mapSize.height==self.mapSize.height||(self.canvasLayer.resize_(),self.canvasLayer.draw(),self.mapSize=mapSize)},1e3),$(document).bind("webkitfullscreenchange mozfullscreenchange fullscreenchange",function(){self.canvasLayer.resize_(),self.canvasLayer.draw()})},WPGMZA.GoogleModernStoreLocatorCircle.prototype=Object.create(WPGMZA.ModernStoreLocatorCircle.prototype),WPGMZA.GoogleModernStoreLocatorCircle.prototype.constructor=WPGMZA.GoogleModernStoreLocatorCircle,WPGMZA.GoogleModernStoreLocatorCircle.prototype.initCanvasLayer=function(){var self=this;this.canvasLayer&&(this.canvasLayer.setMap(null),this.canvasLayer.setAnimate(!1)),this.canvasLayer=new CanvasLayer({map:this.map.googleMap,resizeHandler:function(event){self.onResize(event)},updateHandler:function(event){self.onUpdate(event)},animate:!0,resolutionScale:this.getResolutionScale()})},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setOptions=function(options){WPGMZA.ModernStoreLocatorCircle.prototype.setOptions.call(this,options),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setPosition=function(position){WPGMZA.ModernStoreLocatorCircle.prototype.setPosition.call(this,position),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setRadius=function(radius){WPGMZA.ModernStoreLocatorCircle.prototype.setRadius.call(this,radius),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){var spherical=google.maps.geometry.spherical,center=this.settings.center,equator=new WPGMZA.LatLng({lat:0,lng:0}),latitude=new WPGMZA.LatLng({lat:center.lat,lng:0}),offsetAtEquator=spherical.computeOffset(equator.toGoogleLatLng(),1e3*km,90),result=.006395*km*(spherical.computeOffset(latitude.toGoogleLatLng(),1e3*km,90).lng()/offsetAtEquator.lng());if(isNaN(result))throw new Error("here");return result},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){return{width:this.canvasLayer.canvas.width,height:this.canvasLayer.canvas.height}},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getWorldOriginOffset=function(){var position=this.map.googleMap.getProjection().fromLatLngToPoint(this.canvasLayer.getTopLeft());return{x:-position.x,y:-position.y}},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getCenterPixels=function(){var center=new WPGMZA.LatLng(this.settings.center);return this.map.googleMap.getProjection().fromLatLngToPoint(center.toGoogleLatLng())},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getContext=function(type){return this.canvasLayer.canvas.getContext("2d")},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getScale=function(){return Math.pow(2,this.map.getZoom())*this.getResolutionScale()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setVisible=function(visible){WPGMZA.ModernStoreLocatorCircle.prototype.setVisible.call(this,visible),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.destroy=function(){this.canvasLayer.setMap(null),this.canvasLayer=null,clearInterval(this.intervalID)}}),jQuery(function($){WPGMZA.GoogleModernStoreLocator=function(map_id){var map=this.map=WPGMZA.getMapByID(map_id);WPGMZA.ModernStoreLocator.call(this,map_id);var restrict=map.settings.wpgmza_store_locator_restrict;this.addressInput=$(this.element).find(".addressInput, #addressInput")[0],this.addressInput&&restrict&&restrict.length,this.map.googleMap.controls[google.maps.ControlPosition.TOP_CENTER].push(this.element)},WPGMZA.GoogleModernStoreLocator.prototype=Object.create(WPGMZA.ModernStoreLocator.prototype),WPGMZA.GoogleModernStoreLocator.prototype.constructor=WPGMZA.GoogleModernStoreLocator}),jQuery(function($){var Parent;WPGMZA.GooglePolygon=function(options,googlePolygon){var self=this;options=options||{},Parent.call(this,options,googlePolygon),this.googlePolygon=googlePolygon||new google.maps.Polygon,this.googleFeature=this.googlePolygon,options&&options.polydata&&this.googlePolygon.setOptions({paths:this.parseGeometry(options.polydata)}),this.googlePolygon.wpgmzaPolygon=this,options&&this.setOptions(options),google.maps.event.addListener(this.googlePolygon,"click",function(){self.dispatchEvent({type:"click"})})},Parent=WPGMZA.isProVersion()?WPGMZA.ProPolygon:WPGMZA.Polygon,WPGMZA.GooglePolygon.prototype=Object.create(Parent.prototype),WPGMZA.GooglePolygon.prototype.constructor=WPGMZA.GooglePolygon,WPGMZA.GooglePolygon.prototype.updateNativeFeature=function(){this.googlePolygon.setOptions(this.getScalarProperties())},WPGMZA.GooglePolygon.prototype.getEditable=function(){return this.googlePolygon.getOptions().editable},WPGMZA.GooglePolygon.prototype.setEditable=function(value){var self=this;this.googlePolygon.setOptions({editable:value}),value&&(this.googlePolygon.getPaths().forEach(function(path,index){["insert_at","remove_at","set_at"].forEach(function(name){google.maps.event.addListener(path,name,function(){self.trigger("change")})})}),google.maps.event.addListener(this.googlePolygon,"dragend",function(event){self.trigger("change")}),google.maps.event.addListener(this.googlePolygon,"click",function(event){WPGMZA.altKeyDown&&(this.getPath().removeAt(event.vertex),self.trigger("change"))}))},WPGMZA.GooglePolygon.prototype.setDraggable=function(value){this.googlePolygon.setDraggable(value)},WPGMZA.GooglePolygon.prototype.getGeometry=function(){for(var result=[],path=this.googlePolygon.getPath(),i=0;i<path.getLength();i++){var latLng=path.getAt(i);result.push({lat:latLng.lat(),lng:latLng.lng()})}return result}}),jQuery(function($){WPGMZA.GooglePolyline=function(options,googlePolyline){var self=this;if(WPGMZA.Polyline.call(this,options,googlePolyline),this.googlePolyline=googlePolyline||new google.maps.Polyline(this.settings),this.googleFeature=this.googlePolyline,options&&options.polydata){var path=this.parseGeometry(options.polydata);this.googlePolyline.setPath(path)}this.googlePolyline.wpgmzaPolyline=this,options&&this.setOptions(options),google.maps.event.addListener(this.googlePolyline,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GooglePolyline.prototype=Object.create(WPGMZA.Polyline.prototype),WPGMZA.GooglePolyline.prototype.constructor=WPGMZA.GooglePolyline,WPGMZA.GooglePolyline.prototype.updateNativeFeature=function(){this.googlePolyline.setOptions(this.getScalarProperties())},WPGMZA.GooglePolyline.prototype.setEditable=function(value){var self=this;if(this.googlePolyline.setOptions({editable:value}),value){var path=this.googlePolyline.getPath();["insert_at","remove_at","set_at"].forEach(function(name){google.maps.event.addListener(path,name,function(){self.trigger("change")})}),google.maps.event.addListener(this.googlePolyline,"dragend",function(event){self.trigger("change")}),google.maps.event.addListener(this.googlePolyline,"click",function(event){WPGMZA.altKeyDown&&(this.getPath().removeAt(event.vertex),self.trigger("change"))})}},WPGMZA.GooglePolyline.prototype.setDraggable=function(value){this.googlePolyline.setOptions({draggable:value})},WPGMZA.GooglePolyline.prototype.getGeometry=function(){for(var result=[],path=this.googlePolyline.getPath(),i=0;i<path.getLength();i++){var latLng=path.getAt(i);result.push({lat:latLng.lat(),lng:latLng.lng()})}return result}}),jQuery(function($){WPGMZA.GoogleRectangle=function(options,googleRectangle){var self=this;options=options||{},WPGMZA.Rectangle.call(this,options,googleRectangle),googleRectangle?(this.googleRectangle=googleRectangle,this.cornerA=options.cornerA=new WPGMZA.LatLng({lat:googleRectangle.getBounds().getNorthEast().lat(),lng:googleRectangle.getBounds().getSouthWest().lng()}),this.cornerB=options.cornerB=new WPGMZA.LatLng({lat:googleRectangle.getBounds().getSouthWest().lat(),lng:googleRectangle.getBounds().getNorthEast().lng()})):(this.googleRectangle=new google.maps.Rectangle,this.googleRectangle.wpgmzaRectangle=this),this.googleFeature=this.googleRectangle,options&&this.setOptions(options),google.maps.event.addListener(this.googleRectangle,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GoogleRectangle.prototype=Object.create(WPGMZA.Rectangle.prototype),WPGMZA.GoogleRectangle.prototype.constructor=WPGMZA.GoogleRectangle,WPGMZA.GoogleRectangle.prototype.getBounds=function(){return WPGMZA.LatLngBounds.fromGoogleLatLngBounds(this.googleRectangle.getBounds())},WPGMZA.GoogleRectangle.prototype.setVisible=function(visible){this.googleRectangle.setVisible(!!visible)},WPGMZA.GoogleRectangle.prototype.setDraggable=function(value){this.googleRectangle.setDraggable(!!value)},WPGMZA.GoogleRectangle.prototype.setEditable=function(value){var self=this;this.googleRectangle.setEditable(!!value),value&&google.maps.event.addListener(this.googleRectangle,"bounds_changed",function(event){self.trigger("change")})},WPGMZA.GoogleRectangle.prototype.setOptions=function(options){WPGMZA.Rectangle.prototype.setOptions.apply(this,arguments),options.cornerA&&options.cornerB&&(this.cornerA=new WPGMZA.LatLng(options.cornerA),this.cornerB=new WPGMZA.LatLng(options.cornerB))},WPGMZA.GoogleRectangle.prototype.updateNativeFeature=function(){var googleOptions=this.getScalarProperties(),north=parseFloat(this.cornerA.lat),west=parseFloat(this.cornerA.lng),south=parseFloat(this.cornerB.lat),east=parseFloat(this.cornerB.lng);north&&west&&south&&east&&(googleOptions.bounds={north:north,west:west,south:south,east:east}),this.googleRectangle.setOptions(googleOptions)}}),jQuery(function($){WPGMZA.GoogleText=function(options){WPGMZA.Text.apply(this,arguments),this.overlay=new WPGMZA.GoogleTextOverlay(options)},WPGMZA.extend(WPGMZA.GoogleText,WPGMZA.Text)}),jQuery(function($){WPGMZA.GoogleTextOverlay=function(options){this.element=$("<div class='wpgmza-google-text-overlay'><div class='wpgmza-inner'></div></div>"),(options=options||{}).position&&(this.position=options.position),options.text&&this.element.find(".wpgmza-inner").text(options.text),options.map&&this.setMap(options.map.googleMap)},window.google&&google.maps&&google.maps.OverlayView&&(WPGMZA.GoogleTextOverlay.prototype=new google.maps.OverlayView),WPGMZA.GoogleTextOverlay.prototype.onAdd=function(){var position=this.getProjection().fromLatLngToDivPixel(this.position.toGoogleLatLng());this.element.css({position:"absolute",left:position.x+"px",top:position.y+"px",minWidth:"200px"}),this.getPanes().floatPane.appendChild(this.element[0])},WPGMZA.GoogleTextOverlay.prototype.draw=function(){var position=this.getProjection().fromLatLngToDivPixel(this.position.toGoogleLatLng());this.element.css({position:"absolute",left:position.x+"px",top:position.y+"px",minWidth:"200px"})},WPGMZA.GoogleTextOverlay.prototype.onRemove=function(){this.element.remove()},WPGMZA.GoogleTextOverlay.prototype.hide=function(){this.element.hide()},WPGMZA.GoogleTextOverlay.prototype.show=function(){this.element.show()},WPGMZA.GoogleTextOverlay.prototype.toggle=function(){this.element.is(":visible")?this.element.hide():this.element.show()}}),jQuery(function($){"google-maps"==WPGMZA.settings.engine&&(WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code||(WPGMZA.GoogleVertexContextMenu=function(mapEditPage){var self=this;this.mapEditPage=mapEditPage,this.element=document.createElement("div"),this.element.className="wpgmza-vertex-context-menu",this.element.innerHTML="Delete",google.maps.event.addDomListener(this.element,"click",function(event){return self.removeVertex(),event.preventDefault(),event.stopPropagation(),!1})},WPGMZA.GoogleVertexContextMenu.prototype=new google.maps.OverlayView,WPGMZA.GoogleVertexContextMenu.prototype.onAdd=function(){var self=this,map=this.getMap();this.getPanes().floatPane.appendChild(this.element),this.divListener=google.maps.event.addDomListener(map.getDiv(),"mousedown",function(e){e.target!=self.element&&self.close()},!0)},WPGMZA.GoogleVertexContextMenu.prototype.onRemove=function(){google.maps.event.removeListener(this.divListener),this.element.parentNode.removeChild(this.element),this.set("position"),this.set("path"),this.set("vertex")},WPGMZA.GoogleVertexContextMenu.prototype.open=function(map,path,vertex){this.set("position",path.getAt(vertex)),this.set("path",path),this.set("vertex",vertex),this.setMap(map),this.draw()},WPGMZA.GoogleVertexContextMenu.prototype.close=function(){this.setMap(null)},WPGMZA.GoogleVertexContextMenu.prototype.draw=function(){var position=this.get("position"),projection=this.getProjection();if(position&&projection){var point=projection.fromLatLngToDivPixel(position);this.element.style.top=point.y+"px",this.element.style.left=point.x+"px"}},WPGMZA.GoogleVertexContextMenu.prototype.removeVertex=function(){var path=this.get("path"),vertex=this.get("vertex");path&&null!=vertex&&path.removeAt(vertex),this.close()}))}),jQuery(function($){WPGMZA.FeaturePanel=function(element,mapEditPage){var self=this;WPGMZA.EventDispatcher.apply(this,arguments),this.map=mapEditPage.map,this.drawingManager=mapEditPage.drawingManager,this.feature=null,this.element=element,this.initDefaults(),this.setMode(WPGMZA.FeaturePanel.MODE_ADD),this.drawingInstructionsElement=$(this.element).find(".wpgmza-feature-drawing-instructions"),this.drawingInstructionsElement.detach(),this.editingInstructionsElement=$(this.element).find(".wpgmza-feature-editing-instructions"),this.editingInstructionsElement.detach(),$("#wpgmaps_tabs_markers").on("tabsactivate",function(event,ui){$.contains(ui.newPanel[0],self.element[0])&&self.onTabActivated(event)}),$("#wpgmaps_tabs_markers").on("tabsactivate",function(event,ui){$.contains(ui.oldPanel[0],self.element[0])&&self.onTabDeactivated(event)}),$(document.body).on("click","[data-edit-"+this.featureType+"-id]",function(event){self.onEditFeature(event)}),$(document.body).on("click","[data-delete-"+this.featureType+"-id]",function(event){self.onDeleteFeature(event)}),$(this.element).find(".wpgmza-save-feature").on("click",function(event){self.onSave(event)}),this.drawingManager.on(self.drawingManagerCompleteEvent,function(event){self.onDrawingComplete(event)}),this.drawingManager.on("drawingmodechanged",function(event){self.onDrawingModeChanged(event)}),$(this.element).on("change input",function(event){self.onPropertyChanged(event)})},WPGMZA.extend(WPGMZA.FeaturePanel,WPGMZA.EventDispatcher),WPGMZA.FeaturePanel.MODE_ADD="add",WPGMZA.FeaturePanel.MODE_EDIT="edit",WPGMZA.FeaturePanel.prevEditableFeature=null,Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureType",{get:function(){return $(this.element).attr("data-wpgmza-feature-type")}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"drawingManagerCompleteEvent",{get:function(){return this.featureType+"complete"}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureDataTable",{get:function(){return $("[data-wpgmza-datatable][data-wpgmza-feature-type='"+this.featureType+"']")[0].wpgmzaDataTable}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureAccordion",{get:function(){return $(this.element).closest(".wpgmza-accordion")}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"map",{get:function(){return WPGMZA.mapEditPage.map}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"mode",{get:function(){return this._mode}}),WPGMZA.FeaturePanel.prototype.initPreloader=function(){this.preloader||(this.preloader=$(WPGMZA.preloaderHTML),this.preloader.hide(),$(this.element).append(this.preloader))},WPGMZA.FeaturePanel.prototype.initDataTable=function(){var el=$(this.element).find("[data-wpgmza-datatable][data-wpgmza-rest-api-route]");this[this.featureType+"AdminDataTable"]=new WPGMZA.AdminFeatureDataTable(el)},WPGMZA.FeaturePanel.prototype.initDefaults=function(){$(this.element).find("[data-ajax-name]:not([type='radio'])").each(function(index,el){var val=$(el).val();val&&$(el).attr("data-default-value",val)})},WPGMZA.FeaturePanel.prototype.setCaptionType=function(type,id){var icons={add:"fa-plus-circle",save:"fa-pencil-square-o"};switch(type){case WPGMZA.FeaturePanel.MODE_ADD:case WPGMZA.FeaturePanel.MODE_EDIT:this.featureAccordion.find("[data-add-caption][data-edit-caption]").each(function(index,el){var text=$(el).attr("data-"+type+"-caption"),icon=$(el).find("i.fa");id&&(text+=" "+id),$(el).text(text),icon.length&&((icon=$("<i class='fa' aria-hidden='true'></i>")).addClass(icons[type]),$(el).prepend(" "),$(el).prepend(icon))});break;default:throw new Error("Invalid type")}},WPGMZA.FeaturePanel.prototype.setMode=function(type,id){this._mode=type,this.setCaptionType(type,id)},WPGMZA.FeaturePanel.prototype.setTargetFeature=function(feature){var self=this;if(WPGMZA.FeaturePanel.prevEditableFeature){var prev=WPGMZA.FeaturePanel.prevEditableFeature;prev.setEditable(!1),prev.setDraggable(!1),prev.off("change")}feature?(feature.setEditable(!0),feature.setDraggable(!0),feature.on("change",function(event){self.onFeatureChanged(event)}),this.setMode(WPGMZA.FeaturePanel.MODE_EDIT),this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showInstructions()):this.setMode(WPGMZA.FeaturePanel.MODE_ADD),this.feature=WPGMZA.FeaturePanel.prevEditableFeature=feature},WPGMZA.FeaturePanel.prototype.reset=function(){$(this.element).find("[data-ajax-name]:not([data-ajax-name='map_id']):not([type='color']):not([type='checkbox']):not([type='radio'])").val(""),$(this.element).find("select[data-ajax-name]>option:first-child").prop("selected",!0),$(this.element).find("[data-ajax-name='id']").val("-1"),$(this.element).find("input[type='checkbox']").prop("checked",!1),tinyMCE.get("wpgmza-description-editor")?tinyMCE.get("wpgmza-description-editor").setContent(""):$("#wpgmza-description-editor").val(""),$("#wpgmza-description-editor").val(""),this.showPreloader(!1),this.setMode(WPGMZA.FeaturePanel.MODE_ADD),$(this.element).find("[data-ajax-name][data-default-value]").each(function(index,el){$(el).val($(el).data("default-value"))})},WPGMZA.FeaturePanel.prototype.select=function(arg){var id,expectedBaseClass,self=this;if(this.reset(),$.isNumeric(arg))id=arg;else{if(expectedBaseClass=WPGMZA[WPGMZA.capitalizeWords(this.featureType)],!(feature instanceof expectedBaseClass))throw new Error("Invalid feature type for this panel");id=arg.id}this.showPreloader(!0),WPGMZA.animateScroll($(".wpgmza_map")),WPGMZA.restAPI.call("/"+this.featureType+"s/"+id+"?skip_cache=1",{success:function(data,status,xhr){var getByIDFunction="get"+WPGMZA.capitalizeWords(self.featureType)+"ByID",feature=self.map[getByIDFunction](id);self.populate(data),self.showPreloader(!1),self.setMode(WPGMZA.FeaturePanel.MODE_EDIT,id),self.setTargetFeature(feature)}})},WPGMZA.FeaturePanel.prototype.showPreloader=function(show){this.initPreloader(),0==arguments.length||show?(this.preloader.fadeIn(),this.element.addClass("wpgmza-loading")):(this.preloader.fadeOut(),this.element.removeClass("wpgmza-loading"))},WPGMZA.FeaturePanel.prototype.populate=function(data){var value,target,name;for(name in data)switch(target=$(this.element).find("[data-ajax-name='"+name+"']"),value=data[name],(target.attr("type")||"").toLowerCase()){case"checkbox":case"radio":target.prop("checked",1==data[name]);break;case"color":value.match(/^#/)||(value="#"+value);default:"object"==typeof value&&(value=JSON.stringify(value)),$(this.element).find("[data-ajax-name='"+name+"']:not(select)").val(value),$(this.element).find("select[data-ajax-name='"+name+"']").each(function(index,el){"string"==typeof value&&0==data[name].length||$(el).val(value)})}},WPGMZA.FeaturePanel.prototype.serializeFormData=function(){var fields=$(this.element).find("[data-ajax-name]"),data={};return fields.each(function(index,el){var type="text";switch($(el).attr("type")&&(type=$(el).attr("type").toLowerCase()),type){case"checkbox":data[$(el).attr("data-ajax-name")]=$(el).prop("checked")?1:0;break;case"radio":$(el).prop("checked")&&(data[$(el).attr("data-ajax-name")]=$(el).val());break;default:data[$(el).attr("data-ajax-name")]=$(el).val()}}),data},WPGMZA.FeaturePanel.prototype.discardChanges=function(){if(this.feature){var feature=this.feature;this.setTargetFeature(null),feature&&feature.map&&(this.map["remove"+WPGMZA.capitalizeWords(this.featureType)](feature),-1<feature.id&&this.updateFeatureByID(feature.id))}},WPGMZA.FeaturePanel.prototype.updateFeatureByID=function(id){var feature,self=this,route="/"+this.featureType+"s/",functionSuffix=WPGMZA.capitalizeWords(self.featureType),getByIDFunction="get"+functionSuffix+"ByID",removeFunction="remove"+functionSuffix,addFunction="add"+functionSuffix;WPGMZA.restAPI.call(route+id,{success:function(data,status,xhr){(feature=self.map[getByIDFunction](id))&&self.map[removeFunction](feature),feature=WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data),self.map[addFunction](feature)}})},WPGMZA.FeaturePanel.prototype.showInstructions=function(){switch(this.mode){case WPGMZA.FeaturePanel.MODE_ADD:$(this.map.element).append(this.drawingInstructionsElement),$(this.drawingInstructionsElement).hide().fadeIn();break;default:$(this.map.element).append(this.editingInstructionsElement),$(this.editingInstructionsElement).hide().fadeIn()}},WPGMZA.FeaturePanel.prototype.onTabActivated=function(){this.reset(),this.drawingManager.setDrawingMode(this.featureType),this.onAddFeature(event),$(".wpgmza-table-container-title").hide(),$(".wpgmza-table-container").hide();var featureString=this.featureType.charAt(0).toUpperCase()+this.featureType.slice(1);$("#wpgmza-table-container-"+featureString).show(),$("#wpgmza-table-container-title-"+featureString).show()},WPGMZA.FeaturePanel.prototype.onTabDeactivated=function(){this.discardChanges(),this.setTargetFeature(null)},WPGMZA.FeaturePanel.prototype.onAddFeature=function(event){this.drawingManager.setDrawingMode(this.featureType)},WPGMZA.FeaturePanel.prototype.onEditFeature=function(event){var name="data-edit-"+this.featureType+"-id",id=$(event.currentTarget).attr(name);this.discardChanges(),this.select(id)},WPGMZA.FeaturePanel.prototype.onDeleteFeature=function(event){var self=this,name="data-delete-"+this.featureType+"-id",id=$(event.currentTarget).attr(name),route="/"+this.featureType+"s/",feature=this.map["get"+WPGMZA.capitalizeWords(this.featureType)+"ByID"](id);this.featureDataTable.dataTable.processing(!0),WPGMZA.restAPI.call(route+id,{method:"DELETE",success:function(data,status,xhr){self.map["remove"+WPGMZA.capitalizeWords(self.featureType)](feature),self.featureDataTable.reload()}})},WPGMZA.FeaturePanel.prototype.onDrawingModeChanged=function(event){$(this.drawingInstructionsElement).detach(),$(this.editingInstructionsElement).detach(),this.drawingManager.mode==this.featureType&&this.showInstructions()},WPGMZA.FeaturePanel.prototype.onDrawingComplete=function(event){var engineFeature=event["engine"+WPGMZA.capitalizeWords(this.featureType)],formData=this.serializeFormData(),geometryField=$(this.element).find("textarea[data-ajax-name$='data']");delete formData.polydata;var nativeFeature=WPGMZA[WPGMZA.capitalizeWords(this.featureType)].createInstance(formData,engineFeature);this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.map["add"+WPGMZA.capitalizeWords(this.featureType)](nativeFeature),this.setTargetFeature(nativeFeature),geometryField.length&&geometryField.val(JSON.stringify(nativeFeature.getGeometry())),this.featureType},WPGMZA.FeaturePanel.prototype.onPropertyChanged=function(event){var feature=this.feature;feature&&($(this.element).find(":input[data-ajax-name]").each(function(index,el){var key=$(el).attr("data-ajax-name");feature[key]=$(el).val()}),feature.updateNativeFeature())},WPGMZA.FeaturePanel.prototype.onFeatureChanged=function(event){var geometryField=$(this.element).find("textarea[data-ajax-name$='data']");geometryField.length&&geometryField.val(JSON.stringify(this.feature.getGeometry()))},WPGMZA.FeaturePanel.prototype.onSave=function(event){var self=this,id=$(self.element).find("[data-ajax-name='id']").val(),data=this.serializeFormData(),route="/"+this.featureType+"s/",isNew=-1==id;"circle"!=this.featureType||data.center?"rectangle"!=this.featureType||data.cornerA?"polygon"!=this.featureType||data.polydata?"polyline"!=this.featureType||data.polydata?(isNew||(route+=id),WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showPreloader(!0),WPGMZA.restAPI.call(route,{method:"POST",data:data,success:function(data,status,xhr){var feature,functionSuffix=WPGMZA.capitalizeWords(self.featureType),getByIDFunction="get"+functionSuffix+"ByID",removeFunction="remove"+functionSuffix,addFunction="add"+functionSuffix;self.reset(),(feature=self.map[getByIDFunction](id))&&self.map[removeFunction](feature),self.setTargetFeature(null),self.showPreloader(!1),feature=WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data),self.map[addFunction](feature),self.featureDataTable.reload(),self.onTabActivated(event)}})):alert(WPGMZA.localized_strings.no_shape_polyline):alert(WPGMZA.localized_strings.no_shape_polygon):alert(WPGMZA.localized_strings.no_shape_rectangle):alert(WPGMZA.localized_strings.no_shape_circle)}}),jQuery(function($){WPGMZA.MarkerPanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.MarkerPanel,WPGMZA.FeaturePanel),WPGMZA.MarkerPanel.createInstance=function(element,mapEditPage){return WPGMZA.isProVersion()?new WPGMZA.ProMarkerPanel(element,mapEditPage):new WPGMZA.MarkerPanel(element,mapEditPage)},WPGMZA.MarkerPanel.prototype.initDefaults=function(){var self=this;WPGMZA.FeaturePanel.prototype.initDefaults.apply(this,arguments),this.adjustSubMode=!1,this.onTabActivated(null),$(document.body).on("click","[data-adjust-"+this.featureType+"-id]",function(event){self.onAdjustFeature(event)}),$(document.body).on("click",".wpgmza_approve_btn",function(event){self.onApproveMarker(event)})},WPGMZA.MarkerPanel.prototype.onAdjustFeature=function(event){var name="data-adjust-"+this.featureType+"-id",id=$(event.currentTarget).attr(name);this.discardChanges(),this.adjustSubMode=!0,this.select(id)},WPGMZA.MarkerPanel.prototype.onApproveMarker=function(event){var self=this,route="/"+this.featureType+"s/"+$(event.currentTarget).attr("id");WPGMZA.restAPI.call(route,{method:"POST",data:{approved:"1"},success:function(data,status,xhr){self.featureDataTable.reload()}})},WPGMZA.MarkerPanel.prototype.onFeatureChanged=function(event){if(this.adjustSubMode){var aPos=this.feature.getPosition();aPos&&($(this.element).find("[data-ajax-name='lat']").val(aPos.lat),$(this.element).find("[data-ajax-name='lng']").val(aPos.lng))}else{var addressField=$(this.element).find("input[data-ajax-name$='address']");if(addressField.length){var pos=this.feature.getPosition();addressField.val(pos.lat+","+pos.lng)}}},WPGMZA.MarkerPanel.prototype.setTargetFeature=function(feature){if(WPGMZA.FeaturePanel.prevEditableFeature){var prev=WPGMZA.FeaturePanel.prevEditableFeature;prev.setOpacity&&prev.setOpacity(1)}$(this.element).find("[data-ajax-name]").removeAttr("disabled"),$(this.element).find("fieldset").show(),$(this.element).find(".wpgmza-adjust-mode-notice").addClass("wpgmza-hidden"),$(this.element).find('[data-ajax-name="lat"]').attr("type","hidden"),$(this.element).find('[data-ajax-name="lng"]').attr("type","hidden"),$(this.element).find(".wpgmza-hide-in-adjust-mode").removeClass("wpgmza-hidden"),$(this.element).find(".wpgmza-show-in-adjust-mode").addClass("wpgmza-hidden"),feature?(feature.setOpacity&&feature.setOpacity(.7),feature.getMap().panTo(feature.getPosition()),this.adjustSubMode&&($(this.element).find("[data-ajax-name]").attr("disabled","disabled"),$(this.element).find("fieldset:not(.wpgmza-always-on)").hide(),$(this.element).find(".wpgmza-adjust-mode-notice").removeClass("wpgmza-hidden"),$(this.element).find('[data-ajax-name="lat"]').attr("type","text").removeAttr("disabled"),$(this.element).find('[data-ajax-name="lng"]').attr("type","text").removeAttr("disabled"),$(this.element).find(".wpgmza-hide-in-adjust-mode").addClass("wpgmza-hidden"),$(this.element).find(".wpgmza-show-in-adjust-mode").removeClass("wpgmza-hidden"))):this.adjustSubMode=!1,WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments)},WPGMZA.MarkerPanel.prototype.onSave=function(event){var self=this,geocoder=WPGMZA.Geocoder.createInstance(),geocodingData={address:$(this.element).find("[data-ajax-name='address']").val()};WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showPreloader(!0);var cloud_lat=!1,cloud_lng=!1;0<document.getElementsByName("lat").length&&(cloud_lat=document.getElementsByName("lat")[0].value),0<document.getElementsByName("lng").length&&(cloud_lng=document.getElementsByName("lng")[0].value),cloud_lat&&cloud_lng&&(WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey||(geocodingData.lat=parseFloat(cloud_lat),geocodingData.lng=parseFloat(cloud_lng))),this.adjustSubMode?WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments):geocoder.geocode(geocodingData,function(results,status){switch(status){case WPGMZA.Geocoder.ZERO_RESULTS:return alert(WPGMZA.localized_strings.zero_results),void self.showPreloader(!1);case WPGMZA.Geocoder.SUCCESS:break;case WPGMZA.Geocoder.NO_ADDRESS:return alert(WPGMZA.localized_strings.no_address),void self.showPreloader(!1);case WPGMZA.Geocoder.FAIL:default:return alert(WPGMZA.localized_strings.geocode_fail),void self.showPreloader(!1)}var result=results[0];$(self.element).find("[data-ajax-name='lat']").val(result.lat),$(self.element).find("[data-ajax-name='lng']").val(result.lng),WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments)}),WPGMZA.mapEditPage.map.resetBounds()}}),jQuery(function($){WPGMZA.CirclePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.CirclePanel,WPGMZA.FeaturePanel),WPGMZA.CirclePanel.createInstance=function(element,mapEditPage){return WPGMZA.isProVersion()?new WPGMZA.ProCirclePanel(element,mapEditPage):new WPGMZA.CirclePanel(element,mapEditPage)},WPGMZA.CirclePanel.prototype.updateFields=function(){$(this.element).find("[data-ajax-name='center']").val(this.feature.getCenter().toString()),$(this.element).find("[data-ajax-name='radius']").val(this.feature.getRadius())},WPGMZA.CirclePanel.prototype.onDrawingComplete=function(event){WPGMZA.FeaturePanel.prototype.onDrawingComplete.apply(this,arguments),this.updateFields()},WPGMZA.CirclePanel.prototype.setTargetFeature=function(feature){WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments),feature&&this.updateFields()},WPGMZA.CirclePanel.prototype.onFeatureChanged=function(event){WPGMZA.FeaturePanel.prototype.onFeatureChanged.apply(this,arguments),this.updateFields()}});var wpgmza_autoCompleteDisabled=!1;jQuery(function($){"map-edit"==WPGMZA.currentPage&&(WPGMZA.MapEditPage=function(){var self=this,element=document.body;WPGMZA.EventDispatcher.call(this),$("#wpgmaps_options fieldset").wrapInner("<div class='wpgmza-flex'></div>"),this.themePanel=new WPGMZA.ThemePanel,this.themeEditor=new WPGMZA.ThemeEditor,this.map=WPGMZA.maps[0],(!WPGMZA.pro_version||WPGMZA.Version.compare(WPGMZA.pro_version,"8.1.0")>=WPGMZA.Version.EQUAL_TO)&&(this.drawingManager=WPGMZA.DrawingManager.createInstance(this.map)),this.initDataTables(),this.initFeaturePanels(),this.initJQueryUIControls(),"en"!==WPGMZA.locale&&$("#datatable_no_result_message,#datatable_search_string").parent().parent().hide(),$("input.wpgmza-address").each(function(index,el){el.addressInput=WPGMZA.AddressInput.createInstance(el,self.map)}),$('#wpgmza-map-edit-page input[type="color"]').each(function(){$("<div class='button-secondary wpgmza-paste-color-btn' title='Paste a HEX color code'><i class='fa fa-clipboard' aria-hidden='true'></i></div>").insertAfter(this)}),jQuery("body").on("click",".wpgmza_ac_result",function(e){var index=jQuery(this).data("id"),lat=jQuery(this).data("lat"),lng=jQuery(this).data("lng"),name=jQuery("#wpgmza_item_address_"+index).html();jQuery("input[name='lat']").val(lat),jQuery("input[name='lng']").val(lng),jQuery("#wpgmza_add_address_map_editor").val(name),jQuery("#wpgmza_autocomplete_search_results").hide()}),jQuery("body").on("click",".wpgmza-paste-color-btn",function(){try{var colorBtn=$(this);if(!navigator||!navigator.clipboard||!navigator.clipboard.readText)return;navigator.clipboard.readText().then(function(textcopy){colorBtn.parent().find('input[type="color"]').val("#"+textcopy.replace("#","").trim())}).catch(function(err){console.error("WP Google Maps: Could not access clipboard",err)})}catch(c_ex){}}),jQuery("body").on("focusout","#wpgmza_add_address_map_editor",function(e){setTimeout(function(){jQuery("#wpgmza_autocomplete_search_results").fadeOut("slow")},500)});var ajaxRequest=!1,wpgmzaAjaxTimeout=!1,wpgmzaStartTyping=!1,wpgmzaKeyStrokeCount=1,wpgmzaAvgTimeBetweenStrokes=300,wpgmzaTotalTimeForKeyStrokes=0,wpgmzaTmp="",wpgmzaIdentifiedTypingSpeed=!1;$("body").on("keypress",".wpgmza-address",function(e){if("wpgmza_add_address_map_editor"==this.id){if(wpgmza_autoCompleteDisabled)return;var wpgmza_apikey=!1;if(WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey)return void(wpgmza_apikey=WPGMZA_localized_data.settings.googleMapsApiKey);if("Escape"===e.key||"Alt"===e.key||"Control"===e.key||"Option"===e.key||"Shift"===e.key||"ArrowLeft"===e.key||"ArrowRight"===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key)return void $("#wpgmza_autocomplete_search_results").hide();if(!wpgmzaIdentifiedTypingSpeed){var d=new Date;return clearTimeout(wpgmzaTmp),wpgmzaTmp=setTimeout(function(){wpgmzaStartTyping=!1,wpgmzaAvgTimeBetweenStrokes=300,wpgmzaTotalTimeForKeyStrokes=0},1500),wpgmzaStartTyping?1==wpgmzaKeyStrokeCount||(wpgmzaCurrentTimeBetweenStrokes=d.getTime()-wpgmzaStartTyping,wpgmzaTotalTimeForKeyStrokes+=wpgmzaCurrentTimeBetweenStrokes,wpgmzaAvgTimeBetweenStrokes=wpgmzaTotalTimeForKeyStrokes/(wpgmzaKeyStrokeCount-1),wpgmzaStartTyping=d.getTime(),3<=wpgmzaKeyStrokeCount&&(wpgmzaIdentifiedTypingSpeed=wpgmzaAvgTimeBetweenStrokes)):wpgmzaStartTyping=d.getTime(),void wpgmzaKeyStrokeCount++}clearTimeout(wpgmzaAjaxTimeout),$("#wpgmza_autocomplete_search_results").html("Searching..."),$("#wpgmza_autocomplete_search_results").show();var currentSearch=jQuery(this).val();if(""!==currentSearch){!1!==ajaxRequest&&ajaxRequest.abort();var wpgmza_api_url="";wpgmza_api_url=wpgmza_apikey?"https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+window.location.hostname+"&hash="+WPGMZA_localized_data.siteHash+"&k="+wpgmza_apikey:"https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+window.location.hostname+"&hash="+WPGMZA_localized_data.siteHash,wpgmzaAjaxTimeout=setTimeout(function(){ajaxRequest=$.ajax({url:wpgmza_api_url,type:"GET",dataType:"json",success:function(results){try{if(void 0!==results.error)"error1"==results.error?($("#wpgmza_autoc_disabled").html(WPGMZA.localized_strings.cloud_api_key_error_1),$("#wpgmza_autoc_disabled").fadeIn("slow"),$("#wpgmza_autocomplete_search_results").hide(),wpgmza_autoCompleteDisabled=!0):console.error(results.error);else{$("#wpgmza_autocomplete_search_results").html("");var html="";for(var i in results)html+="<div class='wpgmza_ac_result "+(""===html?"":"border-top")+"' data-id='"+i+"' data-lat='"+results[i].lat+"' data-lng='"+results[i].lng+"'><div class='wpgmza_ac_container'><div class='wpgmza_ac_icon'><img src='"+results[i].icon+"' /></div><div class='wpgmza_ac_item'><span id='wpgmza_item_name_"+i+"' class='wpgmza_item_name'>"+results[i].place_name+"</span><span id='wpgmza_item_address_"+i+"' class='wpgmza_item_address'>"+results[i].formatted_address+"</span></div></div></div>";""==html&&(html="<div class='p-2 text-center'><small>No results found...</small></div>"),$("#wpgmza_autocomplete_search_results").html(html),$("#wpgmza_autocomplete_search_results").show()}}catch(exception){console.error("WP Google Maps Plugin: There was an error returning the list of places for your search")}}})},2*wpgmzaIdentifiedTypingSpeed)}else $("#wpgmza_autocomplete_search_results").hide()}}),$("#wpgmza_map_height_type").on("change",function(event){self.onMapHeightTypeChange(event)}),$("#advanced-markers .wpgmza-feature-drawing-instructions").remove(),$("[data-search-area='auto']").hide(),$(document.body).on("click","[data-wpgmza-admin-marker-datatable] input[name='mark']",function(event){self.onShiftClick(event)}),$("#wpgmza_map_type").on("change",function(event){self.onMapTypeChanged(event)}),$("body").on("click",".wpgmza_copy_shortcode",function(){var $temp=jQuery("<input>");jQuery('<span id="wpgmza_tmp" style="display:none; width:100%; text-align:center;">');jQuery("body").append($temp),$temp.val(jQuery(this).val()).select(),document.execCommand("copy"),$temp.remove(),WPGMZA.notification("Shortcode Copied")}),this.on("markerupdated",function(event){self.onMarkerUpdated(event)}),this.map&&(this.map.on("zoomchanged",function(event){self.onZoomChanged(event)}),this.map.on("boundschanged",function(event){self.onBoundsChanged(event)}),this.map.on("rightclick",function(event){self.onRightClick(event)})),$(element).on("click",".wpgmza_poly_del_btn",function(event){self.onDeletePolygon(event)}),$(element).on("click",".wpgmza_polyline_del_btn",function(event){self.onDeletePolyline(event)}),$(element).on("click",".wpgmza_dataset_del_btn",function(evevnt){self.onDeleteHeatmap(event)}),$(element).on("click",".wpgmza_circle_del_btn",function(event){self.onDeleteCircle(event)}),$(element).on("click",".wpgmza_rectangle_del_btn",function(event){self.onDeleteRectangle(event)}),$(element).on("click","#wpgmza-open-advanced-theme-data",function(event){event.preventDefault(),$(".wpgmza_theme_data_container").toggleClass("wpgmza_hidden")})},WPGMZA.extend(WPGMZA.MapEditPage,WPGMZA.EventDispatcher),WPGMZA.MapEditPage.createInstance=function(){return WPGMZA.isProVersion()&&WPGMZA.Version.compare(WPGMZA.pro_version,"8.0.0")>=WPGMZA.Version.EQUAL_TO?new WPGMZA.ProMapEditPage:new WPGMZA.MapEditPage},WPGMZA.MapEditPage.prototype.initDataTables=function(){var self=this;$("[data-wpgmza-datatable][data-wpgmza-rest-api-route]").each(function(index,el){var featureType=$(el).attr("data-wpgmza-feature-type");self[featureType+"AdminDataTable"]=new WPGMZA.AdminFeatureDataTable(el)})},WPGMZA.MapEditPage.prototype.initFeaturePanels=function(){var self=this;$(".wpgmza-feature-accordion[data-wpgmza-feature-type]").each(function(index,el){var featurePanelElement=$(el).find(".wpgmza-feature-panel-container > *"),featureType=$(el).attr("data-wpgmza-feature-type"),panelClassName=WPGMZA.capitalizeWords(featureType)+"Panel",instance=WPGMZA[panelClassName].createInstance(featurePanelElement,self);self[featureType+"Panel"]=instance})},WPGMZA.MapEditPage.prototype.initJQueryUIControls=function(){var mapContainer,self=this;$("#wpgmaps_tabs").tabs(),mapContainer=$("#wpgmza-map-container").detach(),$("#wpgmaps_tabs_markers").tabs(),$(".map_wrapper").prepend(mapContainer),$("#slider-range-max").slider({range:"max",min:1,max:21,value:$("input[name='map_start_zoom']").val(),slide:function(event,ui){$("input[name='map_start_zoom']").val(ui.value),self.map.setZoom(ui.value)}})},WPGMZA.MapEditPage.prototype.onShiftClick=function(event){var checkbox=event.currentTarget,row=jQuery(checkbox).closest("tr");if(this.lastSelectedRow&&event.shiftKey){var prevIndex=this.lastSelectedRow.index(),currIndex=row.index(),startIndex=Math.min(prevIndex,currIndex),endIndex=Math.max(prevIndex,currIndex),rows=jQuery("[data-wpgmza-admin-marker-datatable] tbody>tr");jQuery("[data-wpgmza-admin-marker-datatable] input[name='mark']").prop("checked",!1);for(var i=startIndex;i<=endIndex;i++)jQuery(rows[i]).find("input[name='mark']").prop("checked",!0)}this.lastSelectedRow=row},WPGMZA.MapEditPage.prototype.onMapTypeChanged=function(event){if("open-layers"!=WPGMZA.settings.engine){var mapTypeId;switch(event.target.value){case"2":mapTypeId=google.maps.MapTypeId.SATELLITE;break;case"3":mapTypeId=google.maps.MapTypeId.HYBRID;break;case"4":mapTypeId=google.maps.MapTypeId.TERRAIN;break;default:mapTypeId=google.maps.MapTypeId.ROADMAP}this.map.setOptions({mapTypeId:mapTypeId})}},WPGMZA.MapEditPage.prototype.onMarkerUpdated=function(event){this.markerDataTable.reload()},WPGMZA.MapEditPage.prototype.onZoomChanged=function(event){$(".map_start_zoom").val(this.map.getZoom())},WPGMZA.MapEditPage.prototype.onBoundsChanged=function(event){var location=this.map.getCenter();$("#wpgmza_start_location").val(location.lat+","+location.lng),$("input[name='map_start_lat']").val(location.lat),$("input[name='map_start_lng']").val(location.lng),$("#wpgmza_start_zoom").val(this.map.getZoom()),$("#wpgmaps_save_reminder").show()},WPGMZA.MapEditPage.prototype.onMapHeightTypeChange=function(event){"%"==event.target.value&&$("#wpgmza_height_warning").show()},WPGMZA.MapEditPage.prototype.onRightClick=function(event){var marker,self=this;this.drawingManager&&this.drawingManager.mode!=WPGMZA.DrawingManager.MODE_MARKER||(this.rightClickMarker||(this.rightClickMarker=WPGMZA.Marker.createInstance({draggable:!0}),this.rightClickMarker.on("dragend",function(event){$(".wpgmza-marker-panel [data-ajax-name='address']").val(event.latLng.lat+","+event.latLng.lng)}),this.map.on("click",function(event){self.rightClickMarker.setMap(null)})),(marker=this.rightClickMarker).setPosition(event.latLng),marker.setMap(this.map),$(".wpgmza-marker-panel [data-ajax-name='address']").val(event.latLng.lat+", "+event.latLng.lng))},WPGMZA.MapEditPage.prototype.onDeletePolygon=function(event){var cur_id=parseInt($(this).attr("id")),data={action:"delete_poly",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){WPGM_Path[cur_id].setMap(null),delete WPGM_PathData[cur_id],delete WPGM_Path[cur_id],$("#wpgmza_poly_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeletePolyline=function(event){var cur_id=$(this).attr("id"),data={action:"delete_polyline",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){WPGM_PathLine[cur_id].setMap(null),delete WPGM_PathLineData[cur_id],delete WPGM_PathLine[cur_id],$("#wpgmza_polyline_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeleteHeatmap=function(event){var cur_id=$(this).attr("id"),data={action:"delete_dataset",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){heatmap[cur_id].setMap(null),delete heatmap[cur_id],$("#wpgmza_heatmap_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeleteCircle=function(event){var circle_id=$(this).attr("id"),data={action:"delete_circle",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,circle_id:circle_id};$.post(ajaxurl,data,function(response){$("#tabs-m-5 table").replaceWith(response),circle_array.forEach(function(circle){if(circle.id==circle_id)return circle.setMap(null),!1})})},WPGMZA.MapEditPage.prototype.onDeleteRectangle=function(event){var rectangle_id=$(this).attr("id"),data={action:"delete_rectangle",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,rectangle_id:rectangle_id};$.post(ajaxurl,data,function(response){$("#tabs-m-6 table").replaceWith(response),rectangle_array.forEach(function(rectangle){if(rectangle.id==rectangle_id)return rectangle.setMap(null),!1})})},$(document).ready(function(event){WPGMZA.mapEditPage=WPGMZA.MapEditPage.createInstance()}))}),jQuery(function($){WPGMZA.PolygonPanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.PolygonPanel,WPGMZA.FeaturePanel),WPGMZA.PolygonPanel.createInstance=function(element,mapEditPage){return WPGMZA.isProVersion()?new WPGMZA.ProPolygonPanel(element,mapEditPage):new WPGMZA.PolygonPanel(element,mapEditPage)},Object.defineProperty(WPGMZA.PolygonPanel.prototype,"drawingManagerCompleteEvent",{get:function(){return"polygonclosed"}})}),jQuery(function($){WPGMZA.PolylinePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.PolylinePanel,WPGMZA.FeaturePanel),WPGMZA.PolylinePanel.createInstance=function(element,mapEditPage){return WPGMZA.isProVersion()?new WPGMZA.ProPolylinePanel(element,mapEditPage):new WPGMZA.PolylinePanel(element,mapEditPage)}}),jQuery(function($){WPGMZA.RectanglePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.RectanglePanel,WPGMZA.FeaturePanel),WPGMZA.RectanglePanel.createInstance=function(element,mapEditPage){return WPGMZA.isProVersion()?new WPGMZA.ProRectanglePanel(element,mapEditPage):new WPGMZA.RectanglePanel(element,mapEditPage)},WPGMZA.RectanglePanel.prototype.updateFields=function(){var bounds=this.feature.getBounds();bounds.north&&bounds.west&&bounds.south&&bounds.east&&($(this.element).find("[data-ajax-name='cornerA']").val(bounds.north+", "+bounds.west),$(this.element).find("[data-ajax-name='cornerB']").val(bounds.south+", "+bounds.east))},WPGMZA.RectanglePanel.prototype.setTargetFeature=function(feature){WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments),feature&&this.updateFields()},WPGMZA.RectanglePanel.prototype.onDrawingComplete=function(event){WPGMZA.FeaturePanel.prototype.onDrawingComplete.apply(this,arguments),this.updateFields()},WPGMZA.RectanglePanel.prototype.onFeatureChanged=function(event){WPGMZA.FeaturePanel.prototype.onFeatureChanged.apply(this,arguments),this.updateFields()}}),jQuery(function($){var Parent=WPGMZA.Circle;WPGMZA.OLCircle=function(options,olFeature){var geom;if(Parent.call(this,options,olFeature),options=options||{},olFeature){var circle=olFeature.getGeometry(),center=ol.proj.toLonLat(circle.getCenter());geom=circle,options.center=new WPGMZA.LatLng(center[1],center[0]),options.radius=circle.getRadius()/1e3}else geom=new ol.geom.Circle(ol.proj.fromLonLat([parseFloat(options.center.lng),parseFloat(options.center.lat)]),1e3*options.radius);this.layer=new ol.layer.Vector({source:new ol.source.Vector}),this.olFeature=new ol.Feature({geometry:geom}),this.layer.getSource().addFeature(this.olFeature),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaCircle:this,wpgmzaFeature:this}),options&&this.setOptions(options)},WPGMZA.OLCircle.prototype=Object.create(Parent.prototype),WPGMZA.OLCircle.prototype.constructor=WPGMZA.OLCircle,WPGMZA.OLCircle.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)},WPGMZA.OLCircle.prototype.getCenter=function(){var lonLat=ol.proj.toLonLat(this.olFeature.getGeometry().getCenter());return new WPGMZA.LatLng({lat:lonLat[1],lng:lonLat[0]})},WPGMZA.OLCircle.prototype.recreate=function(){if(this.olFeature&&(this.layer.getSource().removeFeature(this.olFeature),delete this.olFeature),this.center&&this.radius){var x,y,radius=1e3*parseFloat(this.radius);x=this.center.lng,y=this.center.lat;var circle3857=ol.geom.Polygon.circular([x,y],radius,64).clone().transform("EPSG:4326","EPSG:3857");this.olFeature=new ol.Feature(circle3857),this.layer.getSource().addFeature(this.olFeature)}},WPGMZA.OLCircle.prototype.setVisible=function(visible){this.layer.setVisible(!!visible)},WPGMZA.OLCircle.prototype.setCenter=function(center){WPGMZA.Circle.prototype.setCenter.apply(this,arguments),this.recreate()},WPGMZA.OLCircle.prototype.getRadius=function(){return this.layer.getSource().getFeatures()[0].getGeometry().getRadius()/1e3},WPGMZA.OLCircle.prototype.setRadius=function(radius){WPGMZA.Circle.prototype.setRadius.apply(this,arguments)},WPGMZA.OLCircle.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){WPGMZA.OLDrawingManager=function(map){WPGMZA.DrawingManager.call(this,map),this.source=new ol.source.Vector({wrapX:!1}),this.layer=new ol.layer.Vector({source:this.source})},WPGMZA.OLDrawingManager.prototype=Object.create(WPGMZA.DrawingManager.prototype),WPGMZA.OLDrawingManager.prototype.constructor=WPGMZA.OLDrawingManager,WPGMZA.OLDrawingManager.prototype.setOptions=function(options){var params={};options.strokeOpacity&&(params.stroke=new ol.style.Stroke({color:WPGMZA.hexOpacityToRGBA(options.strokeColor,options.strokeOpacity)})),options.fillOpacity&&(params.fill=new ol.style.Fill({color:WPGMZA.hexOpacityToRGBA(options.fillColor,options.fillOpacity)})),this.layer.setStyle(new ol.style.Style(params))},WPGMZA.OLDrawingManager.prototype.setDrawingMode=function(mode){var type,endEventType,self=this;switch(WPGMZA.DrawingManager.prototype.setDrawingMode.call(this,mode),this.interaction&&(this.map.olMap.removeInteraction(this.interaction),this.interaction=null),mode){case WPGMZA.DrawingManager.MODE_NONE:case WPGMZA.DrawingManager.MODE_MARKER:return;case WPGMZA.DrawingManager.MODE_POLYGON:type="Polygon",endEventType="polygonclosed";break;case WPGMZA.DrawingManager.MODE_POLYLINE:type="LineString",endEventType="polylinecomplete";break;case WPGMZA.DrawingManager.MODE_CIRCLE:type="Circle",endEventType="circlecomplete";break;case WPGMZA.DrawingManager.MODE_RECTANGLE:type="Circle",endEventType="rectanglecomplete";break;case WPGMZA.DrawingManager.MODE_HEATMAP:return;default:throw new Error("Invalid drawing mode")}WPGMZA.mapEditPage&&WPGMZA.mapEditPage.selectInteraction&&WPGMZA.mapEditPage.map.olMap.removeInteraction(WPGMZA.mapEditPage.selectInteraction);var options={source:this.source,type:type};mode==WPGMZA.DrawingManager.MODE_RECTANGLE&&(options.geometryFunction=ol.interaction.Draw.createBox()),this.interaction=new ol.interaction.Draw(options),this.interaction.on("drawend",function(event){if(endEventType){var WPGMZAEvent=new WPGMZA.Event(endEventType);switch(mode){case WPGMZA.DrawingManager.MODE_POLYGON:WPGMZAEvent.enginePolygon=event.feature;break;case WPGMZA.DrawingManager.MODE_POLYLINE:WPGMZAEvent.enginePolyline=event.feature;break;case WPGMZA.DrawingManager.MODE_CIRCLE:WPGMZAEvent.engineCircle=event.feature;break;case WPGMZA.DrawingManager.MODE_RECTANGLE:WPGMZAEvent.engineRectangle=event.feature;break;default:throw new Error("Drawing mode not implemented")}self.dispatchEvent(WPGMZAEvent)}}),this.map.olMap.addInteraction(this.interaction)}}),jQuery(function($){WPGMZA.OLFeature=function(options){WPGMZA.assertInstangeOf(this,"OLFeature"),WPGMZA.Feature.apply(this,arguments)},WPGMZA.extend(WPGMZA.OLFeature,WPGMZA.Feature),WPGMZA.OLFeature.getOLStyle=function(options){var translated={};if(!options)return new ol.style.Style;options=$.extend({},options);var map={fillcolor:"fillColor",opacity:"fillOpacity",linecolor:"strokeColor",lineopacity:"strokeOpacity",linethickness:"strokeWeight"};for(var name in options)name in map&&(options[map[name]]=options[name]);if(options.strokeColor){var opacity=1,weight=1;"strokeOpacity"in options&&(opacity=options.strokeOpacity),"strokeWeight"in options&&(weight=options.strokeWeight),translated.stroke=new ol.style.Stroke({color:WPGMZA.hexOpacityToString(options.strokeColor,opacity),width:weight})}if(options.fillColor){opacity=1;"fillOpacity"in options&&(opacity=options.fillOpacity);var color=WPGMZA.hexOpacityToString(options.fillColor,opacity);translated.fill=new ol.style.Fill({color:color})}return new ol.style.Style(translated)},WPGMZA.OLFeature.setInteractionsOnFeature=function(feature,enable){if(enable){if(feature.modifyInteraction)return;feature.snapInteraction=new ol.interaction.Snap({source:feature.layer.getSource()}),feature.map.olMap.addInteraction(feature.snapInteraction),feature.modifyInteraction=new ol.interaction.Modify({source:feature.layer.getSource()}),feature.map.olMap.addInteraction(feature.modifyInteraction),feature.modifyInteraction.on("modifyend",function(event){feature.trigger("change")})}else{if(!feature.modifyInteraction)return;feature.map&&(feature.map.olMap.removeInteraction(feature.snapInteraction),feature.map.olMap.removeInteraction(feature.modifyInteraction)),delete feature.snapInteraction,delete feature.modifyInteraction}}}),jQuery(function($){WPGMZA.OLGeocoder=function(){},WPGMZA.OLGeocoder.prototype=Object.create(WPGMZA.Geocoder.prototype),WPGMZA.OLGeocoder.prototype.constructor=WPGMZA.OLGeocoder,WPGMZA.OLGeocoder.prototype.getResponseFromCache=function(query,callback){WPGMZA.restAPI.call("/geocode-cache",{data:{query:JSON.stringify(query)},success:function(response,xhr,status){response.lng=response.lon,callback(response)},useCompressedPathVariable:!0})},WPGMZA.OLGeocoder.prototype.getResponseFromNominatim=function(options,callback){var data={q:options.address,format:"json"};options.componentRestrictions&&options.componentRestrictions.country?data.countrycodes=options.componentRestrictions.country:options.country&&(data.countrycodes=options.country),$.ajax("https://nominatim.openstreetmap.org/search/",{data:data,success:function(response,xhr,status){callback(response)},error:function(response,xhr,status){callback(null,WPGMZA.Geocoder.FAIL)}})},WPGMZA.OLGeocoder.prototype.cacheResponse=function(query,response){$.ajax(WPGMZA.ajaxurl,{data:{action:"wpgmza_store_nominatim_cache",query:JSON.stringify(query),response:JSON.stringify(response)},method:"POST"})},WPGMZA.OLGeocoder.prototype.clearCache=function(callback){$.ajax(WPGMZA.ajaxurl,{data:{action:"wpgmza_clear_nominatim_cache"},method:"POST",success:function(response){callback(response)}})},WPGMZA.OLGeocoder.prototype.getLatLngFromAddress=function(options,callback){return WPGMZA.OLGeocoder.prototype.geocode(options,callback)},WPGMZA.OLGeocoder.prototype.getAddressFromLatLng=function(options,callback){return WPGMZA.OLGeocoder.prototype.geocode(options,callback)},WPGMZA.OLGeocoder.prototype.geocode=function(options,callback){var self=this;if(!options)throw new Error("Invalid options");if(WPGMZA.LatLng.REGEXP.test(options.address)){var latLng=WPGMZA.LatLng.fromString(options.address);callback([{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng}],WPGMZA.Geocoder.SUCCESS)}else{var finish,location;if(options.location&&(options.latLng=new WPGMZA.LatLng(options.location)),options.address)location=options.address,finish=function(response,status){for(var i=0;i<response.length;i++)response[i].geometry={location:new WPGMZA.LatLng({lat:parseFloat(response[i].lat),lng:parseFloat(response[i].lon)})},response[i].latLng={lat:parseFloat(response[i].lat),lng:parseFloat(response[i].lon)},response[i].bounds=new WPGMZA.LatLngBounds(new WPGMZA.LatLng({lat:response[i].boundingbox[1],lng:response[i].boundingbox[2]}),new WPGMZA.LatLng({lat:response[i].boundingbox[0],lng:response[i].boundingbox[3]})),response[i].lng=response[i].lon;callback(response,status)};else{if(!options.latLng)throw new Error("You must supply either a latLng or address");location=options.latLng.toString(),finish=function(response,status){var address=response[0].display_name;callback([address],status)}}var query={location:location,options:options};this.getResponseFromCache(query,function(response){response.length?finish(response,WPGMZA.Geocoder.SUCCESS):self.getResponseFromNominatim($.extend(options,{address:location}),function(response,status){status!=WPGMZA.Geocoder.FAIL?0!=response.length?(finish(response,WPGMZA.Geocoder.SUCCESS),self.cacheResponse(query,response)):callback([],WPGMZA.Geocoder.ZERO_RESULTS):callback(null,WPGMZA.Geocoder.FAIL)})})}}}),jQuery(function($){var Parent;WPGMZA.OLInfoWindow=function(feature){var self=this;Parent.call(this,feature),this.element=$("<div class='wpgmza-infowindow ol-info-window-container ol-info-window-plain'></div>")[0],$(this.element).on("click",".ol-info-window-close",function(event){self.close()})},Parent=WPGMZA.isProVersion()?WPGMZA.ProInfoWindow:WPGMZA.InfoWindow,WPGMZA.OLInfoWindow.prototype=Object.create(Parent.prototype),WPGMZA.OLInfoWindow.prototype.constructor=WPGMZA.OLInfoWindow,Object.defineProperty(WPGMZA.OLInfoWindow.prototype,"isPanIntoViewAllowed",{get:function(){return!0}}),WPGMZA.OLInfoWindow.prototype.open=function(map,feature){var self=this,latLng=feature.getPosition();if(!Parent.prototype.open.call(this,map,feature))return!1;this.parent=map,this.overlay&&this.feature.map.olMap.removeOverlay(this.overlay),this.overlay=new ol.Overlay({element:this.element,stopEvent:!0,insertFirst:!0}),this.overlay.setPosition(ol.proj.fromLonLat([latLng.lng,latLng.lat])),self.feature.map.olMap.addOverlay(this.overlay),$(this.element).show(),this.setContent(this.content),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&WPGMZA.getImageDimensions(feature.getIcon(),function(size){$(self.element).css({left:Math.round(size.width/2)+"px"})}),this.trigger("infowindowopen"),this.trigger("domready")},WPGMZA.OLInfoWindow.prototype.close=function(event){$(this.element).hide(),this.overlay&&(WPGMZA.InfoWindow.prototype.close.call(this),this.trigger("infowindowclose"),this.feature.map.olMap.removeOverlay(this.overlay),this.overlay=null)},WPGMZA.OLInfoWindow.prototype.setContent=function(html){Parent.prototype.setContent.call(this,html),this.content=html;var eaBtn=WPGMZA.isProVersion()?"":this.addEditButton();$(this.element).html(eaBtn+"<i class='fa fa-times ol-info-window-close' aria-hidden='true'></i>"+html)},WPGMZA.OLInfoWindow.prototype.setOptions=function(options){options.maxWidth&&$(this.element).css({"max-width":options.maxWidth+"px"})},WPGMZA.OLInfoWindow.prototype.onOpen=function(){var self=this,imgs=$(this.element).find("img"),numImages=imgs.length,numImagesLoaded=0;if(WPGMZA.InfoWindow.prototype.onOpen.apply(this,arguments),this.isPanIntoViewAllowed){function inside(el,viewport){var a=$(el)[0].getBoundingClientRect(),b=$(viewport)[0].getBoundingClientRect();return a.left>=b.left&&a.left<=b.right&&a.right<=b.right&&a.right>=b.left&&a.top>=b.top&&a.top<=b.bottom&&a.bottom<=b.bottom&&a.bottom>=b.top}function panIntoView(){var offset=.45*-$(self.element).height();self.feature.map.animateNudge(0,offset,self.feature.getPosition())}imgs.each(function(index,el){el.onload=function(){++numImagesLoaded!=numImages||inside(self.element,self.feature.map.element)||panIntoView()}}),0!=numImages||inside(self.element,self.feature.map.element)||panIntoView()}}}),jQuery(function($){var Parent;WPGMZA.OLMap=function(element,options){var self=this;Parent.call(this,element),this.setOptions(options);var viewOptions=this.settings.toOLViewOptions();function isSettingDisabled(value){return"yes"===value||!!value}$(this.element).html(""),this.olMap=new ol.Map({target:$(element)[0],layers:[this.getTileLayer()],view:new ol.View(viewOptions)}),this.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan?interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_draggable)):interaction instanceof ol.interaction.DoubleClickZoom?interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_clickzoom)):interaction instanceof ol.interaction.MouseWheelZoom&&interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_scroll))},this),"greedy"!=this.settings.wpgmza_force_greedy_gestures&&"yes"!=this.settings.wpgmza_force_greedy_gestures&&1!=this.settings.wpgmza_force_greedy_gestures&&(this.gestureOverlay=$("<div class='wpgmza-gesture-overlay'></div>"),this.gestureOverlayTimeoutID=null,WPGMZA.isTouchDevice()||(this.olMap.on("wheel",function(event){if(!ol.events.condition.platformModifierKeyOnly(event))return self.showGestureOverlay(),event.originalEvent.preventDefault(),!1}),this.gestureOverlay.text(WPGMZA.localized_strings.use_ctrl_scroll_to_zoom))),this.olMap.getControls().forEach(function(control){control instanceof ol.control.Zoom&&1==WPGMZA.settings.wpgmza_settings_map_zoom&&self.olMap.removeControl(control)},this),isSettingDisabled(WPGMZA.settings.wpgmza_settings_map_full_screen_control)||this.olMap.addControl(new ol.control.FullScreen),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&(this.markerLayer=new ol.layer.Vector({source:new ol.source.Vector({features:[]})}),this.olMap.addLayer(this.markerLayer),this.olMap.on("click",function(event){var features=self.olMap.getFeaturesAtPixel(event.pixel);if(features&&features.length){var marker=features[0].wpgmzaMarker;marker&&(marker.trigger("click"),marker.trigger("select"))}})),this.olMap.on("movestart",function(event){self.isBeingDragged=!0}),this.olMap.on("moveend",function(event){self.wrapLongitude(),self.isBeingDragged=!1,self.dispatchEvent("dragend"),self.onIdle()}),this.olMap.getView().on("change:resolution",function(event){self.dispatchEvent("zoom_changed"),self.dispatchEvent("zoomchanged"),setTimeout(function(){self.onIdle()},10)}),this.olMap.getView().on("change",function(){self.onBoundsChanged()}),self.onBoundsChanged(),this._mouseoverNativeFeatures=[],this.olMap.on("pointermove",function(event){if(!event.dragging){try{var featuresUnderPixel=event.target.getFeaturesAtPixel(event.pixel)}catch(e){return}featuresUnderPixel=featuresUnderPixel||[];var i,props,nativeFeaturesUnderPixel=[];for(i=0;i<featuresUnderPixel.length;i++)(props=featuresUnderPixel[i].getProperties()).wpgmzaFeature&&(nativeFeature=props.wpgmzaFeature,nativeFeaturesUnderPixel.push(nativeFeature),-1==self._mouseoverNativeFeatures.indexOf(nativeFeature)&&(nativeFeature.trigger("mouseover"),self._mouseoverNativeFeatures.push(nativeFeature)));for(i=self._mouseoverNativeFeatures.length-1;0<=i;i--)nativeFeature=self._mouseoverNativeFeatures[i],-1==nativeFeaturesUnderPixel.indexOf(nativeFeature)&&(nativeFeature.trigger("mouseout"),self._mouseoverNativeFeatures.splice(i,1))}}),$(this.element).on("click contextmenu",function(event){var isRight;event=event||window.event;var latLng=self.pixelsToLatLng(event.offsetX,event.offsetY);if("which"in event?isRight=3==event.which:"button"in event&&(isRight=2==event.button),1!=event.which&&1!=event.button){if(isRight)return self.onRightClick(event)}else{if(self.isBeingDragged)return;if($(event.target).closest(".ol-marker").length)return;try{var featuresUnderPixel=self.olMap.getFeaturesAtPixel([event.offsetX,event.offsetY])}catch(e){return}featuresUnderPixel=featuresUnderPixel||[];var i,props,nativeFeaturesUnderPixel=[];for(i=0;i<featuresUnderPixel.length;i++)(props=featuresUnderPixel[i].getProperties()).wpgmzaFeature&&(nativeFeature=props.wpgmzaFeature,nativeFeaturesUnderPixel.push(nativeFeature),nativeFeature.trigger("click"));if(0<featuresUnderPixel.length)return;self.trigger({type:"click",latLng:latLng})}}),WPGMZA.isProVersion()||(this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded"))},Parent=WPGMZA.isProVersion()?WPGMZA.ProMap:WPGMZA.Map,WPGMZA.OLMap.prototype=Object.create(Parent.prototype),WPGMZA.OLMap.prototype.constructor=WPGMZA.OLMap,WPGMZA.OLMap.prototype.getTileLayer=function(){var options={};return WPGMZA.settings.tile_server_url&&(options.url=WPGMZA.settings.tile_server_url,"custom_override"===WPGMZA.settings.tile_server_url&&(WPGMZA.settings.tile_server_url_override&&""!==WPGMZA.settings.tile_server_url_override.trim()?options.url=WPGMZA.settings.tile_server_url_override.trim():options.url="https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png"),WPGMZA.settings.open_layers_api_key&&""!==WPGMZA.settings.open_layers_api_key&&(options.url+="?apikey="+WPGMZA.settings.open_layers_api_key.trim())),new ol.layer.Tile({source:new ol.source.OSM(options)})},WPGMZA.OLMap.prototype.wrapLongitude=function(){var transformed=ol.proj.transform(this.olMap.getView().getCenter(),"EPSG:3857","EPSG:4326"),center={lat:transformed[1],lng:transformed[0]};-180<=center.lng&¢er.lng<=180||(center.lng=center.lng-360*Math.floor(center.lng/360),180<center.lng&&(center.lng-=360),this.setCenter(center))},WPGMZA.OLMap.prototype.getCenter=function(){var lonLat=ol.proj.toLonLat(this.olMap.getView().getCenter());return{lat:lonLat[1],lng:lonLat[0]}},WPGMZA.OLMap.prototype.setCenter=function(latLng){var view=this.olMap.getView();WPGMZA.Map.prototype.setCenter.call(this,latLng),view.setCenter(ol.proj.fromLonLat([latLng.lng,latLng.lat])),this.wrapLongitude(),this.onBoundsChanged()},WPGMZA.OLMap.prototype.getBounds=function(){var bounds=this.olMap.getView().calculateExtent(this.olMap.getSize()),nativeBounds=new WPGMZA.LatLngBounds,topLeft=ol.proj.toLonLat([bounds[0],bounds[1]]),bottomRight=ol.proj.toLonLat([bounds[2],bounds[3]]);return nativeBounds.north=topLeft[1],nativeBounds.south=bottomRight[1],nativeBounds.west=topLeft[0],nativeBounds.east=bottomRight[0],nativeBounds},WPGMZA.OLMap.prototype.fitBounds=function(southWest,northEast){if(southWest instanceof WPGMZA.LatLng&&(southWest={lat:southWest.lat,lng:southWest.lng}),northEast instanceof WPGMZA.LatLng)northEast={lat:northEast.lat,lng:northEast.lng};else if(southWest instanceof WPGMZA.LatLngBounds){var bounds=southWest;southWest={lat:bounds.south,lng:bounds.west},northEast={lat:bounds.north,lng:bounds.east}}var view=this.olMap.getView(),extent=ol.extent.boundingExtent([ol.proj.fromLonLat([parseFloat(southWest.lng),parseFloat(southWest.lat)]),ol.proj.fromLonLat([parseFloat(northEast.lng),parseFloat(northEast.lat)])]);view.fit(extent,this.olMap.getSize())},WPGMZA.OLMap.prototype.panTo=function(latLng,zoom){var view=this.olMap.getView(),options={center:ol.proj.fromLonLat([parseFloat(latLng.lng),parseFloat(latLng.lat)]),duration:500};1<arguments.length&&(options.zoom=parseInt(zoom)),view.animate(options)},WPGMZA.OLMap.prototype.getZoom=function(){return Math.round(this.olMap.getView().getZoom())},WPGMZA.OLMap.prototype.setZoom=function(value){this.olMap.getView().setZoom(value)},WPGMZA.OLMap.prototype.getMinZoom=function(){return this.olMap.getView().getMinZoom()},WPGMZA.OLMap.prototype.setMinZoom=function(value){this.olMap.getView().setMinZoom(value)},WPGMZA.OLMap.prototype.getMaxZoom=function(){return this.olMap.getView().getMaxZoom()},WPGMZA.OLMap.prototype.setMaxZoom=function(value){this.olMap.getView().setMaxZoom(value)},WPGMZA.OLMap.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),this.olMap&&this.olMap.getView().setProperties(this.settings.toOLViewOptions())},WPGMZA.OLMap.prototype.addMarker=function(marker){WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT?this.olMap.addOverlay(marker.overlay):(this.markerLayer.getSource().addFeature(marker.feature),marker.featureInSource=!0),Parent.prototype.addMarker.call(this,marker)},WPGMZA.OLMap.prototype.removeMarker=function(marker){WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT?this.olMap.removeOverlay(marker.overlay):(this.markerLayer.getSource().removeFeature(marker.feature),marker.featureInSource=!1),Parent.prototype.removeMarker.call(this,marker)},WPGMZA.OLMap.prototype.addPolygon=function(polygon){this.olMap.addLayer(polygon.layer),Parent.prototype.addPolygon.call(this,polygon)},WPGMZA.OLMap.prototype.removePolygon=function(polygon){this.olMap.removeLayer(polygon.layer),Parent.prototype.removePolygon.call(this,polygon)},WPGMZA.OLMap.prototype.addPolyline=function(polyline){this.olMap.addLayer(polyline.layer),Parent.prototype.addPolyline.call(this,polyline)},WPGMZA.OLMap.prototype.removePolyline=function(polyline){this.olMap.removeLayer(polyline.layer),Parent.prototype.removePolyline.call(this,polyline)},WPGMZA.OLMap.prototype.addCircle=function(circle){this.olMap.addLayer(circle.layer),Parent.prototype.addCircle.call(this,circle)},WPGMZA.OLMap.prototype.removeCircle=function(circle){this.olMap.removeLayer(circle.layer),Parent.prototype.removeCircle.call(this,circle)},WPGMZA.OLMap.prototype.addRectangle=function(rectangle){this.olMap.addLayer(rectangle.layer),Parent.prototype.addRectangle.call(this,rectangle)},WPGMZA.OLMap.prototype.removeRectangle=function(rectangle){this.olMap.removeLayer(rectangle.layer),Parent.prototype.removeRectangle.call(this,rectangle)},WPGMZA.OLMap.prototype.pixelsToLatLng=function(x,y){null==y&&("x"in x&&"y"in x?(y=x.y,x=x.x):console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)"));var coord=this.olMap.getCoordinateFromPixel([x,y]);if(!coord)return{x:null,y:null};var lonLat=ol.proj.toLonLat(coord);return{lat:lonLat[1],lng:lonLat[0]}},WPGMZA.OLMap.prototype.latLngToPixels=function(latLng){var coord=ol.proj.fromLonLat([latLng.lng,latLng.lat]),pixel=this.olMap.getPixelFromCoordinate(coord);return pixel?{x:pixel[0],y:pixel[1]}:{x:null,y:null}},WPGMZA.OLMap.prototype.enableBicycleLayer=function(value){if(value)this.bicycleLayer||(this.bicycleLayer=new ol.layer.Tile({source:new ol.source.OSM({url:"http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png"})})),this.olMap.addLayer(this.bicycleLayer);else{if(!this.bicycleLayer)return;this.olMap.removeLayer(this.bicycleLayer)}},WPGMZA.OLMap.prototype.showGestureOverlay=function(){var self=this;clearTimeout(this.gestureOverlayTimeoutID),$(this.gestureOverlay).stop().animate({opacity:"100"}),$(this.element).append(this.gestureOverlay),$(this.gestureOverlay).css({"line-height":$(this.element).height()+"px",opacity:"1.0"}),$(this.gestureOverlay).show(),this.gestureOverlayTimeoutID=setTimeout(function(){self.gestureOverlay.fadeOut(2e3)},2e3)},WPGMZA.OLMap.prototype.onElementResized=function(event){this.olMap.updateSize()},WPGMZA.OLMap.prototype.onRightClick=function(event){if($(event.target).closest(".ol-marker, .wpgmza_modern_infowindow, .wpgmza-modern-store-locator").length)return!0;var parentOffset=$(this.element).offset(),relX=event.pageX-parentOffset.left,relY=event.pageY-parentOffset.top,latLng=this.pixelsToLatLng(relX,relY);return this.trigger({type:"rightclick",latLng:latLng}),$(this.element).trigger({type:"rightclick",latLng:latLng}),event.preventDefault(),!1},WPGMZA.OLMap.prototype.enableAllInteractions=function(){this.olMap.getInteractions().forEach(function(interaction){(interaction instanceof ol.interaction.DragPan||interaction instanceof ol.interaction.DoubleClickZoom||interaction instanceof ol.interaction.MouseWheelZoom)&&interaction.setActive(!0)},this)}}),jQuery(function($){var Parent;WPGMZA.OLMarker=function(options){var self=this;Parent.call(this,options);var settings={};if(options)for(var name in options)options[name]instanceof WPGMZA.LatLng?settings[name]=options[name].toLatLngLiteral():options[name]instanceof WPGMZA.Map||(settings[name]=options[name]);var origin=ol.proj.fromLonLat([parseFloat(this.lng),parseFloat(this.lat)]);if(WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT){var img=$("<img alt=''/>")[0];img.onload=function(event){self.updateElementHeight(),self.map&&self.map.olMap.updateSize()},img.src=WPGMZA.defaultMarkerIcon,this.element=$("<div class='ol-marker'></div>")[0],this.element.appendChild(img),this.element.wpgmzaMarker=this,$(this.element).on("mouseover",function(event){self.dispatchEvent("mouseover")}),this.overlay=new ol.Overlay({element:this.element,position:origin,positioning:"bottom-center",stopEvent:!1}),this.overlay.setPosition(origin),this.animation?this.setAnimation(this.animation):this.anim&&this.setAnimation(this.anim),options&&options.draggable&&this.setDraggable(!0),this.rebindClickListener()}else{if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)throw new Error("Invalid marker render mode");this.feature=new ol.Feature({geometry:new ol.geom.Point(origin)}),this.feature.setStyle(this.getVectorLayerStyle()),(this.feature.wpgmzaMarker=this).feature.wpgmzaFeature=this}this.setOptions(settings),this.trigger("init")},Parent=WPGMZA.isProVersion()?WPGMZA.ProMarker:WPGMZA.Marker,WPGMZA.OLMarker.prototype=Object.create(Parent.prototype),WPGMZA.OLMarker.prototype.constructor=WPGMZA.OLMarker,WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT="element",WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER="vector",WPGMZA.OLMarker.renderMode=WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT,"open-layers"==WPGMZA.settings.engine&&WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&(WPGMZA.OLMarker.defaultVectorLayerStyle=new ol.style.Style({image:new ol.style.Icon({anchor:[.5,1],src:WPGMZA.defaultMarkerIcon})}),WPGMZA.OLMarker.hiddenVectorLayerStyle=new ol.style.Style({})),WPGMZA.OLMarker.prototype.getVectorLayerStyle=function(){return this.vectorLayerStyle?this.vectorLayerStyle:WPGMZA.OLMarker.defaultVectorLayerStyle},WPGMZA.OLMarker.prototype.updateElementHeight=function(height,calledOnFocus){var self=this;0!=(height=height||$(this.element).find("img").height())||calledOnFocus||$(window).one("focus",function(event){self.updateElementHeight(!1,!0)}),$(this.element).css({height:height+"px"})},WPGMZA.OLMarker.prototype.addLabel=function(){this.setLabel(this.getLabelText())},WPGMZA.OLMarker.prototype.setLabel=function(label){WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?label?(this.label||(this.label=$("<div class='ol-marker-label'/>"),$(this.element).append(this.label)),this.label.html(label)):this.label&&$(this.element).find(".ol-marker-label").remove():console.warn("Marker labels are not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.getVisible=function(visible){if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)return"none"!=this.overlay.getElement().style.display},WPGMZA.OLMarker.prototype.setVisible=function(visible){if(Parent.prototype.setVisible.call(this,visible),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)if(visible){var style=this.getVectorLayerStyle();this.feature.setStyle(style)}else this.feature.setStyle(null);else this.overlay.getElement().style.display=visible?"block":"none"},WPGMZA.OLMarker.prototype.setPosition=function(latLng){Parent.prototype.setPosition.call(this,latLng);var origin=ol.proj.fromLonLat([parseFloat(this.lng),parseFloat(this.lat)]);WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?this.feature.setGeometry(new ol.geom.Point(origin)):this.overlay.setPosition(origin)},WPGMZA.OLMarker.prototype.updateOffset=function(x,y){if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER){x=this._offset.x,y=this._offset.y;this.element.style.position="relative",this.element.style.left=x+"px",this.element.style.top=y+"px"}else console.warn("Marker offset is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setAnimation=function(anim){if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)switch(Parent.prototype.setAnimation.call(this,anim),anim){case WPGMZA.Marker.ANIMATION_NONE:$(this.element).removeAttr("data-anim");break;case WPGMZA.Marker.ANIMATION_BOUNCE:$(this.element).attr("data-anim","bounce");break;case WPGMZA.Marker.ANIMATION_DROP:$(this.element).attr("data-anim","drop")}else console.warn("Marker animation is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setDraggable=function(draggable){var self=this;if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)if(draggable){var options={disabled:!1};this.jQueryDraggableInitialized||(options.start=function(event){self.onDragStart(event)},options.stop=function(event){self.onDragEnd(event)}),$(this.element).draggable(options),this.jQueryDraggableInitialized=!0,this.rebindClickListener()}else $(this.element).draggable({disabled:!0});else console.warn("Marker dragging is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setOpacity=function(opacity){WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?$(this.element).css({opacity:opacity}):console.warn("Marker opacity is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.onDragStart=function(event){this.isBeingDragged=!0,this.map.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan&&interaction.setActive(!1)})},WPGMZA.OLMarker.prototype.onDragEnd=function(event){var offset_top=parseFloat($(this.element).css("top").match(/-?\d+/)[0]),offset_left=parseFloat($(this.element).css("left").match(/-?\d+/)[0]);$(this.element).css({top:"0px",left:"0px"});var currentLatLng=this.getPosition(),pixelsBeforeDrag=this.map.latLngToPixels(currentLatLng),pixelsAfterDrag={x:pixelsBeforeDrag.x+offset_left,y:pixelsBeforeDrag.y+offset_top},latLngAfterDrag=this.map.pixelsToLatLng(pixelsAfterDrag);this.setPosition(latLngAfterDrag),this.isBeingDragged=!1,this.trigger({type:"dragend",latLng:latLngAfterDrag}),this.trigger("change"),"yes"!=this.map.settings.wpgmza_settings_map_draggable&&this.map.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan&&interaction.setActive(!0)})},WPGMZA.OLMarker.prototype.onElementClick=function(event){var self=event.currentTarget.wpgmzaMarker;self.isBeingDragged||(self.dispatchEvent("click"),self.dispatchEvent("select"))},WPGMZA.OLMarker.prototype.rebindClickListener=function(){$(this.element).off("click",this.onElementClick),$(this.element).on("click",this.onElementClick)}}),jQuery(function($){WPGMZA.OLModernStoreLocatorCircle=function(map,settings){WPGMZA.ModernStoreLocatorCircle.call(this,map,settings)},WPGMZA.OLModernStoreLocatorCircle.prototype=Object.create(WPGMZA.ModernStoreLocatorCircle.prototype),WPGMZA.OLModernStoreLocatorCircle.prototype.constructor=WPGMZA.OLModernStoreLocatorCircle,WPGMZA.OLModernStoreLocatorCircle.prototype.initCanvasLayer=function(){var self=this,olViewportElement=$(this.map.element).children(".ol-viewport");this.canvas=document.createElement("canvas"),this.canvas.className="wpgmza-ol-canvas-overlay",olViewportElement.find(".ol-layers .ol-layer:first-child").prepend(this.canvas),this.renderFunction=function(event){self.canvas.width==olViewportElement.width()&&self.canvas.height==olViewportElement.height()||(self.canvas.width=olViewportElement.width(),self.canvas.height=olViewportElement.height(),$(this.canvas).css({width:olViewportElement.width()+"px",height:olViewportElement.height()+"px"})),self.draw()},this.map.olMap.on("postrender",this.renderFunction)},WPGMZA.OLModernStoreLocatorCircle.prototype.getContext=function(type){return this.canvas.getContext(type)},WPGMZA.OLModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){return{width:this.canvas.width,height:this.canvas.height}},WPGMZA.OLModernStoreLocatorCircle.prototype.getCenterPixels=function(){return this.map.latLngToPixels(this.settings.center)},WPGMZA.OLModernStoreLocatorCircle.prototype.getWorldOriginOffset=function(){return{x:0,y:0}},WPGMZA.OLModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){var center=new WPGMZA.LatLng(this.settings.center),outer=new WPGMZA.LatLng(center);outer.moveByDistance(km,90);var centerPixels=this.map.latLngToPixels(center),outerPixels=this.map.latLngToPixels(outer);return Math.abs(outerPixels.x-centerPixels.x)},WPGMZA.OLModernStoreLocatorCircle.prototype.getScale=function(){return 1},WPGMZA.OLModernStoreLocatorCircle.prototype.destroy=function(){$(this.canvas).remove(),this.map.olMap.un("postrender",this.renderFunction),this.map=null,this.canvas=null}}),jQuery(function($){WPGMZA.OLModernStoreLocator=function(map_id){WPGMZA.ModernStoreLocator.call(this,map_id),(WPGMZA.isProVersion()?$(".wpgmza_map[data-map-id='"+map_id+"']"):$("#wpgmza_map")).append(this.element)},WPGMZA.OLModernStoreLocator.prototype=Object.create(WPGMZA.ModernStoreLocator),WPGMZA.OLModernStoreLocator.prototype.constructor=WPGMZA.OLModernStoreLocator}),jQuery(function($){var Parent;WPGMZA.OLPolygon=function(options,olFeature){if(Parent.call(this,options,olFeature),olFeature)this.olFeature=olFeature;else{var coordinates=[[]];if(options&&options.polydata)for(var paths=this.parseGeometry(options.polydata),i=0;i<=paths.length;i++)coordinates[0].push(ol.proj.fromLonLat([parseFloat(paths[i%paths.length].lng),parseFloat(paths[i%paths.length].lat)]));this.olFeature=new ol.Feature({geometry:new ol.geom.Polygon(coordinates)})}this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]})}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaPolygon:this,wpgmzaFeature:this}),options&&this.setOptions(options)},Parent=WPGMZA.isProVersion()?WPGMZA.ProPolygon:WPGMZA.Polygon,WPGMZA.OLPolygon.prototype=Object.create(Parent.prototype),WPGMZA.OLPolygon.prototype.constructor=WPGMZA.OLPolygon,WPGMZA.OLPolygon.prototype.getGeometry=function(){for(var coordinates=this.olFeature.getGeometry().getCoordinates()[0],result=[],i=0;i<coordinates.length;i++){var lonLat=ol.proj.toLonLat(coordinates[i]),latLng={lat:lonLat[1],lng:lonLat[0]};result.push(latLng)}return result},WPGMZA.OLPolygon.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){var Parent;WPGMZA.OLPolyline=function(options,olFeature){if(WPGMZA.Polyline.call(this,options),olFeature)this.olFeature=olFeature;else{var coordinates=[];if(options&&options.polydata)for(var path=this.parseGeometry(options.polydata),i=0;i<path.length;i++){if(!$.isNumeric(path[i].lat))throw new Error("Invalid latitude");if(!$.isNumeric(path[i].lng))throw new Error("Invalid longitude");coordinates.push(ol.proj.fromLonLat([parseFloat(path[i].lng),parseFloat(path[i].lat)]))}this.olFeature=new ol.Feature({geometry:new ol.geom.LineString(coordinates)})}this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]})}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaPolyline:this,wpgmzaFeature:this}),options&&this.setOptions(options)},Parent=WPGMZA.Polyline,WPGMZA.OLPolyline.prototype=Object.create(Parent.prototype),WPGMZA.OLPolyline.prototype.constructor=WPGMZA.OLPolyline,WPGMZA.OLPolyline.prototype.getGeometry=function(){for(var result=[],coordinates=this.olFeature.getGeometry().getCoordinates(),i=0;i<coordinates.length;i++){var lonLat=ol.proj.toLonLat(coordinates[i]),latLng={lat:lonLat[1],lng:lonLat[0]};result.push(latLng)}return result},WPGMZA.OLPolyline.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){var Parent=WPGMZA.Rectangle;WPGMZA.OLRectangle=function(options,olFeature){if(Parent.apply(this,arguments),olFeature)this.olFeature=olFeature;else{var coordinates=[[]];options.cornerA&&options.cornerB&&(coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerA.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerB.lng),parseFloat(options.cornerA.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerB.lng),parseFloat(options.cornerB.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerB.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerA.lat)]))),this.olFeature=new ol.Feature({geometry:new ol.geom.Polygon(coordinates)})}this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]}),style:this.olStyle}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaRectangle:this,wpgmzaFeature:this}),options&&this.setOptions(options)},WPGMZA.extend(WPGMZA.OLRectangle,WPGMZA.Rectangle),WPGMZA.OLRectangle.prototype.getBounds=function(){var extent=this.olFeature.getGeometry().getExtent(),topLeft=ol.extent.getTopLeft(extent),bottomRight=ol.extent.getBottomRight(extent),topLeftLonLat=ol.proj.toLonLat(topLeft),bottomRightLonLat=ol.proj.toLonLat(bottomRight),topLeftLatLng=new WPGMZA.LatLng(topLeftLonLat[1],topLeftLonLat[0]),bottomRightLatLng=new WPGMZA.LatLng(bottomRightLonLat[1],bottomRightLonLat[0]);return new WPGMZA.LatLngBounds(topLeftLatLng,bottomRightLatLng)},WPGMZA.OLRectangle.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){WPGMZA.OLText=function(){}}),jQuery(function($){WPGMZA.DataTable=function(element){var self=this;if(!$.fn.dataTable)return console.warn("The dataTables library is not loaded. Cannot create a dataTable. Did you enable 'Do not enqueue dataTables'?"),void(WPGMZA.settings.wpgmza_do_not_enqueue_datatables&&WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_EDIT&&alert("You have selected 'Do not enqueue DataTables' in WP Google Maps' settings. No 3rd party software is loading the DataTables library. Because of this, the marker table cannot load. Please uncheck this option to use the marker table."));if($.fn.dataTable.ext)$.fn.dataTable.ext.errMode="throw";else{var version=$.fn.dataTable.version?$.fn.dataTable.version:"unknown";console.warn("You appear to be running an outdated or modified version of the dataTables library. This may cause issues with table functionality. This is usually caused by 3rd party software loading an older version of DataTables. The loaded version is "+version+", we recommend version 1.10.12 or above.")}$.fn.dataTable.Api&&$.fn.dataTable.Api.register("processing()",function(show){return this.iterator("table",function(ctx){ctx.oApi._fnProcessingDisplay(ctx,show)})}),this.element=element,(this.element.wpgmzaDataTable=this).dataTableElement=this.getDataTableElement();var settings=this.getDataTableSettings();this.phpClass=$(element).attr("data-wpgmza-php-class"),(this.wpgmzaDataTable=this).useCompressedPathVariable=WPGMZA.restAPI.isCompressedPathVariableSupported&&WPGMZA.settings.enable_compressed_path_variables,this.method=this.useCompressedPathVariable?"GET":"POST",null==this.getLanguageURL()||"//cdn.datatables.net/plug-ins/1.10.12/i18n/English.json"==this.getLanguageURL()?(this.dataTable=$(this.dataTableElement).DataTable(settings),this.dataTable.ajax.reload()):$.ajax(this.getLanguageURL(),{success:function(response,status,xhr){self.languageJSON=response,self.dataTable=$(self.dataTableElement).DataTable(settings),self.dataTable.ajax.reload()}})},WPGMZA.DataTable.prototype.getDataTableElement=function(){return $(this.element).find("table")},WPGMZA.DataTable.prototype.onAJAXRequest=function(data,settings){var params={phpClass:this.phpClass},attr=$(this.element).attr("data-wpgmza-ajax-parameters");return attr&&$.extend(params,JSON.parse(attr)),$.extend(data,params)},WPGMZA.DataTable.prototype.onDataTableAjaxRequest=function(data,callback,settings){var self=this,element=this.element,route=$(element).attr("data-wpgmza-rest-api-route"),params=this.onAJAXRequest(data,settings),draw=params.draw;if(delete params.draw,!route)throw new Error("No data-wpgmza-rest-api-route attribute specified");var options={method:"POST",useCompressedPathVariable:!0,data:params,dataType:"json",cache:!this.preventCaching,beforeSend:function(xhr){xhr.setRequestHeader("X-DataTables-Draw",draw)},success:function(response,status,xhr){response.draw=draw,self.lastResponse=response,callback(response),$("[data-marker-icon-src]").each(function(index,element){WPGMZA.MarkerIcon.createInstance($(element).attr("data-marker-icon-src")).applyToElement(element)})}};return WPGMZA.restAPI.call(route,options)},WPGMZA.DataTable.prototype.getDataTableSettings=function(){var self=this,element=this.element,options={};$(element).attr("data-wpgmza-datatable-options")&&(options=JSON.parse($(element).attr("data-wpgmza-datatable-options"))),options.deferLoading=!0,options.processing=!0,options.serverSide=!0,options.ajax=function(data,callback,settings){return WPGMZA.DataTable.prototype.onDataTableAjaxRequest.apply(self,arguments)},WPGMZA.AdvancedTableDataTable&&this instanceof WPGMZA.AdvancedTableDataTable&&WPGMZA.settings.wpgmza_default_items&&(options.iDisplayLength=parseInt(WPGMZA.settings.wpgmza_default_items)),options.aLengthMenu=[[5,10,25,50,100,-1],["5","10","25","50","100",WPGMZA.localized_strings.all]];var languageURL=this.getLanguageURL();return languageURL&&(options.language={url:languageURL}),options},WPGMZA.DataTable.prototype.getLanguageURL=function(){if(!WPGMZA.locale)return null;var languageURL;switch(WPGMZA.locale.substr(0,2)){case"af":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Afrikaans.json";break;case"sq":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Albanian.json";break;case"am":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Amharic.json";break;case"ar":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Arabic.json";break;case"hy":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Armenian.json";break;case"az":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Azerbaijan.json";break;case"bn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Bangla.json";break;case"eu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Basque.json";break;case"be":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Belarusian.json";break;case"bg":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Bulgarian.json";break;case"ca":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Catalan.json";break;case"zh":languageURL="zh_TW"==WPGMZA.locale?WPGMZA.pluginDirURL+"languages/datatables/Chinese-traditional.json":"//cdn.datatables.net/plug-ins/1.10.12/i18n/Chinese.json";break;case"hr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Croatian.json";break;case"cs":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Czech.json";break;case"da":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Danish.json";break;case"nl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Dutch.json";break;case"et":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Estonian.json";break;case"fi":languageURL=WPGMZA.locale.match(/^fil/)?WPGMZA.pluginDirURL+"languages/datatables/Filipino.json":WPGMZA.pluginDirURL+"languages/datatables/Finnish.json";break;case"fr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/French.json";break;case"gl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Galician.json";break;case"ka":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Georgian.json";break;case"de":languageURL=WPGMZA.pluginDirURL+"languages/datatables/German.json";break;case"el":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Greek.json";break;case"gu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Gujarati.json";break;case"he":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hebrew.json";break;case"hi":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hindi.json";break;case"hu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hungarian.json";break;case"is":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Icelandic.json";break;case"id":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Indonesian.json";break;case"ga":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Irish.json";break;case"it":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Italian.json";break;case"ja":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Japanese.json";break;case"kk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Kazakh.json";break;case"ko":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Korean.json";break;case"ky":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Kyrgyz.json";break;case"lv":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Latvian.json";break;case"lt":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Lithuanian.json";break;case"mk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Macedonian.json";break;case"ml":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Malay.json";break;case"mn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Mongolian.json";break;case"ne":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Nepali.json";break;case"nb":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Norwegian-Bokmal.json";break;case"nn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Norwegian-Nynorsk.json";break;case"ps":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Pashto.json";break;case"fa":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Persian.json";break;case"pl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Polish.json";break;case"pt":languageURL="pt_BR"==WPGMZA.locale?WPGMZA.pluginDirURL+"languages/datatables/Portuguese-Brasil.json":"//cdn.datatables.net/plug-ins/1.10.12/i18n/Portuguese.json";break;case"ro":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Romanian.json";break;case"ru":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Russian.json";break;case"sr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Serbian.json";break;case"si":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Sinhala.json";break;case"sk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Slovak.json";break;case"sl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Slovenian.json";break;case"es":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Spanish.json";break;case"sw":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Swahili.json";break;case"sv":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Swedish.json";break;case"ta":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Tamil.json";break;case"te":languageURL=WPGMZA.pluginDirURL+"languages/datatables/telugu.json";break;case"th":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Thai.json";break;case"tr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Turkish.json";break;case"uk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Ukrainian.json";break;case"ur":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Urdu.json";break;case"uz":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Uzbek.json";break;case"vi":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Vietnamese.json";break;case"cy":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Welsh.json"}return languageURL},WPGMZA.DataTable.prototype.onAJAXResponse=function(response){},WPGMZA.DataTable.prototype.reload=function(){this.dataTable.ajax.reload(null,!1)}}),jQuery(function($){WPGMZA.AdminFeatureDataTable=function(element){var self=this;this.allSelected=!1,WPGMZA.DataTable.call(this,element),$(element).on("click",".wpgmza.bulk_delete",function(event){self.onBulkDelete(event)}),$(element).on("click",".wpgmza.select_all_markers",function(event){self.onSelectAll(event)}),$(element).on("click","[data-center-marker-id]",function(event){self.onCenterMarker(event)})},WPGMZA.extend(WPGMZA.AdminFeatureDataTable,WPGMZA.DataTable),Object.defineProperty(WPGMZA.AdminFeatureDataTable.prototype,"featureType",{get:function(){return $(this.element).attr("data-wpgmza-feature-type")}}),Object.defineProperty(WPGMZA.AdminFeatureDataTable.prototype,"featurePanel",{get:function(){return WPGMZA.mapEditPage[this.featureType+"Panel"]}}),WPGMZA.AdminFeatureDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,index){var meta=self.lastResponse.meta[index];row.wpgmzaFeatureData=meta},options},WPGMZA.AdminFeatureDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[],map=WPGMZA.maps[0],plural=this.featureType+"s";$(this.element).find("input[name='mark']:checked").each(function(index,el){var row=$(el).closest("tr")[0];ids.push(row.wpgmzaFeatureData.id)}),ids.forEach(function(marker_id){var marker=map.getMarkerByID(marker_id);marker&&map.removeMarker(marker)}),WPGMZA.restAPI.call("/"+plural+"/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},WPGMZA.AdminFeatureDataTable.prototype.onSelectAll=function(event){this.allSelected=!this.allSelected;var self=this;$(this.element).find("input[name='mark']").each(function(){self.allSelected?$(this).prop("checked",!0):$(this).prop("checked",!1)})},WPGMZA.AdminFeatureDataTable.prototype.onCenterMarker=function(event){var id;id=null==event.currentTarget?event:$(event.currentTarget).attr("data-center-marker-id");var marker=WPGMZA.mapEditPage.map.getMarkerByID(id);if(marker){var latLng=new WPGMZA.LatLng({lat:marker.lat,lng:marker.lng});WPGMZA.mapEditPage.map.setCenter(latLng),WPGMZA.animateScroll("#wpgmaps_tabs_markers")}}}),jQuery(function($){WPGMZA.AdminMapDataTable=function(element){var self=this;WPGMZA.DataTable.call(this,element),$(element).on("mousedown","button[data-action='edit']",function(event){switch(event.which){case 1:var map_id=$(event.target).attr("data-map-id");window.location.href=window.location.href+"&action=edit&map_id="+map_id;break;case 2:map_id=$(event.target).attr("data-map-id");window.open(window.location.href+"&action=edit&map_id="+map_id)}}),$(element).find(".wpgmza.select_all_maps").on("click",function(event){self.onSelectAll(event)}),$(element).find(".wpgmza.bulk_delete_maps").on("click",function(event){self.onBulkDelete(event)}),$(element).on("click","button[data-action='duplicate']",function(event){var map_id=$(event.target).attr("data-map-id");WPGMZA.restAPI.call("/maps/",{method:"POST",data:{id:map_id,action:"duplicate"},success:function(response,status,xhr){self.reload()}})}),$(element).on("click","button[data-action='trash']",function(event){if(confirm(WPGMZA.localized_strings.map_delete_prompt_text)){var map_id=$(event.target).attr("data-map-id");WPGMZA.restAPI.call("/maps/",{method:"DELETE",data:{id:map_id},success:function(response,status,xhr){self.reload()}})}})},WPGMZA.extend(WPGMZA.AdminMapDataTable,WPGMZA.DataTable),WPGMZA.AdminMapDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,index){var meta=self.lastResponse.meta[index];row.wpgmzaMapData=meta},options},WPGMZA.AdminMapDataTable.prototype.onSelectAll=function(event){$(this.element).find("input[name='mark']").prop("checked",!0)},WPGMZA.AdminMapDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[];$(this.element).find("input[name='mark']:checked").each(function(index,el){var row=$(el).closest("tr")[0];ids.push(row.wpgmzaMapData.id)}),confirm(WPGMZA.localized_strings.map_bulk_delete_prompt_text)&&WPGMZA.restAPI.call("/maps/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},$(document).ready(function(event){$("[data-wpgmza-admin-map-datatable]").each(function(index,el){WPGMZA.AdminMapDataTable=new WPGMZA.AdminMapDataTable(el)})})}),jQuery(function($){WPGMZA.AdminMarkerDataTable=function(element){var self=this;this.preventCaching=!0,WPGMZA.DataTable.call(this,element),$(element).on("click","[data-delete-marker-id]",function(event){self.onDeleteMarker(event)}),$(element).find(".wpgmza.select_all_markers").on("click",function(event){self.onSelectAll(event)}),$(element).find(".wpgmza.bulk_delete").on("click",function(event){self.onBulkDelete(event)}),$(element).on("click","[data-center-marker-id]",function(event){self.onCenterMarker(event)})},WPGMZA.AdminMarkerDataTable.prototype=Object.create(WPGMZA.DataTable.prototype),WPGMZA.AdminMarkerDataTable.prototype.constructor=WPGMZA.AdminMarkerDataTable,WPGMZA.AdminMarkerDataTable.createInstance=function(element){return new WPGMZA.AdminMarkerDataTable(element)},WPGMZA.AdminMarkerDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,index){var meta=self.lastResponse.meta[index];row.wpgmzaMarkerData=meta},options},WPGMZA.AdminMarkerDataTable.prototype.onEditMarker=function(event){WPGMZA.animatedScroll("#wpgmaps_tabs_markers")},WPGMZA.AdminMarkerDataTable.prototype.onDeleteMarker=function(event){var self=this,id=$(event.currentTarget).attr("data-delete-marker-id"),data={action:"delete_marker",security:WPGMZA.legacyajaxnonce,map_id:WPGMZA.mapEditPage.map.id,marker_id:id};$.post(ajaxurl,data,function(response){WPGMZA.mapEditPage.map.removeMarkerByID(id),self.reload()})},WPGMZA.AdminMarkerDataTable.prototype.onApproveMarker=function(event){var cur_id=$(this).attr("id"),data={action:"approve_marker",security:WPGMZA.legacyajaxnonce,map_id:WPGMZA.mapEditPage.map.id,marker_id:cur_id};$.post(ajaxurl,data,function(response){wpgmza_InitMap(),wpgmza_reinitialisetbl()})},WPGMZA.AdminMarkerDataTable.prototype.onSelectAll=function(event){$(this.element).find("input[name='mark']").prop("checked",!0)},WPGMZA.AdminMarkerDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[],map=WPGMZA.maps[0];$(this.element).find("input[name='mark']:checked").each(function(index,el){var row=$(el).closest("tr")[0];ids.push(row.wpgmzaMarkerData.id)}),ids.forEach(function(marker_id){var marker=map.getMarkerByID(marker_id);marker&&map.removeMarker(marker)}),WPGMZA.restAPI.call("/markers/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},WPGMZA.AdminMarkerDataTable.prototype.onCenterMarker=function(event){var id;id=null==event.currentTarget?event:$(event.currentTarget).attr("data-center-marker-id");var marker=WPGMZA.mapEditPage.map.getMarkerByID(id);if(marker){var latLng=new WPGMZA.LatLng({lat:marker.lat,lng:marker.lng});WPGMZA.mapEditPage.map.setCenter(latLng),WPGMZA.mapEditPage.map.setZoom(6),WPGMZA.animateScroll("#wpgmaps_tabs_markers")}}});
|
languages/datatables/Afrikaans.json
CHANGED
File without changes
|
languages/datatables/Albanian.json
CHANGED
File without changes
|
languages/datatables/Arabic.json
CHANGED
File without changes
|
languages/datatables/Armenian.json
CHANGED
File without changes
|
languages/datatables/Azerbaijan.json
CHANGED
File without changes
|
languages/datatables/Bangla.json
CHANGED
File without changes
|
languages/datatables/Basque.json
CHANGED
File without changes
|
languages/datatables/Belarusian.json
CHANGED
File without changes
|
languages/datatables/Bulgarian.json
CHANGED
File without changes
|
languages/datatables/Catalan.json
CHANGED
File without changes
|
languages/datatables/Chinese-traditional.json
CHANGED
File without changes
|
languages/datatables/Croatian.json
CHANGED
File without changes
|
languages/datatables/Czech.json
CHANGED
File without changes
|
languages/datatables/Danish.json
CHANGED
File without changes
|
languages/datatables/Dutch.json
CHANGED
File without changes
|
languages/datatables/English.json
CHANGED
File without changes
|
languages/datatables/Estonian.json
CHANGED
File without changes
|
languages/datatables/Filipino.json
CHANGED
File without changes
|
languages/datatables/Finnish.json
CHANGED
File without changes
|
languages/datatables/French.json
CHANGED
File without changes
|
languages/datatables/Galician.json
CHANGED
File without changes
|
languages/datatables/Georgian.json
CHANGED
File without changes
|
languages/datatables/German.json
CHANGED
File without changes
|
languages/datatables/Greek.json
CHANGED
File without changes
|
languages/datatables/Gujarati.json
CHANGED
File without changes
|
languages/datatables/Hebrew.json
CHANGED
File without changes
|
languages/datatables/Hindi.json
CHANGED
File without changes
|
languages/datatables/Hungarian.json
CHANGED
File without changes
|
languages/datatables/Icelandic.json
CHANGED
File without changes
|
languages/datatables/Indonesian-Alternative.json
CHANGED
File without changes
|
languages/datatables/Indonesian.json
CHANGED
File without changes
|
languages/datatables/Irish.json
CHANGED
File without changes
|
languages/datatables/Italian.json
CHANGED
File without changes
|
languages/datatables/Japanese.json
CHANGED
File without changes
|
languages/datatables/Kazakh.json
CHANGED
File without changes
|
languages/datatables/Korean.json
CHANGED
File without changes
|
languages/datatables/Kyrgyz.json
CHANGED
File without changes
|
languages/datatables/Latvian.json
CHANGED
File without changes
|
languages/datatables/Lithuanian.json
CHANGED
File without changes
|
languages/datatables/Macedonian.json
CHANGED
File without changes
|
languages/datatables/Malay.json
CHANGED
File without changes
|
languages/datatables/Mongolian.json
CHANGED
File without changes
|
languages/datatables/Nepali.json
CHANGED
File without changes
|
languages/datatables/Norwegian-Bokmal.json
CHANGED
File without changes
|
languages/datatables/Norwegian-Nynorsk.json
CHANGED
File without changes
|
languages/datatables/Pashto.json
CHANGED
File without changes
|
languages/datatables/Persian.json
CHANGED
File without changes
|
languages/datatables/Polish.json
CHANGED
File without changes
|
languages/datatables/Portuguese-Brasil.json
CHANGED
File without changes
|
languages/datatables/Romanian.json
CHANGED
File without changes
|
languages/datatables/Russian.json
CHANGED
File without changes
|
languages/datatables/Serbian.json
CHANGED
File without changes
|
languages/datatables/Sinhala.json
CHANGED
File without changes
|
languages/datatables/Slovak.json
CHANGED
File without changes
|
languages/datatables/Slovenian.json
CHANGED
File without changes
|
languages/datatables/Spanish.json
CHANGED
File without changes
|
languages/datatables/Swahili.json
CHANGED
File without changes
|
languages/datatables/Swedish.json
CHANGED
File without changes
|
languages/datatables/Tamil.json
CHANGED
File without changes
|
languages/datatables/Thai.json
CHANGED
File without changes
|
languages/datatables/Turkish.json
CHANGED
File without changes
|
languages/datatables/Ukrainian.json
CHANGED
File without changes
|
languages/datatables/Urdu.json
CHANGED
File without changes
|
languages/datatables/Uzbek.json
CHANGED
File without changes
|
languages/datatables/Vietnamese.json
CHANGED
File without changes
|
languages/datatables/Welsh.json
CHANGED
File without changes
|
languages/js/dataTables.cs_CZ.txt
CHANGED
File without changes
|
languages/js/dataTables.de_DE.txt
CHANGED
File without changes
|
languages/js/dataTables.en_GB.txt
CHANGED
File without changes
|
languages/js/dataTables.es_ES.txt
CHANGED
File without changes
|
languages/js/dataTables.fr_FR.txt
CHANGED
File without changes
|
languages/js/dataTables.nl_NL.txt
CHANGED
File without changes
|
languages/js/dataTables.ru_RU.txt
CHANGED
File without changes
|
languages/js/dataTables.se_SE.txt
CHANGED
File without changes
|
languages/js/dataTables.sk_SK.txt
CHANGED
File without changes
|
languages/outdated/js/dataTables.cs_CZ.txt
CHANGED
File without changes
|
languages/outdated/js/dataTables.de_DE.txt
CHANGED
File without changes
|
languages/outdated/js/dataTables.en_GB.txt
CHANGED
File without changes
|
languages/outdated/js/dataTables.es_ES.txt
CHANGED
File without changes
|
languages/outdated/js/dataTables.fr_FR.txt
CHANGED
File without changes
|
languages/outdated/js/dataTables.nl_NL.txt
CHANGED
File without changes
|
languages/outdated/js/dataTables.ru_RU.txt
CHANGED
File without changes
|
languages/outdated/js/dataTables.se_SE.txt
CHANGED
File without changes
|
languages/outdated/js/dataTables.sk_SK.txt
CHANGED
File without changes
|
languages/outdated/wp-google-maps-cs_CZ.po
CHANGED
File without changes
|
languages/outdated/wp-google-maps-de_DE.po
CHANGED
File without changes
|
languages/outdated/wp-google-maps-default.po
CHANGED
File without changes
|
languages/outdated/wp-google-maps-es_ES.po
CHANGED
File without changes
|
languages/outdated/wp-google-maps-fr_FR.po
CHANGED
File without changes
|
languages/outdated/wp-google-maps-it_IT.po
CHANGED
File without changes
|
languages/outdated/wp-google-maps-nl_NL.po
CHANGED
File without changes
|
languages/outdated/wp-google-maps-ru_RU.po
CHANGED
File without changes
|
languages/outdated/wp-google-maps-sv_SE.po
CHANGED
File without changes
|
languages/wp-google-maps-bg_BG.po
CHANGED
File without changes
|
languages/wp-google-maps-ca.po
CHANGED
File without changes
|
languages/wp-google-maps-da_DK.po
CHANGED
File without changes
|
languages/wp-google-maps-de_DE.po
CHANGED
File without changes
|
languages/wp-google-maps-de_DE_formal.po
CHANGED
File without changes
|
languages/wp-google-maps-default.po
CHANGED
File without changes
|
languages/wp-google-maps-el_GR.po
CHANGED
File without changes
|
languages/wp-google-maps-en_EN.mo
CHANGED
File without changes
|
languages/wp-google-maps-en_EN.po
CHANGED
File without changes
|
languages/wp-google-maps-es_ES.mo
CHANGED
Binary file
|
languages/wp-google-maps-es_ES.po
CHANGED
@@ -2,14 +2,14 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: wpgmaps\n"
|
4 |
"POT-Creation-Date: 2020-02-11 09:59+0000\n"
|
5 |
-
"PO-Revision-Date:
|
6 |
"Last-Translator: Yago Stecher <stecher@gmail.com>\n"
|
7 |
"Language-Team: \n"
|
8 |
-
"Language:
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-Generator: Poedit 2.
|
13 |
"X-Poedit-Basepath: .\n"
|
14 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
"X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html__\n"
|
@@ -19,14 +19,14 @@ msgstr ""
|
|
19 |
"X-Poedit-SearchPath-3: ../../wp-google-maps-ugm\n"
|
20 |
|
21 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:4
|
22 |
-
#, fuzzy
|
23 |
-
#| msgid "General Settings"
|
24 |
msgid "Live Tracking Settings"
|
25 |
-
msgstr "Configuración
|
26 |
|
27 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:10
|
28 |
msgid "Please use the setting below to control Live Tracking broadcasting."
|
29 |
msgstr ""
|
|
|
|
|
30 |
|
31 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:16
|
32 |
msgid ""
|
@@ -34,12 +34,14 @@ msgid ""
|
|
34 |
"location and polyline routes, this setting enables visitors to your site to "
|
35 |
"receive your updated location as they view your pages."
|
36 |
msgstr ""
|
|
|
|
|
|
|
|
|
37 |
|
38 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:23
|
39 |
-
#, fuzzy
|
40 |
-
#| msgid "Enable pagination"
|
41 |
msgid "Enable Broadcasting"
|
42 |
-
msgstr "Habilitar
|
43 |
|
44 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:34
|
45 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:27
|
@@ -92,7 +94,7 @@ msgstr "Habilitar paginación"
|
|
92 |
#: ../legacy-core.php:3775 ../legacy-core.php:3824 ../legacy-core.php:3853
|
93 |
#: ../legacy-core.php:3857 ../legacy-core.php:4183 ../legacy-core.php:4238
|
94 |
msgid "Yes"
|
95 |
-
msgstr "
|
96 |
|
97 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:35
|
98 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:28
|
@@ -151,17 +153,19 @@ msgstr "No"
|
|
151 |
|
152 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:42
|
153 |
msgid "Live Tracking Devices"
|
154 |
-
msgstr ""
|
155 |
|
156 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:50
|
157 |
msgid ""
|
158 |
"Devices which have attempted to pair with your site will appear here. You "
|
159 |
"must approve devices before they will appear on the map."
|
160 |
msgstr ""
|
|
|
|
|
161 |
|
162 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:59
|
163 |
msgid "Device ID"
|
164 |
-
msgstr ""
|
165 |
|
166 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:64
|
167 |
#: ../../wp-google-maps-pro/includes/custom-fields/page.custom-fields.php:107
|
@@ -187,20 +191,16 @@ msgid "Name"
|
|
187 |
msgstr "Nombre"
|
188 |
|
189 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:69
|
190 |
-
#, fuzzy
|
191 |
-
#| msgid "Polylines"
|
192 |
msgid "Draw Polylines"
|
193 |
-
msgstr "
|
194 |
|
195 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:74
|
196 |
-
#, fuzzy
|
197 |
-
#| msgid "Line Color"
|
198 |
msgid "Line Color and Weight"
|
199 |
-
msgstr "Color de línea"
|
200 |
|
201 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:79
|
202 |
msgid "Approved"
|
203 |
-
msgstr ""
|
204 |
|
205 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:106
|
206 |
#: ../legacy-core.php:526 ../legacy-core.php:2684
|
@@ -209,117 +209,119 @@ msgstr "Configuración"
|
|
209 |
|
210 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:113
|
211 |
msgid "New Polyline Distance Threshold (meters)"
|
212 |
-
msgstr ""
|
213 |
|
214 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:122
|
215 |
msgid "New Polyline Time Threshold (minutes)"
|
216 |
-
msgstr ""
|
217 |
|
218 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:5
|
219 |
#: ../../wp-google-maps-gold/includes/class.marker-rating.php:207
|
220 |
-
#, fuzzy
|
221 |
-
#| msgid "Marker Listing"
|
222 |
msgid "Marker Ratings"
|
223 |
-
msgstr "
|
224 |
|
225 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:12
|
226 |
msgid "Minimum Rating"
|
227 |
-
msgstr ""
|
228 |
|
229 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:21
|
230 |
msgid "Maximum Rating"
|
231 |
-
msgstr ""
|
232 |
|
233 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:30
|
234 |
msgid ""
|
235 |
"Please note that changing these settings will not scale ratings which have "
|
236 |
"already been recorded."
|
237 |
msgstr ""
|
|
|
|
|
238 |
|
239 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:34
|
240 |
msgid ""
|
241 |
"We recommend that you do not modify the maximum and minimum settings after "
|
242 |
"you begin accepting ratings."
|
243 |
msgstr ""
|
|
|
|
|
244 |
|
245 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:41
|
246 |
-
#, fuzzy
|
247 |
-
#| msgid "Carousel settings"
|
248 |
msgid "Example range settings:"
|
249 |
-
msgstr "
|
250 |
|
251 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:46
|
252 |
msgid "1 - 5 :- Traditional One to Five Stars"
|
253 |
-
msgstr ""
|
254 |
|
255 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:51
|
256 |
msgid "0 - 100 :- Percentage Rating"
|
257 |
-
msgstr ""
|
258 |
|
259 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:56
|
260 |
msgid "0 - 1 :- Like / Dislike, or Upvote / Downvote"
|
261 |
-
msgstr ""
|
262 |
|
263 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:68
|
264 |
msgid "Rating Step"
|
265 |
-
msgstr ""
|
266 |
|
267 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:77
|
268 |
msgid "The \"Stars\" widget style does not currently support \"Step\""
|
269 |
msgstr ""
|
|
|
270 |
|
271 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:84
|
272 |
-
#, fuzzy
|
273 |
-
#| msgid "Save Style Settings"
|
274 |
msgid "Example step settings:"
|
275 |
-
msgstr "
|
276 |
|
277 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:89
|
278 |
msgid "0.01 :- Allow decimal / floating point ratings"
|
279 |
-
msgstr ""
|
280 |
|
281 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:94
|
282 |
msgid "1 :- Whole number ratings only"
|
283 |
-
msgstr ""
|
284 |
|
285 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:99
|
286 |
msgid "5 :- Round to nearest five (eg for percentage ratings)"
|
287 |
msgstr ""
|
|
|
288 |
|
289 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:110
|
290 |
msgid "Widget Style"
|
291 |
-
msgstr ""
|
292 |
|
293 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:126
|
294 |
msgid "Bar rating gradient colours:"
|
295 |
-
msgstr ""
|
296 |
|
297 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:131
|
298 |
msgid "Start -"
|
299 |
-
msgstr ""
|
300 |
|
301 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:136
|
302 |
msgid "End -"
|
303 |
-
msgstr ""
|
304 |
|
305 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:153
|
306 |
msgid "Background color:"
|
307 |
-
msgstr ""
|
308 |
|
309 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:167
|
310 |
msgid "Tampering Countermeasures"
|
311 |
-
msgstr ""
|
312 |
|
313 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:175
|
314 |
-
#, fuzzy
|
315 |
msgid "Basic Only"
|
316 |
-
msgstr "
|
317 |
|
318 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:180
|
319 |
msgid ""
|
320 |
-
"Uses basic client side countermeasures. This is easily circumvented by "
|
321 |
-
"
|
322 |
msgstr ""
|
|
|
|
|
|
|
323 |
|
324 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:184
|
325 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:204
|
@@ -327,10 +329,12 @@ msgid ""
|
|
327 |
"This method is not reliable for preventing tampering, and is not recommended "
|
328 |
"for use cases where reliability is imperative."
|
329 |
msgstr ""
|
|
|
|
|
330 |
|
331 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:195
|
332 |
msgid "Anti-Spam"
|
333 |
-
msgstr ""
|
334 |
|
335 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:200
|
336 |
msgid ""
|
@@ -338,16 +342,21 @@ msgid ""
|
|
338 |
"can be circumvented with human interaction, but is significantly less "
|
339 |
"vulnerable to bots."
|
340 |
msgstr ""
|
|
|
|
|
|
|
341 |
|
342 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:215
|
343 |
msgid "Require Account"
|
344 |
-
msgstr ""
|
345 |
|
346 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:220
|
347 |
msgid ""
|
348 |
"This method uses the same countermeasures as Basic Only, however it does "
|
349 |
"require that in order to leave a rating, the user must be logged in."
|
350 |
msgstr ""
|
|
|
|
|
351 |
|
352 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:224
|
353 |
msgid ""
|
@@ -355,12 +364,14 @@ msgid ""
|
|
355 |
"can compliment this by using security methods (eg 3rd party plugins) to "
|
356 |
"prevent fake accounts."
|
357 |
msgstr ""
|
|
|
|
|
|
|
358 |
|
359 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:2
|
360 |
#: ../../wp-google-maps-gold/legacy-core.php:2179
|
361 |
-
#, fuzzy
|
362 |
msgid "Near-Vicinity Marker Control Settings"
|
363 |
-
msgstr "Configuración de Marcadores
|
364 |
|
365 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:6
|
366 |
msgid ""
|
@@ -370,107 +381,99 @@ msgid ""
|
|
370 |
"several markers at the same address but would like the user to be able to "
|
371 |
"view data from all the markers."
|
372 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
373 |
|
374 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:14
|
375 |
#: ../../wp-google-maps-gold/legacy-core.php:2182
|
376 |
msgid "Enable Near-Vicinity Marker Control"
|
377 |
-
msgstr ""
|
378 |
|
379 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:36
|
380 |
#: ../../wp-google-maps-gold/legacy-core.php:2189
|
381 |
msgid "Near-Vicinity Affected Radius"
|
382 |
-
msgstr ""
|
383 |
|
384 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:50
|
385 |
-
#, fuzzy
|
386 |
-
#| msgid "Kilometers"
|
387 |
msgid "Meters"
|
388 |
-
msgstr "
|
389 |
|
390 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:56
|
391 |
msgid "Markers within this threshold of one another will be grouped together"
|
392 |
-
msgstr ""
|
393 |
|
394 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:66
|
395 |
msgid "Use Legacy Near-Vicinity Module"
|
396 |
-
msgstr ""
|
397 |
|
398 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:88
|
399 |
-
#, fuzzy
|
400 |
-
#| msgid "Category Marker"
|
401 |
msgid "Placeholder Marker"
|
402 |
-
msgstr "Marcador de
|
403 |
|
404 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:100
|
405 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:254
|
406 |
#: ../../wp-google-maps-gold/legacy-core.php:2224
|
407 |
msgid "Near-Vicinity Shape"
|
408 |
-
msgstr ""
|
409 |
|
410 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:106
|
411 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:268
|
412 |
#: ../../wp-google-maps-gold/legacy-core.php:2226
|
413 |
msgid "Circle"
|
414 |
-
msgstr ""
|
415 |
|
416 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:109
|
417 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:267
|
418 |
#: ../../wp-google-maps-gold/legacy-core.php:2226
|
419 |
msgid "Spiral"
|
420 |
-
msgstr ""
|
421 |
|
422 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:112
|
423 |
msgid "Hexagon"
|
424 |
-
msgstr ""
|
425 |
|
426 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:115
|
427 |
msgid "Line"
|
428 |
-
msgstr ""
|
429 |
|
430 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:118
|
431 |
#: ../../wp-google-maps-pro/legacy-core.php:962
|
432 |
#: ../../wp-google-maps-pro/legacy-core.php:2198
|
433 |
#: ../../wp-google-maps-pro/legacy-core.php:2242
|
434 |
msgid "Grid"
|
435 |
-
msgstr ""
|
436 |
|
437 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:127
|
438 |
-
#, fuzzy
|
439 |
-
#| msgid "Animation"
|
440 |
msgid "Animate Separation"
|
441 |
-
msgstr "
|
442 |
|
443 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:148
|
444 |
-
#, fuzzy
|
445 |
-
#| msgid "Animation"
|
446 |
msgid "Animation Duration"
|
447 |
-
msgstr "
|
448 |
|
449 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:160
|
450 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:245
|
451 |
msgid "Seconds"
|
452 |
-
msgstr ""
|
453 |
|
454 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:169
|
455 |
-
#, fuzzy
|
456 |
-
#| msgid "Animation"
|
457 |
msgid "Animation Easing"
|
458 |
-
msgstr "
|
459 |
|
460 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:174
|
461 |
-
#, fuzzy
|
462 |
msgid "Linear"
|
463 |
-
msgstr "
|
464 |
|
465 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:175
|
466 |
msgid "Sine In"
|
467 |
msgstr ""
|
468 |
|
469 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:176
|
470 |
-
#, fuzzy
|
471 |
-
#| msgid "Line Opacity"
|
472 |
msgid "Sine Out"
|
473 |
-
msgstr "
|
474 |
|
475 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:177
|
476 |
msgid "Sine In & Out"
|
@@ -537,9 +540,8 @@ msgid "Exponential In & Out"
|
|
537 |
msgstr ""
|
538 |
|
539 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:193
|
540 |
-
#, fuzzy
|
541 |
msgid "Circular In"
|
542 |
-
msgstr "
|
543 |
|
544 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:194
|
545 |
msgid "Circular Out"
|
@@ -574,66 +576,54 @@ msgid "Elastic In & Out"
|
|
574 |
msgstr ""
|
575 |
|
576 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:202
|
577 |
-
#, fuzzy
|
578 |
-
#| msgid "Bounce"
|
579 |
msgid "Bounce In"
|
580 |
-
msgstr "
|
581 |
|
582 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:203
|
583 |
-
#, fuzzy
|
584 |
-
#| msgid "Bounce"
|
585 |
msgid "Bounce Out"
|
586 |
-
msgstr "
|
587 |
|
588 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:204
|
589 |
msgid "Bounce In & Out"
|
590 |
msgstr ""
|
591 |
|
592 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:212
|
593 |
-
#, fuzzy
|
594 |
-
#| msgid "Animation"
|
595 |
msgid "Stagger Animation"
|
596 |
-
msgstr "Animación"
|
597 |
|
598 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:233
|
599 |
msgid "Stagger Interval"
|
600 |
-
msgstr ""
|
601 |
|
602 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:275
|
603 |
#: ../../wp-google-maps-gold/legacy-core.php:2196
|
604 |
msgid "Near-Vicinity Hide Lines"
|
605 |
-
msgstr ""
|
606 |
|
607 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:295
|
608 |
#: ../../wp-google-maps-gold/legacy-core.php:2203
|
609 |
-
#, fuzzy
|
610 |
-
#| msgid "On Hover Line Color"
|
611 |
msgid "Near-Vicinity Line Color"
|
612 |
-
msgstr "Color de línea
|
613 |
|
614 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:308
|
615 |
#: ../../wp-google-maps-gold/legacy-core.php:2210
|
616 |
-
#, fuzzy
|
617 |
-
#| msgid "Line Opacity"
|
618 |
msgid "Near-Vicinity Line Opacity"
|
619 |
-
msgstr "Opacidad de línea"
|
620 |
|
621 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:319
|
622 |
#: ../../wp-google-maps-gold/legacy-core.php:2212
|
623 |
msgid "Value between 0.1 and 1.0"
|
624 |
-
msgstr ""
|
625 |
|
626 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:325
|
627 |
#: ../../wp-google-maps-gold/legacy-core.php:2217
|
628 |
-
#, fuzzy
|
629 |
-
#| msgid "Line Thickness"
|
630 |
msgid "Near-Vicinity Line Thinkness"
|
631 |
-
msgstr "Grosor de
|
632 |
|
633 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:335
|
634 |
#: ../../wp-google-maps-gold/legacy-core.php:2219
|
635 |
msgid "Value between 1 and 50"
|
636 |
-
msgstr ""
|
637 |
|
638 |
#: ../../wp-google-maps-gold/includes/class.add-on.php:90
|
639 |
msgid ""
|
@@ -642,40 +632,47 @@ msgid ""
|
|
642 |
"have installed the latest version of WP Google Maps in order to use the Gold "
|
643 |
"add-on."
|
644 |
msgstr ""
|
|
|
|
|
|
|
|
|
645 |
|
646 |
#: ../../wp-google-maps-gold/includes/class.add-on.php:108
|
647 |
msgid ""
|
648 |
-
"<strong>WP Google Maps - Gold add-on:</strong> This plugin requires WP "
|
649 |
-
"
|
650 |
"installation. Please ensure you have installed and activated the Pro add-on "
|
651 |
"in order to use the Gold add-on."
|
652 |
msgstr ""
|
|
|
|
|
|
|
|
|
653 |
|
654 |
#: ../../wp-google-maps-gold/includes/class.live-tracker.php:51
|
655 |
msgid "Location Tracking"
|
656 |
-
msgstr ""
|
657 |
|
658 |
#: ../../wp-google-maps-gold/includes/class.marker-separator-settings.php:34
|
659 |
-
#, fuzzy
|
660 |
msgid "Requires WP Google Maps - Pro add-on Version 8"
|
661 |
-
msgstr "
|
662 |
|
663 |
#: ../../wp-google-maps-gold/includes/class.marker-separator-settings.php:107
|
664 |
-
#, fuzzy
|
665 |
msgid "Marker Separation"
|
666 |
-
msgstr "
|
667 |
|
668 |
#: ../../wp-google-maps-gold/includes/class.marker-separator-settings.php:113
|
669 |
msgid ""
|
670 |
"Looking for Near-Vicinity settings? See the new <a href=\"#tabs-marker-"
|
671 |
"separation\">Marker Separation</a> tab."
|
672 |
msgstr ""
|
|
|
|
|
673 |
|
674 |
#: ../../wp-google-maps-gold/legacy-core.php:66
|
675 |
#: ../../wp-google-maps-pro/legacy-core.php:4342 ../legacy-core.php:724
|
676 |
-
#, fuzzy
|
677 |
msgid "settings"
|
678 |
-
msgstr "
|
679 |
|
680 |
#: ../../wp-google-maps-gold/legacy-core.php:67
|
681 |
#: ../../wp-google-maps-pro/legacy-core.php:4343 ../legacy-core.php:725
|
@@ -684,12 +681,14 @@ msgid ""
|
|
684 |
"Your Google Maps API key has been successfully saved. This API key can be "
|
685 |
"changed in the %s page"
|
686 |
msgstr ""
|
|
|
|
|
687 |
|
688 |
#: ../../wp-google-maps-gold/legacy-core.php:568
|
689 |
#: ../../wp-google-maps-gold/legacy-core.php:707
|
690 |
#: ../../wp-google-maps-pro/legacy-core.php:4609
|
691 |
msgid "Geocode was not successful for the following reason"
|
692 |
-
msgstr "
|
693 |
|
694 |
#: ../../wp-google-maps-gold/legacy-core.php:1059
|
695 |
#: ../../wp-google-maps-gold/legacy-core.php:1221
|
@@ -713,9 +712,8 @@ msgstr "Activar soporte de Marcadores Masivos"
|
|
713 |
#: ../../wp-google-maps-gold/legacy-core.php:1496
|
714 |
#: ../../wp-google-maps-pro/includes/custom-fields/page.custom-fields.php:390
|
715 |
#: ../legacy-core.php:5353
|
716 |
-
#, fuzzy
|
717 |
msgid "Save"
|
718 |
-
msgstr "Guardar
|
719 |
|
720 |
#: ../../wp-google-maps-gold/legacy-core.php:1575
|
721 |
#: ../../wp-google-maps-pro/legacy-core.php:5073
|
@@ -737,13 +735,12 @@ msgstr "Ocurrió un error desconocido"
|
|
737 |
#: ../../wp-google-maps-gold/legacy-core.php:1642
|
738 |
#: ../../wp-google-maps-pro/legacy-core.php:6658 ../legacy-core.php:2279
|
739 |
msgid "Your settings have been saved."
|
740 |
-
msgstr "
|
741 |
|
742 |
#: ../../wp-google-maps-gold/legacy-core.php:1717
|
743 |
#: ../../wp-google-maps-gold/legacy-core.php:2364
|
744 |
-
#, fuzzy
|
745 |
msgid "Marker Clustering"
|
746 |
-
msgstr "
|
747 |
|
748 |
#: ../../wp-google-maps-gold/legacy-core.php:1747
|
749 |
#: ../../wp-google-maps-pro/legacy-core.php:1293
|
@@ -751,133 +748,130 @@ msgstr "Listado de Marcadores"
|
|
751 |
#: ../html/settings-page.html.php:25 ../includes/legacy/settings-page.php:480
|
752 |
#: ../legacy-core.php:3437
|
753 |
msgid "Advanced Settings"
|
754 |
-
msgstr "Configuración
|
755 |
|
756 |
#: ../../wp-google-maps-gold/legacy-core.php:1776
|
757 |
#: ../../wp-google-maps-gold/legacy-core.php:1779
|
758 |
#: ../../wp-google-maps-gold/legacy-core.php:1782
|
759 |
msgid "Real Time Location Tracking"
|
760 |
-
msgstr ""
|
761 |
|
762 |
#: ../../wp-google-maps-gold/legacy-core.php:1787
|
763 |
msgid ""
|
764 |
"Track your location via our app and plot your current location on a map, "
|
765 |
"publicly or privately."
|
766 |
msgstr ""
|
|
|
|
|
767 |
|
768 |
#: ../../wp-google-maps-gold/legacy-core.php:1796
|
769 |
#: ../../wp-google-maps-pro/html/add-map-dialog.html.php:46
|
770 |
#: ../../wp-google-maps-pro/includes/page.wizard.php:187
|
771 |
#: ../../wp-google-maps-pro/includes/page.wizard.php:227
|
772 |
#: ../../wp-google-maps-pro/includes/page.wizard.php:271
|
773 |
-
#, fuzzy
|
774 |
msgid "Create Map"
|
775 |
-
msgstr "Crear
|
776 |
|
777 |
#: ../../wp-google-maps-gold/legacy-core.php:1841
|
778 |
#, php-format
|
779 |
msgid "Location as at %1$s"
|
780 |
-
msgstr ""
|
781 |
|
782 |
#: ../../wp-google-maps-gold/legacy-core.php:1923
|
783 |
msgid "Successfully accepted the device. Thank you"
|
784 |
-
msgstr ""
|
785 |
|
786 |
#: ../../wp-google-maps-gold/legacy-core.php:1964
|
787 |
msgid "Device has been removed. Thank you"
|
788 |
-
msgstr ""
|
789 |
|
790 |
#: ../../wp-google-maps-gold/legacy-core.php:1985
|
791 |
-
#, fuzzy
|
792 |
msgid "Marker Data Cleared."
|
793 |
-
msgstr "
|
794 |
|
795 |
#: ../../wp-google-maps-gold/legacy-core.php:2022
|
796 |
msgid "A new device needs your approval to enable real time location tracking."
|
797 |
msgstr ""
|
|
|
|
|
798 |
|
799 |
#: ../../wp-google-maps-gold/legacy-core.php:2023
|
800 |
msgid "Device ID:"
|
801 |
-
msgstr ""
|
802 |
|
803 |
#: ../../wp-google-maps-gold/legacy-core.php:2024
|
804 |
#, php-format
|
805 |
msgid "To accept this device, Please follow this link: %1$s"
|
806 |
-
msgstr ""
|
807 |
|
808 |
#: ../../wp-google-maps-gold/legacy-core.php:2030
|
809 |
msgid "To reject the device, simply ignore this email."
|
810 |
msgstr ""
|
|
|
811 |
|
812 |
#: ../../wp-google-maps-gold/legacy-core.php:2031
|
813 |
msgid ""
|
814 |
"A new device needs your approval to enable real time location tracking - WP "
|
815 |
"Google Maps"
|
816 |
msgstr ""
|
|
|
|
|
817 |
|
818 |
#: ../../wp-google-maps-gold/legacy-core.php:2160
|
819 |
msgid "No devices"
|
820 |
-
msgstr ""
|
821 |
|
822 |
#: ../../wp-google-maps-gold/legacy-core.php:2191
|
823 |
msgid "Meters (This is an approximate value)"
|
824 |
-
msgstr ""
|
825 |
|
826 |
#: ../../wp-google-maps-gold/legacy-core.php:2427
|
827 |
-
#, fuzzy
|
828 |
-
#| msgid "Marker Listing Settings"
|
829 |
msgid "Marker Clustering - Advanced Settings"
|
830 |
-
msgstr "
|
831 |
|
832 |
#: ../../wp-google-maps-gold/legacy-core.php:2428
|
833 |
msgid "Changing these settings is only suggested for experienced users."
|
834 |
-
msgstr ""
|
835 |
|
836 |
#: ../../wp-google-maps-gold/legacy-core.php:2433
|
837 |
-
#, fuzzy
|
838 |
-
#| msgid "Enable Advanced Styling"
|
839 |
msgid "Enable Advanced Options"
|
840 |
-
msgstr "Activar
|
841 |
|
842 |
#: ../../wp-google-maps-gold/legacy-core.php:2444
|
843 |
-
#, fuzzy
|
844 |
-
#| msgid "show options"
|
845 |
msgid "Options"
|
846 |
-
msgstr "
|
847 |
|
848 |
#: ../../wp-google-maps-gold/legacy-core.php:2449
|
849 |
msgid "Grid Size"
|
850 |
-
msgstr ""
|
851 |
|
852 |
#: ../../wp-google-maps-gold/legacy-core.php:2454
|
853 |
-
#, fuzzy
|
854 |
msgid "Max Zoom"
|
855 |
-
msgstr "
|
856 |
|
857 |
#: ../../wp-google-maps-gold/legacy-core.php:2459
|
858 |
msgid "Minimum Cluster Size"
|
859 |
-
msgstr ""
|
860 |
|
861 |
#: ../../wp-google-maps-gold/legacy-core.php:2464
|
862 |
-
#, fuzzy
|
863 |
msgid "Cluster Font Color"
|
864 |
-
msgstr "Color de
|
865 |
|
866 |
#: ../../wp-google-maps-gold/legacy-core.php:2469
|
867 |
msgid "Cluster Font Size"
|
868 |
-
msgstr ""
|
869 |
|
870 |
#: ../../wp-google-maps-gold/legacy-core.php:2474
|
871 |
msgid "Zoom On Click"
|
872 |
-
msgstr ""
|
873 |
|
874 |
#: ../../wp-google-maps-gold/legacy-core.php:2485
|
875 |
msgid "Cluster Icons"
|
876 |
-
msgstr ""
|
877 |
|
878 |
#: ../../wp-google-maps-gold/legacy-core.php:2492
|
879 |
msgid "Level 1"
|
880 |
-
msgstr ""
|
881 |
|
882 |
#: ../../wp-google-maps-gold/legacy-core.php:2493
|
883 |
#: ../../wp-google-maps-gold/legacy-core.php:2502
|
@@ -885,7 +879,7 @@ msgstr ""
|
|
885 |
#: ../../wp-google-maps-gold/legacy-core.php:2520
|
886 |
#: ../../wp-google-maps-gold/legacy-core.php:2529
|
887 |
msgid "Change"
|
888 |
-
msgstr ""
|
889 |
|
890 |
#: ../../wp-google-maps-gold/legacy-core.php:2493
|
891 |
#: ../../wp-google-maps-gold/legacy-core.php:2502
|
@@ -896,7 +890,7 @@ msgstr ""
|
|
896 |
#: ../../wp-google-maps-pro/includes/custom-fields/class.custom-field-filter-widget.php:128
|
897 |
#: ../../wp-google-maps-pro/legacy-core.php:7513
|
898 |
msgid "Reset"
|
899 |
-
msgstr ""
|
900 |
|
901 |
#: ../../wp-google-maps-gold/legacy-core.php:2496
|
902 |
#: ../../wp-google-maps-gold/legacy-core.php:2505
|
@@ -922,63 +916,56 @@ msgstr "Alto"
|
|
922 |
|
923 |
#: ../../wp-google-maps-gold/legacy-core.php:2501
|
924 |
msgid "Level 2"
|
925 |
-
msgstr ""
|
926 |
|
927 |
#: ../../wp-google-maps-gold/legacy-core.php:2510
|
928 |
msgid "Level 3"
|
929 |
-
msgstr ""
|
930 |
|
931 |
#: ../../wp-google-maps-gold/legacy-core.php:2519
|
932 |
msgid "Level 4"
|
933 |
-
msgstr ""
|
934 |
|
935 |
#: ../../wp-google-maps-gold/legacy-core.php:2528
|
936 |
msgid "Level 5"
|
937 |
-
msgstr ""
|
938 |
|
939 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:23
|
940 |
-
#, fuzzy
|
941 |
msgid "WP Google Maps - KML Importer"
|
942 |
-
msgstr "WP Google Maps"
|
943 |
|
944 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:23
|
945 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:40
|
946 |
msgid "KML File Importer"
|
947 |
-
msgstr ""
|
948 |
|
949 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:48
|
950 |
msgid "KML File"
|
951 |
-
msgstr ""
|
952 |
|
953 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:50
|
954 |
msgid "Please select a KML or KMZ file to import"
|
955 |
-
msgstr ""
|
956 |
|
957 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:56
|
958 |
-
#, fuzzy
|
959 |
-
#| msgid "Assigned to "
|
960 |
msgid "Assigned Map"
|
961 |
-
msgstr "
|
962 |
|
963 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:71
|
964 |
msgid "No maps found. Please create a map "
|
965 |
-
msgstr ""
|
966 |
|
967 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:71
|
968 |
-
#, fuzzy
|
969 |
-
#| msgid "Linked maps"
|
970 |
msgid "new map"
|
971 |
-
msgstr "
|
972 |
|
973 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:71
|
974 |
msgid "before importing your KML/KMZ file"
|
975 |
-
msgstr ""
|
976 |
|
977 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:85
|
978 |
-
#, fuzzy
|
979 |
-
#| msgid "Assigned to "
|
980 |
msgid "Assigned Category"
|
981 |
-
msgstr "
|
982 |
|
983 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:97
|
984 |
#: ../../wp-google-maps-pro/html/map-edit-page/pro-marker-panel.html.php:125
|
@@ -1005,100 +992,102 @@ msgstr "Ninguno"
|
|
1005 |
|
1006 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:108
|
1007 |
msgid "No categories found. Please create a "
|
1008 |
-
msgstr ""
|
1009 |
|
1010 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:108
|
1011 |
-
#, fuzzy
|
1012 |
-
#| msgid "Save Category"
|
1013 |
msgid "new category"
|
1014 |
-
msgstr "
|
1015 |
|
1016 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:108
|
1017 |
msgid "should you wish to assign these markers to a category"
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: wpgmaps\n"
|
4 |
"POT-Creation-Date: 2020-02-11 09:59+0000\n"
|
5 |
+
"PO-Revision-Date: 2021-05-27 13:41+0200\n"
|
6 |
"Last-Translator: Yago Stecher <stecher@gmail.com>\n"
|
7 |
"Language-Team: \n"
|
8 |
+
"Language: es\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 2.0.4\n"
|
13 |
"X-Poedit-Basepath: .\n"
|
14 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
"X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html__\n"
|
19 |
"X-Poedit-SearchPath-3: ../../wp-google-maps-ugm\n"
|
20 |
|
21 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:4
|
|
|
|
|
22 |
msgid "Live Tracking Settings"
|
23 |
+
msgstr "Configuración de Seguimiento en Directo"
|
24 |
|
25 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:10
|
26 |
msgid "Please use the setting below to control Live Tracking broadcasting."
|
27 |
msgstr ""
|
28 |
+
"Por favor, utilice la configuración siguiente para controlar la transmisión "
|
29 |
+
"de la Ubicación en Directo."
|
30 |
|
31 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:16
|
32 |
msgid ""
|
34 |
"location and polyline routes, this setting enables visitors to your site to "
|
35 |
"receive your updated location as they view your pages."
|
36 |
msgstr ""
|
37 |
+
"Tenga en cuenta que esto no afecta la grabación: siempre puede grabar su "
|
38 |
+
"ubicación en tiempo real y de polilíneas de rutas, esta configuración permite "
|
39 |
+
"a los visitantes de su sitio recibir su ubicación actualizada conforme ven "
|
40 |
+
"sus páginas."
|
41 |
|
42 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:23
|
|
|
|
|
43 |
msgid "Enable Broadcasting"
|
44 |
+
msgstr "Habilitar la transmisión"
|
45 |
|
46 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:34
|
47 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:27
|
94 |
#: ../legacy-core.php:3775 ../legacy-core.php:3824 ../legacy-core.php:3853
|
95 |
#: ../legacy-core.php:3857 ../legacy-core.php:4183 ../legacy-core.php:4238
|
96 |
msgid "Yes"
|
97 |
+
msgstr "Sí"
|
98 |
|
99 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:35
|
100 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:28
|
153 |
|
154 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:42
|
155 |
msgid "Live Tracking Devices"
|
156 |
+
msgstr "Dispositivos de Seguimiento en Tiempo Real"
|
157 |
|
158 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:50
|
159 |
msgid ""
|
160 |
"Devices which have attempted to pair with your site will appear here. You "
|
161 |
"must approve devices before they will appear on the map."
|
162 |
msgstr ""
|
163 |
+
"Los dispositivos que han intentado emparejarse con su sitio aparecerán aquí. "
|
164 |
+
"Debe aprobar los dispositivos para que aparezcan en el mapa."
|
165 |
|
166 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:59
|
167 |
msgid "Device ID"
|
168 |
+
msgstr "ID de dispositivo"
|
169 |
|
170 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:64
|
171 |
#: ../../wp-google-maps-pro/includes/custom-fields/page.custom-fields.php:107
|
191 |
msgstr "Nombre"
|
192 |
|
193 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:69
|
|
|
|
|
194 |
msgid "Draw Polylines"
|
195 |
+
msgstr "Dibujar polilíneas"
|
196 |
|
197 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:74
|
|
|
|
|
198 |
msgid "Line Color and Weight"
|
199 |
+
msgstr "Color y grosor de línea"
|
200 |
|
201 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:79
|
202 |
msgid "Approved"
|
203 |
+
msgstr "Aprobado"
|
204 |
|
205 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:106
|
206 |
#: ../legacy-core.php:526 ../legacy-core.php:2684
|
209 |
|
210 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:113
|
211 |
msgid "New Polyline Distance Threshold (meters)"
|
212 |
+
msgstr "Nuevo umbral de distancia de polilínea (metros)"
|
213 |
|
214 |
#: ../../wp-google-maps-gold/html/live-tracking-settings-panel.html.php:122
|
215 |
msgid "New Polyline Time Threshold (minutes)"
|
216 |
+
msgstr "Nuevo umbral de tiempo de polilínea (minutos)"
|
217 |
|
218 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:5
|
219 |
#: ../../wp-google-maps-gold/includes/class.marker-rating.php:207
|
|
|
|
|
220 |
msgid "Marker Ratings"
|
221 |
+
msgstr "Calificaciones de marcador"
|
222 |
|
223 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:12
|
224 |
msgid "Minimum Rating"
|
225 |
+
msgstr "Calificación mínima"
|
226 |
|
227 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:21
|
228 |
msgid "Maximum Rating"
|
229 |
+
msgstr "Calificación máxima"
|
230 |
|
231 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:30
|
232 |
msgid ""
|
233 |
"Please note that changing these settings will not scale ratings which have "
|
234 |
"already been recorded."
|
235 |
msgstr ""
|
236 |
+
"Tenga en cuenta que cambiar esta configuración no escalará las calificaciones "
|
237 |
+
"que ya se hayan registrado."
|
238 |
|
239 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:34
|
240 |
msgid ""
|
241 |
"We recommend that you do not modify the maximum and minimum settings after "
|
242 |
"you begin accepting ratings."
|
243 |
msgstr ""
|
244 |
+
"Le recomendamos que no modifique la configuración máxima y mínima después de "
|
245 |
+
"comenzar a aceptar calificaciones."
|
246 |
|
247 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:41
|
|
|
|
|
248 |
msgid "Example range settings:"
|
249 |
+
msgstr "Ejemplo de configuración de rango:"
|
250 |
|
251 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:46
|
252 |
msgid "1 - 5 :- Traditional One to Five Stars"
|
253 |
+
msgstr "1 - 5: Tradicional \"de una a cinco\" estrellas"
|
254 |
|
255 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:51
|
256 |
msgid "0 - 100 :- Percentage Rating"
|
257 |
+
msgstr "0 - 100: Calificación porcentual"
|
258 |
|
259 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:56
|
260 |
msgid "0 - 1 :- Like / Dislike, or Upvote / Downvote"
|
261 |
+
msgstr "0-1: Me gusta / No me gusta, o Votar a favor / en contra"
|
262 |
|
263 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:68
|
264 |
msgid "Rating Step"
|
265 |
+
msgstr "Paso de calificación"
|
266 |
|
267 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:77
|
268 |
msgid "The \"Stars\" widget style does not currently support \"Step\""
|
269 |
msgstr ""
|
270 |
+
"Actualmente, el estilo del widget \"Estrellas\" no es compatible con \"Paso\"."
|
271 |
|
272 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:84
|
|
|
|
|
273 |
msgid "Example step settings:"
|
274 |
+
msgstr "Ejemplo de configuración de paso:"
|
275 |
|
276 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:89
|
277 |
msgid "0.01 :- Allow decimal / floating point ratings"
|
278 |
+
msgstr "0.01: Permitir calificaciones de coma decimal / flotante"
|
279 |
|
280 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:94
|
281 |
msgid "1 :- Whole number ratings only"
|
282 |
+
msgstr "1: Solo calificaciones de números enteros"
|
283 |
|
284 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:99
|
285 |
msgid "5 :- Round to nearest five (eg for percentage ratings)"
|
286 |
msgstr ""
|
287 |
+
"5: Redondea al cinco más cercano (por ejemplo, para índices de porcentaje)"
|
288 |
|
289 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:110
|
290 |
msgid "Widget Style"
|
291 |
+
msgstr "Estilo de widget"
|
292 |
|
293 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:126
|
294 |
msgid "Bar rating gradient colours:"
|
295 |
+
msgstr "Colores de degradado de la barra de calificación:"
|
296 |
|
297 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:131
|
298 |
msgid "Start -"
|
299 |
+
msgstr "Inicio -"
|
300 |
|
301 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:136
|
302 |
msgid "End -"
|
303 |
+
msgstr "Fin -"
|
304 |
|
305 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:153
|
306 |
msgid "Background color:"
|
307 |
+
msgstr "Color de fondo:"
|
308 |
|
309 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:167
|
310 |
msgid "Tampering Countermeasures"
|
311 |
+
msgstr "Contramedidas de manipulación"
|
312 |
|
313 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:175
|
|
|
314 |
msgid "Basic Only"
|
315 |
+
msgstr "Solo básico"
|
316 |
|
317 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:180
|
318 |
msgid ""
|
319 |
+
"Uses basic client side countermeasures. This is easily circumvented by anyone "
|
320 |
+
"with technical knowledge, and is vulnerable to bots."
|
321 |
msgstr ""
|
322 |
+
"Utiliza contramedidas básicas del lado del cliente. Cualquier persona con "
|
323 |
+
"conocimientos técnicos puede eludirlo fácilmente, y es vulnerable a los "
|
324 |
+
"robots."
|
325 |
|
326 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:184
|
327 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:204
|
329 |
"This method is not reliable for preventing tampering, and is not recommended "
|
330 |
"for use cases where reliability is imperative."
|
331 |
msgstr ""
|
332 |
+
"Este método no es confiable para prevenir la manipulación y no se recomienda "
|
333 |
+
"para casos de uso en los que la confiabilidad es imperativa."
|
334 |
|
335 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:195
|
336 |
msgid "Anti-Spam"
|
337 |
+
msgstr "Anti-Spam"
|
338 |
|
339 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:200
|
340 |
msgid ""
|
342 |
"can be circumvented with human interaction, but is significantly less "
|
343 |
"vulnerable to bots."
|
344 |
msgstr ""
|
345 |
+
"Utiliza contramedidas contra el correo no deseado y contramedidas básicas del "
|
346 |
+
"lado del servidor. Esto se puede interferir con la interacción humana, pero "
|
347 |
+
"es significativamente menos vulnerable a los robots."
|
348 |
|
349 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:215
|
350 |
msgid "Require Account"
|
351 |
+
msgstr "Requerir registrarse"
|
352 |
|
353 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:220
|
354 |
msgid ""
|
355 |
"This method uses the same countermeasures as Basic Only, however it does "
|
356 |
"require that in order to leave a rating, the user must be logged in."
|
357 |
msgstr ""
|
358 |
+
"Este método utiliza las mismas contramedidas que 'Solo Básico', sin embargo "
|
359 |
+
"requiere iniciar sesión para dejar una calificación."
|
360 |
|
361 |
#: ../../wp-google-maps-gold/html/marker-rating-settings.html.php:224
|
362 |
msgid ""
|
364 |
"can compliment this by using security methods (eg 3rd party plugins) to "
|
365 |
"prevent fake accounts."
|
366 |
msgstr ""
|
367 |
+
"Este método requiere iniciar sesión y asocia las calificaciones con una "
|
368 |
+
"cuenta de usuario. Puede complementar esto utilizando métodos de seguridad "
|
369 |
+
"(por ejemplo, complementos de terceros) para evitar cuentas falsas."
|
370 |
|
371 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:2
|
372 |
#: ../../wp-google-maps-gold/legacy-core.php:2179
|
|
|
373 |
msgid "Near-Vicinity Marker Control Settings"
|
374 |
+
msgstr "Configuración de control de Marcadores en las Cercanías"
|
375 |
|
376 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:6
|
377 |
msgid ""
|
381 |
"several markers at the same address but would like the user to be able to "
|
382 |
"view data from all the markers."
|
383 |
msgstr ""
|
384 |
+
"Esta función agrupará los marcadores cercanos o superpuestos mediante un "
|
385 |
+
"único marcador de posición. Cuando se hace clic en el marcador de posición, "
|
386 |
+
"el grupo se abre separando los marcadores en la pantalla. Esto está diseñado "
|
387 |
+
"para cuando tiene varios marcadores en la misma dirección, pero le gustaría "
|
388 |
+
"que el usuario pudiera ver los datos de todos los marcadores."
|
389 |
|
390 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:14
|
391 |
#: ../../wp-google-maps-gold/legacy-core.php:2182
|
392 |
msgid "Enable Near-Vicinity Marker Control"
|
393 |
+
msgstr "Habilitar el control de Marcadores en las cercanías"
|
394 |
|
395 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:36
|
396 |
#: ../../wp-google-maps-gold/legacy-core.php:2189
|
397 |
msgid "Near-Vicinity Affected Radius"
|
398 |
+
msgstr "Radio afectado de Marcadores en las Cercanías"
|
399 |
|
400 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:50
|
|
|
|
|
401 |
msgid "Meters"
|
402 |
+
msgstr "Metros"
|
403 |
|
404 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:56
|
405 |
msgid "Markers within this threshold of one another will be grouped together"
|
406 |
+
msgstr "Los marcadores dentro de este umbral entre sí se agruparán siempre"
|
407 |
|
408 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:66
|
409 |
msgid "Use Legacy Near-Vicinity Module"
|
410 |
+
msgstr "Utilice el módulo heredado de Marcadores en las cercanías"
|
411 |
|
412 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:88
|
|
|
|
|
413 |
msgid "Placeholder Marker"
|
414 |
+
msgstr "Marcador de grupo de marcadores de posición"
|
415 |
|
416 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:100
|
417 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:254
|
418 |
#: ../../wp-google-maps-gold/legacy-core.php:2224
|
419 |
msgid "Near-Vicinity Shape"
|
420 |
+
msgstr "Figura de Marcadores en las Cercanías"
|
421 |
|
422 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:106
|
423 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:268
|
424 |
#: ../../wp-google-maps-gold/legacy-core.php:2226
|
425 |
msgid "Circle"
|
426 |
+
msgstr "Círculo"
|
427 |
|
428 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:109
|
429 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:267
|
430 |
#: ../../wp-google-maps-gold/legacy-core.php:2226
|
431 |
msgid "Spiral"
|
432 |
+
msgstr "Espiral"
|
433 |
|
434 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:112
|
435 |
msgid "Hexagon"
|
436 |
+
msgstr "Hexágono"
|
437 |
|
438 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:115
|
439 |
msgid "Line"
|
440 |
+
msgstr "Línea"
|
441 |
|
442 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:118
|
443 |
#: ../../wp-google-maps-pro/legacy-core.php:962
|
444 |
#: ../../wp-google-maps-pro/legacy-core.php:2198
|
445 |
#: ../../wp-google-maps-pro/legacy-core.php:2242
|
446 |
msgid "Grid"
|
447 |
+
msgstr "Cuadrícula"
|
448 |
|
449 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:127
|
|
|
|
|
450 |
msgid "Animate Separation"
|
451 |
+
msgstr "Retardo entre animaciones"
|
452 |
|
453 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:148
|
|
|
|
|
454 |
msgid "Animation Duration"
|
455 |
+
msgstr "Duración de la animación"
|
456 |
|
457 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:160
|
458 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:245
|
459 |
msgid "Seconds"
|
460 |
+
msgstr "Segundos"
|
461 |
|
462 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:169
|
|
|
|
|
463 |
msgid "Animation Easing"
|
464 |
+
msgstr "Mitigar animación"
|
465 |
|
466 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:174
|
|
|
467 |
msgid "Linear"
|
468 |
+
msgstr "Lineal"
|
469 |
|
470 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:175
|
471 |
msgid "Sine In"
|
472 |
msgstr ""
|
473 |
|
474 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:176
|
|
|
|
|
475 |
msgid "Sine Out"
|
476 |
+
msgstr ""
|
477 |
|
478 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:177
|
479 |
msgid "Sine In & Out"
|
540 |
msgstr ""
|
541 |
|
542 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:193
|
|
|
543 |
msgid "Circular In"
|
544 |
+
msgstr ""
|
545 |
|
546 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:194
|
547 |
msgid "Circular Out"
|
576 |
msgstr ""
|
577 |
|
578 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:202
|
|
|
|
|
579 |
msgid "Bounce In"
|
580 |
+
msgstr ""
|
581 |
|
582 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:203
|
|
|
|
|
583 |
msgid "Bounce Out"
|
584 |
+
msgstr ""
|
585 |
|
586 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:204
|
587 |
msgid "Bounce In & Out"
|
588 |
msgstr ""
|
589 |
|
590 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:212
|
|
|
|
|
591 |
msgid "Stagger Animation"
|
592 |
+
msgstr "Animación escalonada"
|
593 |
|
594 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:233
|
595 |
msgid "Stagger Interval"
|
596 |
+
msgstr "Intervalo de escalonamiento"
|
597 |
|
598 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:275
|
599 |
#: ../../wp-google-maps-gold/legacy-core.php:2196
|
600 |
msgid "Near-Vicinity Hide Lines"
|
601 |
+
msgstr "Ocultar líneas de Marcadores en las Cercanías"
|
602 |
|
603 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:295
|
604 |
#: ../../wp-google-maps-gold/legacy-core.php:2203
|
|
|
|
|
605 |
msgid "Near-Vicinity Line Color"
|
606 |
+
msgstr "Color de línea de Marcadores en las Cercanías"
|
607 |
|
608 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:308
|
609 |
#: ../../wp-google-maps-gold/legacy-core.php:2210
|
|
|
|
|
610 |
msgid "Near-Vicinity Line Opacity"
|
611 |
+
msgstr "Opacidad de línea de Marcadores en las Cercanías"
|
612 |
|
613 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:319
|
614 |
#: ../../wp-google-maps-gold/legacy-core.php:2212
|
615 |
msgid "Value between 0.1 and 1.0"
|
616 |
+
msgstr "Valor entre 0.1 y 1.0"
|
617 |
|
618 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:325
|
619 |
#: ../../wp-google-maps-gold/legacy-core.php:2217
|
|
|
|
|
620 |
msgid "Near-Vicinity Line Thinkness"
|
621 |
+
msgstr "Grosor de línea de Marcadores en las Cercanías"
|
622 |
|
623 |
#: ../../wp-google-maps-gold/html/marker-separator-settings.html.php:335
|
624 |
#: ../../wp-google-maps-gold/legacy-core.php:2219
|
625 |
msgid "Value between 1 and 50"
|
626 |
+
msgstr "Valor entre 1 y 50"
|
627 |
|
628 |
#: ../../wp-google-maps-gold/includes/class.add-on.php:90
|
629 |
msgid ""
|
632 |
"have installed the latest version of WP Google Maps in order to use the Gold "
|
633 |
"add-on."
|
634 |
msgstr ""
|
635 |
+
"<strong>Complemento Gold de WP Google Maps:</strong> no detectamos una "
|
636 |
+
"versión compatible de WP Google Maps ejecutándose en esta instalación. "
|
637 |
+
"Asegúrese de haber instalado la última versión de WP Google Maps para "
|
638 |
+
"utilizar el complemento Gold."
|
639 |
|
640 |
#: ../../wp-google-maps-gold/includes/class.add-on.php:108
|
641 |
msgid ""
|
642 |
+
"<strong>WP Google Maps - Gold add-on:</strong> This plugin requires WP Google "
|
643 |
+
"Maps - Pro add-on. We did not detect the Pro add-on running on this "
|
644 |
"installation. Please ensure you have installed and activated the Pro add-on "
|
645 |
"in order to use the Gold add-on."
|
646 |
msgstr ""
|
647 |
+
"<strong>Complemento Gold de WP Google Maps:</strong> este complemento "
|
648 |
+
"requiere el complemento Pro de WP Google Maps. No detectamos el complemento "
|
649 |
+
"Pro ejecutándose en esta instalación. Asegúrese de haber instalado y activado "
|
650 |
+
"el complemento Pro para poder utilizar el complemento Gold."
|
651 |
|
652 |
#: ../../wp-google-maps-gold/includes/class.live-tracker.php:51
|
653 |
msgid "Location Tracking"
|
654 |
+
msgstr "Seguimiento de ubicación"
|
655 |
|
656 |
#: ../../wp-google-maps-gold/includes/class.marker-separator-settings.php:34
|
|
|
657 |
msgid "Requires WP Google Maps - Pro add-on Version 8"
|
658 |
+
msgstr "Requiere la versión 8 del complemento Pro de WP Google Maps"
|
659 |
|
660 |
#: ../../wp-google-maps-gold/includes/class.marker-separator-settings.php:107
|
|
|
661 |
msgid "Marker Separation"
|
662 |
+
msgstr "Separación de marcadores"
|
663 |
|
664 |
#: ../../wp-google-maps-gold/includes/class.marker-separator-settings.php:113
|
665 |
msgid ""
|
666 |
"Looking for Near-Vicinity settings? See the new <a href=\"#tabs-marker-"
|
667 |
"separation\">Marker Separation</a> tab."
|
668 |
msgstr ""
|
669 |
+
"¿Buscando la configuración de Marcadores en las Cercanías? Consulte la nueva "
|
670 |
+
"pestaña <a href=\"#tabs-marker-separation\">Marker Separation</a>."
|
671 |
|
672 |
#: ../../wp-google-maps-gold/legacy-core.php:66
|
673 |
#: ../../wp-google-maps-pro/legacy-core.php:4342 ../legacy-core.php:724
|
|
|
674 |
msgid "settings"
|
675 |
+
msgstr "configuración"
|
676 |
|
677 |
#: ../../wp-google-maps-gold/legacy-core.php:67
|
678 |
#: ../../wp-google-maps-pro/legacy-core.php:4343 ../legacy-core.php:725
|
681 |
"Your Google Maps API key has been successfully saved. This API key can be "
|
682 |
"changed in the %s page"
|
683 |
msgstr ""
|
684 |
+
"Su clave de API de Google Maps ha sido guardada con éxito. La clave de API "
|
685 |
+
"puede cambiarse en la página %s"
|
686 |
|
687 |
#: ../../wp-google-maps-gold/legacy-core.php:568
|
688 |
#: ../../wp-google-maps-gold/legacy-core.php:707
|
689 |
#: ../../wp-google-maps-pro/legacy-core.php:4609
|
690 |
msgid "Geocode was not successful for the following reason"
|
691 |
+
msgstr "La geo codificación no tuvo éxito por la siguiente razón"
|
692 |
|
693 |
#: ../../wp-google-maps-gold/legacy-core.php:1059
|
694 |
#: ../../wp-google-maps-gold/legacy-core.php:1221
|
712 |
#: ../../wp-google-maps-gold/legacy-core.php:1496
|
713 |
#: ../../wp-google-maps-pro/includes/custom-fields/page.custom-fields.php:390
|
714 |
#: ../legacy-core.php:5353
|
|
|
715 |
msgid "Save"
|
716 |
+
msgstr "Guardar"
|
717 |
|
718 |
#: ../../wp-google-maps-gold/legacy-core.php:1575
|
719 |
#: ../../wp-google-maps-pro/legacy-core.php:5073
|
735 |
#: ../../wp-google-maps-gold/legacy-core.php:1642
|
736 |
#: ../../wp-google-maps-pro/legacy-core.php:6658 ../legacy-core.php:2279
|
737 |
msgid "Your settings have been saved."
|
738 |
+
msgstr "Tu configuración se ha guardado."
|
739 |
|
740 |
#: ../../wp-google-maps-gold/legacy-core.php:1717
|
741 |
#: ../../wp-google-maps-gold/legacy-core.php:2364
|
|
|
742 |
msgid "Marker Clustering"
|
743 |
+
msgstr "Agrupación de marcadores"
|
744 |
|
745 |
#: ../../wp-google-maps-gold/legacy-core.php:1747
|
746 |
#: ../../wp-google-maps-pro/legacy-core.php:1293
|
748 |
#: ../html/settings-page.html.php:25 ../includes/legacy/settings-page.php:480
|
749 |
#: ../legacy-core.php:3437
|
750 |
msgid "Advanced Settings"
|
751 |
+
msgstr "Configuración avanzada"
|
752 |
|
753 |
#: ../../wp-google-maps-gold/legacy-core.php:1776
|
754 |
#: ../../wp-google-maps-gold/legacy-core.php:1779
|
755 |
#: ../../wp-google-maps-gold/legacy-core.php:1782
|
756 |
msgid "Real Time Location Tracking"
|
757 |
+
msgstr "Seguimiento de Ubicación en tiempo real"
|
758 |
|
759 |
#: ../../wp-google-maps-gold/legacy-core.php:1787
|
760 |
msgid ""
|
761 |
"Track your location via our app and plot your current location on a map, "
|
762 |
"publicly or privately."
|
763 |
msgstr ""
|
764 |
+
"Rastree su ubicación a través de nuestra aplicación y trace su ubicación "
|
765 |
+
"actual en un mapa, de forma pública o privada."
|
766 |
|
767 |
#: ../../wp-google-maps-gold/legacy-core.php:1796
|
768 |
#: ../../wp-google-maps-pro/html/add-map-dialog.html.php:46
|
769 |
#: ../../wp-google-maps-pro/includes/page.wizard.php:187
|
770 |
#: ../../wp-google-maps-pro/includes/page.wizard.php:227
|
771 |
#: ../../wp-google-maps-pro/includes/page.wizard.php:271
|
|
|
772 |
msgid "Create Map"
|
773 |
+
msgstr "Crear mapa"
|
774 |
|
775 |
#: ../../wp-google-maps-gold/legacy-core.php:1841
|
776 |
#, php-format
|
777 |
msgid "Location as at %1$s"
|
778 |
+
msgstr "Ubicación en %1$s"
|
779 |
|
780 |
#: ../../wp-google-maps-gold/legacy-core.php:1923
|
781 |
msgid "Successfully accepted the device. Thank you"
|
782 |
+
msgstr "El dispositivo ha sido aceptado. Gracias"
|
783 |
|
784 |
#: ../../wp-google-maps-gold/legacy-core.php:1964
|
785 |
msgid "Device has been removed. Thank you"
|
786 |
+
msgstr "El dispositivo ha sido borrado. Gracias"
|
787 |
|
788 |
#: ../../wp-google-maps-gold/legacy-core.php:1985
|
|
|
789 |
msgid "Marker Data Cleared."
|
790 |
+
msgstr "Datos de marcador borrados."
|
791 |
|
792 |
#: ../../wp-google-maps-gold/legacy-core.php:2022
|
793 |
msgid "A new device needs your approval to enable real time location tracking."
|
794 |
msgstr ""
|
795 |
+
"Un nuevo dispositivo necesita su aprobación para permitir el Seguimiento de "
|
796 |
+
"Ubicación en tiempo real."
|
797 |
|
798 |
#: ../../wp-google-maps-gold/legacy-core.php:2023
|
799 |
msgid "Device ID:"
|
800 |
+
msgstr "Identificador de dispositivo:"
|
801 |
|
802 |
#: ../../wp-google-maps-gold/legacy-core.php:2024
|
803 |
#, php-format
|
804 |
msgid "To accept this device, Please follow this link: %1$s"
|
805 |
+
msgstr "Para aceptar este dispositivo, por favor, siga este enlace: %1$s"
|
806 |
|
807 |
#: ../../wp-google-maps-gold/legacy-core.php:2030
|
808 |
msgid "To reject the device, simply ignore this email."
|
809 |
msgstr ""
|
810 |
+
"Para rechazar este dispositivo, simplemente ignore este correo electrónico."
|
811 |
|
812 |
#: ../../wp-google-maps-gold/legacy-core.php:2031
|
813 |
msgid ""
|
814 |
"A new device needs your approval to enable real time location tracking - WP "
|
815 |
"Google Maps"
|
816 |
msgstr ""
|
817 |
+
"Un dispositivo nuevo necesita su aprobación para Seguimiento de Ubicación en "
|
818 |
+
"tiempo real - WP Google Maps"
|
819 |
|
820 |
#: ../../wp-google-maps-gold/legacy-core.php:2160
|
821 |
msgid "No devices"
|
822 |
+
msgstr "No hay dispositivos"
|
823 |
|
824 |
#: ../../wp-google-maps-gold/legacy-core.php:2191
|
825 |
msgid "Meters (This is an approximate value)"
|
826 |
+
msgstr "Metros (valor aproximado)"
|
827 |
|
828 |
#: ../../wp-google-maps-gold/legacy-core.php:2427
|
|
|
|
|
829 |
msgid "Marker Clustering - Advanced Settings"
|
830 |
+
msgstr "Agrupación de marcadores: configuración avanzada"
|
831 |
|
832 |
#: ../../wp-google-maps-gold/legacy-core.php:2428
|
833 |
msgid "Changing these settings is only suggested for experienced users."
|
834 |
+
msgstr "Cambiar esta configuración solo se recomienda a usuarios avanzados."
|
835 |
|
836 |
#: ../../wp-google-maps-gold/legacy-core.php:2433
|
|
|
|
|
837 |
msgid "Enable Advanced Options"
|
838 |
+
msgstr "Activar Opciones Avanzadas"
|
839 |
|
840 |
#: ../../wp-google-maps-gold/legacy-core.php:2444
|
|
|
|
|
841 |
msgid "Options"
|
842 |
+
msgstr "Opciones"
|
843 |
|
844 |
#: ../../wp-google-maps-gold/legacy-core.php:2449
|
845 |
msgid "Grid Size"
|
846 |
+
msgstr "Tamaño de la cuadrícula"
|
847 |
|
848 |
#: ../../wp-google-maps-gold/legacy-core.php:2454
|
|
|
849 |
msgid "Max Zoom"
|
850 |
+
msgstr "Zoom máximo"
|
851 |
|
852 |
#: ../../wp-google-maps-gold/legacy-core.php:2459
|
853 |
msgid "Minimum Cluster Size"
|
854 |
+
msgstr "Tamaño mínimo de la agrupación"
|
855 |
|
856 |
#: ../../wp-google-maps-gold/legacy-core.php:2464
|
|
|
857 |
msgid "Cluster Font Color"
|
858 |
+
msgstr "Color de texto de la agrupación"
|
859 |
|
860 |
#: ../../wp-google-maps-gold/legacy-core.php:2469
|
861 |
msgid "Cluster Font Size"
|
862 |
+
msgstr "Tamaño de texto de la agrupación"
|
863 |
|
864 |
#: ../../wp-google-maps-gold/legacy-core.php:2474
|
865 |
msgid "Zoom On Click"
|
866 |
+
msgstr "Zoom al hacer click"
|
867 |
|
868 |
#: ../../wp-google-maps-gold/legacy-core.php:2485
|
869 |
msgid "Cluster Icons"
|
870 |
+
msgstr "Iconos de agrupación"
|
871 |
|
872 |
#: ../../wp-google-maps-gold/legacy-core.php:2492
|
873 |
msgid "Level 1"
|
874 |
+
msgstr "Nivel 1"
|
875 |
|
876 |
#: ../../wp-google-maps-gold/legacy-core.php:2493
|
877 |
#: ../../wp-google-maps-gold/legacy-core.php:2502
|
879 |
#: ../../wp-google-maps-gold/legacy-core.php:2520
|
880 |
#: ../../wp-google-maps-gold/legacy-core.php:2529
|
881 |
msgid "Change"
|
882 |
+
msgstr "Cambiar"
|
883 |
|
884 |
#: ../../wp-google-maps-gold/legacy-core.php:2493
|
885 |
#: ../../wp-google-maps-gold/legacy-core.php:2502
|
890 |
#: ../../wp-google-maps-pro/includes/custom-fields/class.custom-field-filter-widget.php:128
|
891 |
#: ../../wp-google-maps-pro/legacy-core.php:7513
|
892 |
msgid "Reset"
|
893 |
+
msgstr "Resetear"
|
894 |
|
895 |
#: ../../wp-google-maps-gold/legacy-core.php:2496
|
896 |
#: ../../wp-google-maps-gold/legacy-core.php:2505
|
916 |
|
917 |
#: ../../wp-google-maps-gold/legacy-core.php:2501
|
918 |
msgid "Level 2"
|
919 |
+
msgstr "Nivel 2"
|
920 |
|
921 |
#: ../../wp-google-maps-gold/legacy-core.php:2510
|
922 |
msgid "Level 3"
|
923 |
+
msgstr "Nivel 3"
|
924 |
|
925 |
#: ../../wp-google-maps-gold/legacy-core.php:2519
|
926 |
msgid "Level 4"
|
927 |
+
msgstr "Nivel 4"
|
928 |
|
929 |
#: ../../wp-google-maps-gold/legacy-core.php:2528
|
930 |
msgid "Level 5"
|
931 |
+
msgstr "Nivel 5"
|
932 |
|
933 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:23
|
|
|
934 |
msgid "WP Google Maps - KML Importer"
|
935 |
+
msgstr "WP Google Maps - Importación de KML"
|
936 |
|
937 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:23
|
938 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:40
|
939 |
msgid "KML File Importer"
|
940 |
+
msgstr "Importar archivo KML"
|
941 |
|
942 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:48
|
943 |
msgid "KML File"
|
944 |
+
msgstr "Archivo KML"
|
945 |
|
946 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:50
|
947 |
msgid "Please select a KML or KMZ file to import"
|
948 |
+
msgstr "Por favor, selecccione un archivo KML o KMZ para importar"
|
949 |
|
950 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:56
|
|
|
|
|
951 |
msgid "Assigned Map"
|
952 |
+
msgstr "Mapa asignado"
|
953 |
|
954 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:71
|
955 |
msgid "No maps found. Please create a map "
|
956 |
+
msgstr "No hay mapas. Por favor, cree un mapa "
|
957 |
|
958 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:71
|
|
|
|
|
959 |
msgid "new map"
|
960 |
+
msgstr "nuevo mapa"
|
961 |
|
962 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:71
|
963 |
msgid "before importing your KML/KMZ file"
|
964 |
+
msgstr "antes de importar el archivo KML/KMZ"
|
965 |
|
966 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:85
|
|
|
|
|
967 |
msgid "Assigned Category"
|
968 |
+
msgstr "Categoría asignada"
|
969 |
|
970 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:97
|
971 |
#: ../../wp-google-maps-pro/html/map-edit-page/pro-marker-panel.html.php:125
|
992 |
|
993 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:108
|
994 |
msgid "No categories found. Please create a "
|
995 |
+
msgstr "No hay categorías. Por favor, cree una "
|
996 |
|
997 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:108
|
|
|
|
|
998 |
msgid "new category"
|
999 |
+
msgstr "nueva categoría"
|
1000 |
|
1001 |
#: ../../wp-google-maps-gold/modules/wp-google-maps-kml-importer.php:108
|
1002 |
msgid "should you wish to assign these markers to a category"
|