forked from applieddataconsultants/wheredat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapquest-example.html
52 lines (45 loc) · 2.31 KB
/
mapquest-example.html
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
<!doctype html>
<title>... wheredat ... example</title>
<meta http-equiv='X-UA-Compatible' content='IE=Edge,chrome=1'/>
<style>
@import url(http://fonts.googleapis.com/css?family=Norican);
@import url(http://fonts.googleapis.com/css?family=Ubuntu);
body { background-color: #333; color: #fff }
iframe { border: none; box-shadow: 0 0 8px #000 }
.wrap { width: 900px; position: relative; margin: 0 auto }
.center { text-align: center }
h1 { font-family: Norican; font-size: 4em; margin: 0; text-shadow: -1px 1px 1px #000}
p { font-family: Ubuntu; text-shadow: -1px 1px 1px #000 }
pre { font-size: 1.1em; background-color: #fff; padding: 20px; color: #333; border-radius: 15px; box-shadow: inset 0 0 2px #333 }
a { color: lightblue }
cite { font-family: Norican; font-size: 1.6em; font-style: normal }
</style>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
<iframe src='/?key=Fmjtd%7Cluur2l6rn1%2Can%3Do5-9012uw&address=58th Ave 54729&service=mapquest' width="100%" height="400px"></iframe>
<h1 class='center'>wheredat ↺</h1>
<div class='wrap'>
<p> <b>Step 1:</b> Embed the app (as seen above), and pass it some parameters: </p>
<pre>
<iframe src="http://[WHEREDAT]/?address=58th Ave 54729&service=mapquest"></iframe>
</pre>
<p> <b>Step 2:</b> Get feedback about what <cite>wheredat</cite> is geocoding to use in your client app: </p>
<pre>
// for cross domain w/ no support for IE <= 7
var handle = function(e){ console.log('postmessage', e.data) }
if (window.addEventListener) window.addEventListener('message', handle)
else window.attachEvent('onmessage', handle)
// for same domain w/ support for IE <= 7 (requires proxy)
window.wheredat_geocode = function (data) { console.log(data) }
</pre>
<p class='center'> Read about all the request parameters and message data objects on <a href='http://github.com/applieddataconsultants/wheredat/'>the github page</a>. </p>
</div>
<script>
// for cross domain w/ no support for IE <= 7
var handle = function(e){ console.log('postmessage', e.data) }
if (window.addEventListener) window.addEventListener('message', handle)
else window.attachEvent('onmessage', handle)
// for same domain w/ support for IE <= 7 (requires proxy)
window.wheredat_geocode = function (data) {
console.log('wheredat_geocode', data)
}
</script>