My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>funslae</title>
<style type="text/css">
html, body {
height: 100%;
overflow: auto;
}
body {
padding: 0;
margin: 0;
}
#silverlightControlHost {
height: 100%;
text-align:center;
}
</style>
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAxQsxL2M69pdICjgBh6qFyBSVlvern5WJ0S-0kwfnz8CcfbPR4BSZyqsuS3cy-Xm5fbKzRiHQyjNxgg"></script>
<script type="text/javascript" src="Silverlight.js"></script>
<script type="text/javascript">
var clientLocation;

function centerMap() {
if (clientLocation) {
var latitude = google.loader.ClientLocation.latitude;
var longitude = google.loader.ClientLocation.longitude;
if (latitude && longitude) {
var map = document.getElementById("silverlightControl").Content.Map;
map.SetCenter(latitude, longitude);
map.SetZoomLevel(10); // miles
}
}
}

function loadSilverlight() {
clientLocation = google.loader.ClientLocation;
Silverlight.createObject(
"funslae.xap",
document.getElementById("silverlightControlHost"),
"silverlightControl",
{ width: "100%", height: "100%", background: "white", minRuntimeVersion: "3.0.40818.0", autoUpgrade: "true" },
{ onLoad: "centerMap" }
);
}

google.setOnLoadCallback(loadSilverlight);
google.load("maps", "2");
</script>
</head>
<body>
<div id="silverlightControlHost"></div>
</body>
</html>

Change log

r23 by cameron.taggart on Dec 22, 2009   Diff
moving blog code in 2009 to be under
tags/blog-2009
Go to: 
Project members, sign in to write a code review

Older revisions

r20 by cameron.taggart on Dec 21, 2009   Diff
source alignment
r19 by cameron.taggart on Dec 21, 2009   Diff
source alignment
r18 by cameron.taggart on Dec 21, 2009   Diff
don't zoom in unless the location is
found
All revisions of this file

File info

Size: 1723 bytes, 54 lines
Powered by Google Project Hosting