From bdddec7437a619669b20518993df1affcb7fdd8d Mon Sep 17 00:00:00 2001 From: Kiran Prajapati Date: Tue, 17 Oct 2023 12:17:53 +0530 Subject: [PATCH] Declare JS variables --- templates/bootstrap/map/map-add-listing.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/bootstrap/map/map-add-listing.php b/templates/bootstrap/map/map-add-listing.php index 66f43e53..c0ec2023 100644 --- a/templates/bootstrap/map/map-add-listing.php +++ b/templates/bootstrap/map/map-add-listing.php @@ -95,13 +95,13 @@ } window.gdMaps = window.gdMaps || gdMaps; - user_address = false; + var user_address = false; jQuery('#').on("keypress",function () { user_address = true; }); - baseMarker = ''; - geocoder = ''; + var baseMarker = ''; + var geocoder = ''; var CITY_MAP_CENTER_LAT = ; var CITY_MAP_CENTER_LNG = ; @@ -818,7 +818,7 @@ function geocodeResponseOSM(response, updateMap) { if (window.gdMaps) { geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : []; - icon = '';iconW = parseFloat('');iconH = parseFloat(''); + var icon = '';var iconW = parseFloat('');var iconH = parseFloat(''); iconMW=geodir_params.marker_max_width?parseFloat(geodir_params.marker_max_width):0;iconMH=geodir_params.marker_max_height?parseFloat(geodir_params.marker_max_height):0;if(geodir_params.resize_marker&&(iconW5&&iconH>5&&(iconMW>5&&iconW>iconMW||iconMH>5&&iconH>iconMH)){resizeW=iconW;resizeH=iconH;resize=false;if(iconMH>5&&resizeH>iconMH){_resizeH=iconMH;_resizeW=Math.round(_resizeH*resizeW/resizeH*10)/10;resizeW=_resizeW;resizeH=_resizeH;resize=true}if(iconMW>5&&resizeW>iconMW){_resizeW=iconMW;_resizeH=Math.round(_resizeW*resizeH/resizeW*10)/10;resizeW=_resizeW;resizeH=_resizeH;resize=true}if(resize&&resizeW>5&&resizeH>5){if(window.gdMaps=='google'){icon={url:icon,scaledSize:new google.maps.Size(resizeW,resizeH),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(Math.round(resizeW/2),resizeH)}}else{iconW=resizeW;iconH=resizeH}}} baseMarker = $.goMap.createMarker({ latitude: CITY_MAP_CENTER_LAT,