-
Notifications
You must be signed in to change notification settings - Fork 49
/
05-search-for-places-example.js
65 lines (55 loc) · 1.65 KB
/
05-search-for-places-example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
function runExample5() {
$("#search-for-places").mapsed({
// Adds a predictive search box
searchOptions: {
enabled: true,
//initSearch: "Football in Leeds",
geoSearch: "Hotels near {POSITION}",
placeholder: "Search ..."
},
// Turn on geo location button
allowGeo: true,
findGeoOnLoad: true,
// allow user to select somewhere
onSelect: function(m, details) {
var msg =
"name: " + details.name +
"<br/>street: " + details.street + ", " +
details.area + ", " +
details.town + ", " + details.postCode +
"<br/>telNo: " + details.telNo +
"<br/>website: " + details.website +
"<br/>more: " + details.url
;
if (details.place_id) {
msg += "<br/>Place_id: " + details.place_id
}
m.showMsg("You selected ...", msg);
// indicate tip should be closed
return true;
},
// shows additional instructions to the user
getHelpWindow: function(m) {
var html =
"<div class='mapsed-help'>" +
"<h3>Find a venue</h3>" +
"<ol>" +
"<li>Simply use the <strong>search</strong> box to find a venue in your area.</li>" +
"<li>On the pop-up, click <strong>Select</strong> to pick a pitch.</li>" +
"</ol>" +
"<h3>New venues</h3>" +
"<ol>" +
"<li>Your venue isn't displayed? Simply click on the map where your pitch is.</li>" +
"<li>Fill in the details in the dialog.</li>" +
"<li>You can drag the marker around to pinpoint the right location.</li>" +
"<li>Once you're happy, click the <strong>OK</strong> button</li>" +
"</ol>" +
"</div>"
;
return html;
}
});
}
$(document).ready(function() {
runExample5();
});