Woosmap Search Widget (Without Reco)
by woosmap
HTML
<link type="text/css" rel="stylesheet" href="https://sdk.woosmap.com/searchwidget/css/woosmap-search-widget.css">
<script src="https://sdk.woosmap.com/searchwidget/woosmapsearchwidget.js"></script>
<div id="wrapper-search-widget">
<div id="woosmap-search-widget-callback"></div>
<div id="woosmap-search-widget-container"></div>
</div>
CSS
body {
background-color: #f8fcfd;
}
#wrapper-search-widget {
display: flex;
background-color: #FFF;
padding: 1em;
max-width: 640px;
margin: 5% auto;
box-shadow: 0 0 3px 0 rgba(0, 0, 0, .2);
}
#woosmap-search-widget-container {
height: 100%;
padding: 1em;
width: 50%;
}
#woosmap-search-widget-callback {
height: 100%;
width: 50%;
padding: 1em;
word-break: break-word;
}
JavaScript
var callbackInitialRecommendedStore = function(store) {
//called when an Initial Recommended Store is Found
document.getElementById('woosmap-search-widget-callback').innerHTML = "<strong>Callback Initial Recommended Store</strong><br/>";
document.getElementById('woosmap-search-widget-callback').innerHTML += JSON.stringify(store);
};
var callbackUserSelectedStore = function(store) {
//called When a User Select a Store after a Geocoding Search
document.getElementById('woosmap-search-widget-callback').innerHTML = "<strong>Callback Selected Store</strong><br/>";
document.getElementById('woosmap-search-widget-callback').innerHTML += JSON.stringify(store);
};
var widgetOptions = {
woosmapKey: 'woos-0c78592f-13ea-362b-aa07-ba4ba9ea3dae',
google: {
key: 'AIzaSyCOtRab6Lh2pNn7gYxvAqN5leETC24OXYQ'
},
omitUIReco: true,
callbackInitialRecommendedStore: callbackInitialRecommendedStore,
callbackUserSelectedStore: callbackUserSelectedStore,
usePlaces: true,
userAllowedReco: false,
lang: 'en',
translations: {
en: {
searchAroundMeBtn: 'Around Me',
searchAroundMeTitle: 'Search nearest Store',
selectAroundMeTitle: 'Choose nearest store from :',
autocompletePlaceholder: 'Address...',
allStores: 'All Stores',
changeStore: 'Recommended Store',
findStore: 'Find my Store',
geolocationNotice: 'Geolocation capability is\'nt enable on your browser. Please, change your settings.',
closeBtn: 'Close',
selectStore: 'Set as Favorite',
telephone: 'Tel:',
open24: "All Day",
openingHoursDay: "today: ",
openingHoursWeek: "opening hours: ",
days: {
1: {
full: "Monday",
short: "Mon"
},
2: {
full: "Tuesday",
short: "Tue"
},
3: {
full: "Wednesday",
short: "Wed"
},
4: {
full: "Thursday",
short: "Thu"
},
5: {
full:...