<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Map</name><description>Show an address on a Map</description><help><![CDATA[
			To choose the address, put the name of the place in the address field.&lt;br&gt; You can adjust the place of the marker by dragging and dropping it.&lt;br&gt; You may add a message which will be displayed to visitors.&lt;br&gt; Adjust the zoom and the position of the map - it will be displayed as it is to your visitors.
]]></help><api_version>1.0</api_version><size height='400' width='400' /><blog en='22' /></metadata><view><content></content><properties><hidden default='&apos;&apos;' name='message' /><select class='uim_version' default='&apos;a&apos;' display='Address|Custom Map|Hotels &amp;amp; AirBnb|Old mode' name='map_version' title='Map type' values='a|c|s|o' /><checkbox class='uic_prop_slider_anim' default='false' help='Map width will be adjusted to fit the visitor&apos;s browser. Note that this mode will disable the mouse scroll wheel on the map to allow visitor to scroll your website.' name='full_width' value='Full screen width' /><!-- OLD MODE --><checkbox class='uim_scale' default='false' help='Your visitors can see a scale on bottom of the map' name='scaleCtrl' value='Scale' /><select class='uim_zoom' default='&apos;large&apos;' display='None|Small|Large' help='Adjust the size of the map zoom controller.&lt;br&gt; If set to none, your visitors will not be able to change the zoom level.' name='zoomCtrl' title='Zoom' values='none|small|large' /><option class='uim_type' default='&apos;m&apos;' display='Road|Satellite|Hybrid|Physical' help='Select the map types you want to be available.' name='mapTypeCtrl' title='Map Type' values='m|k|h|p' /><trigger class='uim_draw' help='Stop edition of the map' img='/components/UI_Map/h.gif' name='h_btn' node='span' trigger='stopDrawing' /><trigger class='uim_draw' help='Add small markers on the map' img='/components/UI_Map/dis-m.gif' name='m_btn' node='span' trigger='placeMarker' /><trigger class='uim_draw' help='Draw lines on the map&lt;br&gt;To end drawing, click on the last node.&lt;br&gt;To add a node, move a transparent node.&lt;br&gt;To remove a node, click on an opaque node.' img='/components/UI_Map/dis-l.gif' name='l_btn' node='span' trigger='startLine' /><trigger class='uim_draw' help='Draw areas on the map&lt;br&gt;To end the area, click on the first node.&lt;br&gt;To add a node, move a transparent node.&lt;br&gt;To remove a node, click on an opaque node.&lt;br&gt;To delete the area, remove all its nodes.' img='/components/UI_Map/dis-s.gif' name='s_btn' node='span' trigger='startShape' /><!-- / OLD MODE --><!-- CUSTOM MODE --><kml_selector class='uim_kml' default='&apos;&apos;' help='Select KML' icon='ui_map' name='kmlFile' /><mymaps_selector class='uim_mymaps' default='&apos;&apos;' help='Google map' icon='ui_map' name='kmlFile' /><!-- / CUSTOM MODE --><!-- ADDRESS MODE --><inputText class='uim_address' default='"Liberty Island, New York"' name='address' title='Map address' /><number class='uim_zoomLevel' default='10' maximum='20' minimum='1' name='zoomLevel' title='Zoom' /><radio class='uim_type_address' default='&apos;m&apos;' display='Road|Satellite' help='Select the map types you want to be available.' name='mapTypeCtrl_address' title='Map Type' values='m|k' /><!-- / ADDRESS MODE --><!-- HOTELS --><checkbox class='uim_s_dates' default='false' name='s_dates' value='Start and end date' /><date class='uim_s_checkin' format='YYYY-MM-DD' name='s_checkin' title='Checkin' /><date class='uim_s_checkout' format='YYYY-MM-DD' name='s_checkout' title='Checkout' /><checkbox class='uim_s_hidefilters' default='false' name='s_hidefilters' value='Hide filters' /><checkbox class='uim_s_dotlistings' default='false' name='s_dotlistings' value='Dot listing' /><checkbox class='uim_s_showhotels' default='true' name='s_showhotels' value='Show hotels' /><checkbox class='uim_s_showairbnbs' default='true' name='s_showairbnbs' value='Show AirBnbs' /><checkbox class='uim_s_showothers' default='true' name='s_showothers' value='Show others' /><!-- / HOTELS --><!--<hidden name="zoomLevel" default="4"/>--></properties><design_properties><mapStyle class='map_styles' default='0' name='map_style' title='Map style' /><select class='uim_s_mapstyle' default='&apos;d&apos;' display='Default|Light' name='s_mapstyle' title='Map style' values='default|light' /><colors background='split|split|split' class='uim_s_buttoncolors' default='[&apos;rgba(0,119,231, 1)&apos;, &apos;rgba(2,105,202, 1)&apos;, &apos;rgba(2,105,202, 1)&apos;]' display='Background|Hover|Active' elts='3' name='s_buttoncolors' title='Buttons colors' /><colors background='split|split' class='uim_s_hotelscolors' default='[&apos;rgba(255,255,255, 1)&apos;, &apos;rgba(18,92,197, 1)&apos;]' display='Text|Background' elts='2' name='s_hotelscolors' title='Hotels colors' /><colors background='split|split' class='uim_s_rentalscolors' default='[&apos;rgba(255,255,255, 1)&apos;, &apos;rgba(253,92,99, 1)&apos;]' display='Text|Background' elts='2' name='s_rentalscolors' title='Rentals colors' /></design_properties></view><script>UI_List.UI_Map={initialize:function(a){this.cpt=a;
this.map_created=false;
a.setOptions([&quot;locked&quot;,&quot;footer&quot;,&quot;sticky&quot;])
},onDisplay:function(b){this.node=b;
this.findVersion();
this.cleanData();
this._loadProperties();
var a=this;
sigCtl.connect(&quot;Theme.changed&quot;,function(){a.map_created=false
});
this._setFullWidth()
},onShow:function(){this.findVersion();
if(!this.map_created){this._createMap();
this.map_created=true
}},onSelect:function(){var a=this;
this._loadProperties();
this._showProp();
if(this.cpt.propertyNode&amp;&amp;this.cpt.data.map_version==&quot;o&quot;){Misc.poll(function(){return a.map
},function(){a.map.set_select(function(b){a.cpt.propertyNode.find(&quot;.btn_prop&quot;).enableImg(false);
a.cpt.propertyNode.find(&quot;.&quot;+b+&quot;_btn&quot;).enableImg()
})
})
}},onDeselect:function(){if(this.map&amp;&amp;this.cpt.data.map_version==&quot;o&quot;){this.map.stopDrawing()
}},onResizeStart:function(){},onResize:function(){},onResizeStop:function(){this._setFullWidth()
},onMoveStart:function(){this.node.css(&quot;background&quot;,&quot; #fff url(/components/UI_Map/bg.jpg) repeat top left&quot;);
if(this.iframe){this.iframe.hide()
}},onMoveStop:function(){if(this.iframe){this.iframe.show()
}this._setFullWidth()
},onRotateStart:function(){this.node.css(&quot;background&quot;,&quot; #fff url(/components/UI_Map/bg.jpg) repeat top left&quot;);
if(this.iframe){this.iframe.hide()
}},onRotateStop:function(){if(this.iframe){this.iframe.show()
}this._setFullWidth()
},findVersion:function(){if(this.cpt.from_clone&amp;&amp;this.cpt.data.map_version==&quot;o&quot;){statusController.message(&quot;New Map block : to custom your map, use Custom Map type&quot;,&quot;warning&quot;);
this.cpt.data.map_version=&quot;a&quot;;
return
}else{if(!this.cpt.data.map_version){if(this.useAPI()){this.cpt.data.map_version=&quot;o&quot;
}else{if(this.cpt.data.kmlFile){if(this.cpt.data.kmlFile.api==&quot;google_drive&quot;){this.cpt.data.map_version=&quot;c&quot;
}else{this.cpt.data.map_version=&quot;o&quot;
}}else{this.cpt.data.map_version=&quot;a&quot;
}}}}},cleanData:function(){this.findVersion();
var a=this;
var b=$.extend({},this.cpt.data);
if(b.map_version!=&quot;o&quot;){delete this.cpt.data.lines;
delete this.cpt.data.shapes;
delete this.cpt.data.markers;
delete this.cpt.data.message;
delete this.cpt.data.zoomCtrl;
delete this.cpt.data.map_style
}},_loadProperties:function(){var a=this;
var b=$(this.component.propertyNode).add(this.component.propertyDesignNode);
this.pn=b;
if(this.cpt.data.map_version!=&quot;o&quot;){$(&apos;li.uim_version select option[value=&quot;o&quot;]&apos;,b).remove();
$(&apos;li.uim_type input[value=&quot;h&quot;], li.uim_type input[value=&quot;p&quot;]&apos;).parent().hide()
}$(&quot;span.propContainer, li.propContainer&quot;,b).not(&quot;li.uic_prop_slider_anim, li.uim_version&quot;).hide();
switch(this.cpt.data.map_version){case&quot;a&quot;:$(&quot;li.uim_type_address&quot;).val(this.cpt.data.mapTypeCtrl_address?this.cpt.data.mapTypeCtrl_address:this.cpt.data.mapTypeCtrl[0]);
$(&quot;li.uim_type_address, li.uim_address, li.uim_zoomLevel&quot;,b).show();
break;
case&quot;c&quot;:$(&quot;li.uim_mymaps&quot;,b).show();
break;
case&quot;s&quot;:$(&apos;li[class^=&quot;uim_s_&quot;], li.uim_zoomLevel, li.uim_address&apos;,b).show();
$(&quot;li.uim_s_checkin, li.uim_s_checkout&quot;,b).toggle(this.cpt.data.s_dates||false);
break;
case&quot;o&quot;:$(&apos;li.uim_type input[value=&quot;h&quot;], li.uim_type input[value=&quot;p&quot;]&apos;).parent().show();
$(&quot;li.uim_type&quot;).val(this.cpt.data.mapTypeCtrl);
$(&quot;li.uim_type, li.uim_scale, li.uim_zoom, li.uim_zoomLevel, li.map_styles, li.uim_kml, span.uim_draw&quot;,b).show();
break
}var c=$(&quot;li.uim_address input&quot;,b);
c.off().trigger_enter().on(&quot;change blur enter&quot;,function(){a.cpt.data.address=this.value;
a._createMap()
})
},useAPI:function(){var a=this.cpt.data.shapes&amp;&amp;this.cpt.data.shapes.find(function(b){return b.points
});
return(!this.cpt.from_clone&amp;&amp;((this.cpt.data.markers&amp;&amp;this.cpt.data.markers.length&gt;0)||a||(this.cpt.data.lines&amp;&amp;this.cpt.data.lines.length&gt;0)||this.cpt.data.map_style||(this.cpt.data.map_version&amp;&amp;this.cpt.data.map_version==&quot;o&quot;)))
},_init:function(){eval(&quot;this.map=ggmap&quot;+this.uniqueNb);
if(v.mode==&quot;editor&quot;){var self=this;
if(this.useAPI()){if(this.map){this.map.propertyChangedCallback(function(k,v){historyController.offRecords(function(){self.cpt.setData(k,v)
})
});
this.map.initParams(this.cpt.data,this.kmlUrl())
}else{setTimeout(function(){this._init()
},500)
}}}},getStay22Color:function(a){return $.fn.rgbToHex(a).replace(&quot;#&quot;,&quot;&quot;)
},checkStay22Dates:function(){var a=false;
if(this.cpt.data.s_checkin){}},_createMap:function(){this.uniqueNb=this.cpt.component_type.getCounter();
this.node.empty();
this.map=null;
var q=this;
if(this.progress){this.progress.update(100)
}var b=this.progress=this.cpt.statusLoading();
var k=this.cpt.W();
if(this.cpt.data.full_width){k=this.component.node.find(&quot;div:first&quot;).width()
}this.waitImg=$(&apos;&lt;img src=&quot;/assets/loadingAnimation.gif?infinite_cache&quot;/&gt;&apos;).appendTo(this.node.css(&quot;background&quot;,&quot; #fff url(/components/UI_Map/bg.jpg?infinite_cache) repeat top left&quot;));
var a=&quot;&quot;;
var h=false;
var c=Date.format.toUpperCase();
var i={config:{dateFormat:&quot;YYYY-MM-DD&quot;}};
switch(this.cpt.data.map_version){case&quot;o&quot;:a+=(v.mode==&quot;editor&quot;||(&quot;&quot;+window.location).match(/\/\/localhost/))?&quot;/&quot;:&quot;https://www.sitew.com/&quot;;
a+=&quot;api/googlemap?&amp;version_mode=&quot;+v.mode+&quot;&amp;cptid=&quot;+(this.cpt.id||&quot;&quot;);
break;
case&quot;c&quot;:if(this.cpt.data.kmlFile&amp;&amp;this.cpt.data.kmlFile.api==&quot;google_drive&quot;){a=&quot;https://www.google.com/maps/d/embed?vomp=1&amp;mid=&quot;+this.cpt.data.kmlFile.id
}else{h=true;
a=&quot;https://www.google.com/maps/embed/v1/place?key=AIzaSyCWforQeNUlsCkrtK_BcmLtfifWJ0Ic0d0&amp;&amp;zoom=10&amp;maptype=roadmap&amp;q=Liberty Island, New York&quot;
}break;
case&quot;s&quot;:var m={aid:&quot;sitew&quot;,hideshare:true,hidenavbar:true,hidebrandlogo:true,hideppn:true,disableautohover:true,openmenu:&quot;null&quot;};
var d={buttoncolor:this.getStay22Color(this.cpt.data.s_buttoncolors[0]),buttoncolorhover:this.getStay22Color(this.cpt.data.s_buttoncolors[1]),buttoncoloractive:this.getStay22Color(this.cpt.data.s_buttoncolors[2]),hotelscolor:this.getStay22Color(this.cpt.data.s_hotelscolors[1]),rentalscolor:this.getStay22Color(this.cpt.data.s_rentalscolors[1]),hotelsfontcolor:this.getStay22Color(this.cpt.data.s_hotelscolors[0]),rentalsfontcolor:this.getStay22Color(this.cpt.data.s_rentalscolors[0])};
var j=moment(this.cpt.data.s_checkin||moment().format(i.config.dateFormat),i.config.dateFormat);
var l=moment(this.cpt.data.s_checkout||moment().add(1,&quot;d&quot;).format(i.config.dateFormat),i.config.dateFormat);
var p=false;
if((!this.cpt.data.s_checkin||!this.cpt.data.s_checkout)&amp;&amp;this.cpt.data.s_dates){this.cpt.data.s_checkin=j.format(i.config.dateFormat);
this.cpt.data.s_checkout=l.format(i.config.dateFormat);
p=true
}if(j&gt;l){this.cpt.data.s_checkout=j.format(i.config.dateFormat);
this.cpt.data.s_checkin=l.format(i.config.dateFormat);
p=true
}else{if(j.startOf(&quot;d&quot;).isSame(l.startOf(&quot;d&quot;))){p=true;
this.cpt.data.s_checkout=moment(this.cpt.data.s_checkin,i.config.dateFormat).add(1,&quot;d&quot;).format(i.config.dateFormat)
}}var o=this.cpt.data.s_checkin;
var e=this.cpt.data.s_checkout;
if(p&amp;&amp;v.mode==&quot;editor&quot;){setTimeout(function(){$(&quot;li.uim_s_checkin .display_input&quot;).val(moment(o,i.config.dateFormat).format(c));
$(&quot;li.uim_s_checkout .display_input&quot;).val(moment(e,i.config.dateFormat).format(c));
$(&quot;li.uim_s_checkin .value_input&quot;,this.pn).val(o);
$(&quot;li.uim_s_checkout .value_input&quot;,this.pn).val(e)
},100)
}var g={};
$.each(this.cpt.data,function(s,r){if(s.indexOf(&quot;s_&quot;,0)&gt;-1&amp;&amp;!s.indexOf(&quot;color&quot;)&gt;-1){g[s.replace(&quot;s_&quot;,&quot;&quot;)]=r
}});
var n={checkin:this.cpt.data.s_checkin,checkout:this.cpt.data.s_checkout};
$.extend(g,m,d,n,{address:this.cpt.data.address,zoom:this.cpt.data.zoomLevel});
if(!this.cpt.data.s_dates){delete g.checkin;
delete g.checkout;
delete g.s_dates
}a=&quot;https://www.stay22.com/embed/gm?&quot;+$.param(g);
break;
default:a=&quot;https://www.google.com/maps/embed/v1/place?key=AIzaSyCWforQeNUlsCkrtK_BcmLtfifWJ0Ic0d0&amp;&amp;zoom=&quot;+this.cpt.data.zoomLevel+&quot;&amp;maptype=&quot;+(({m:&quot;roadmap&quot;,k:&quot;satellite&quot;}[this.cpt.data.mapTypeCtrl_address])||&quot;roadmap&quot;);
if(this.cpt.data.address&amp;&amp;this.cpt.data.address.length&gt;3){a+=&quot;&amp;q=&quot;+encodeURI(this.cpt.data.address)
}else{a+=&quot;&amp;q=&quot;+encodeURI(this.cpt.data.markerPosition)
}break
}if(h&amp;&amp;v.mode==&quot;viewer&quot;){this.cpt.node.hide()
}else{var f={position:&quot;absolute&quot;,left:this.cpt.W(),display:&quot;none&quot;};
if(/mobile/.test(deviceController.device)){f={display:&quot;none&quot;}
}this.iframe=$(&apos;&lt;iframe src=&quot;&apos;+a+&apos;&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; name=&quot;ggmap&apos;+this.uniqueNb+&apos;&quot;&gt;&lt;/iframe&gt;&apos;).width(&quot;100%&quot;).height(&quot;100%&quot;).css(f).one(&quot;load error abort&quot;,function(r){q.waitImg.hide();
q.iframe.css(&quot;left&quot;,0);
q.iframe.show();
if(q.cpt.data.map_version==&quot;o&quot;&amp;&amp;r.type==&quot;load&quot;){q._init()
}b.update(100)
}).appendTo(this.node)
}if(this.cpt.data.map_version==&quot;c&quot;){q.iframe.on(&quot;load&quot;,function(){q.iframe.attr(&quot;src&quot;,q.iframe.attr(&quot;src&quot;).replace(&quot;vomp=1&quot;,&quot;&quot;));
q.iframe.off(&quot;load&quot;)
})
}},kmlUrl:function(){var b,a=this.cpt.data.kmlFile;
if(a){if(a.type==&quot;application/vnd.google-apps.map&quot;){b=&quot;https://www.google.com/maps/d/kml?forcekml=1&amp;mid=&quot;+a.id
}else{b=cdn_url(a.url).replace(/(https?\:)?\/\//,&quot;https://&quot;)
}return b
}},onPropertyChanged:function(a){if(this.map||(!this.map&amp;&amp;this.cpt.data.map_version!=&quot;o&quot;)){if(a.include(&quot;zoomCtrl&quot;)){this.map.showZoomCtrl(this.cpt.data.zoomCtrl,true,this.cpt.data)
}if(a.include(&quot;mapTypeCtrl&quot;)){if(this.map&amp;&amp;this.cpt.data.map_version==&quot;o&quot;){this.map.showMapTypeCtrl(this.cpt.data)
}}if(a.include(&quot;mapTypeCtrl_address&quot;)){this._createMap()
}if(a.include(&quot;scaleCtrl&quot;)){if(this.cpt.data.map_version==&quot;o&quot;){this.map.showScaleCtrl(this.cpt.data.scaleCtrl,true,this.cpt.data)
}}if(a.include(&quot;stopDrawing&quot;)){this.map.stopDrawing()
}if(a.include(&quot;placeMarker&quot;)){this.map.placeMarker()
}else{if(a.include(&quot;startShape&quot;)){this.map.startShape()
}else{if(a.include(&quot;startLine&quot;)){this.map.startLine()
}}}if(a.include(&quot;kmlFile&quot;)){if(this.cpt.data.map_version==&quot;o&quot;){this.map.initKml(this.kmlUrl())
}else{this._createMap()
}}if(a.include(&quot;full_width&quot;)){this._setFullWidth();
this._createMap()
}if(a.include(&quot;map_style&quot;)){this._createMap()
}if(a.include(&quot;map_version&quot;)){this._loadProperties();
this._createMap()
}if(this.cpt.data.map_version==&quot;s&quot;){if(a.include(&quot;s_dotlistings&quot;)||a.include(&quot;s_hidefilters&quot;)||a.include(&quot;s_checkin&quot;)||a.include(&quot;s_checkout&quot;)||a.include(&quot;s_mapstyle&quot;)||a.include(&quot;s_showhotels&quot;)||a.include(&quot;s_showairbnbs&quot;)||a.include(&quot;s_showothers&quot;)){this._createMap()
}if(a.include(&quot;s_buttoncolors&quot;)||a.include(&quot;s_hotelscolors&quot;)||a.include(&quot;s_rentalscolors&quot;)){var b=this;
if(!this.loading){this.loading=true;
this._createMap();
setTimeout(function(){b.loading=false
},500)
}}if(a.include(&quot;s_dates&quot;)){this._loadProperties();
this._createMap()
}}}else{var b=this;
setTimeout(function(){b.onPropertyChanged(a)
},500)
}this.toggleStyleProp()
},_showProp:function(){if(blockSelector.selected_blocks.length&gt;1){return
}this.component.init_colorPickers()
},toggleStyleProp:function(){var a=$(this.cpt.propertyNode).add(this.cpt.propertyDesignNode);
if(this.cpt.data.mapTypeCtrl==&quot;&quot;||this.cpt.data.mapTypeCtrl.indexOf(&quot;m&quot;)&gt;-1){$(&quot;.prop_mapStyle&quot;,a).show()
}else{$(&quot;.prop_mapStyle&quot;,a).hide()
}},_setFullWidth:function(){this.component.setFullWidth(this.component.data.full_width)
},onDeviceChanged:function(){this._createMap()
}};</script></uidget>