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
namespace Funslae

open System
open System.Windows
open System.Windows.Browser
open System.Windows.Controls
open System.Windows.Media
open Microsoft.Maps.MapControl
open Microsoft.Maps.MapControl.Core

type ScriptableMap() =
inherit Map()
[<ScriptableMember>]
member this.SetCenter(latitude, longitude) =
this.Center <- Location(latitude, longitude)
[<ScriptableMember>]
member this.SetZoomLevel(miles) =
this.ZoomLevel <- miles

type App() as app =
inherit Application()
do
app.Startup.Add(fun args ->
let grid = Grid()
app.RootVisual <- grid

let map = ScriptableMap()
grid.Children.Add map

map.CredentialsProvider <- {
new CredentialsProvider() with
member x.GetCredentials(action) =
action.Invoke(
let credentials = Credentials()
credentials.ApplicationId <- "AsQUVMODsS2NezEnDpl2DUlyGSoEa9EZTqL9lxcBTcKn2v53mfKJ-VOLufebS4Km"
credentials
)
}

HtmlPage.RegisterScriptableObject("Map", map)
()
)

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

r18 by cameron.taggart on Dec 21, 2009   Diff
don't zoom in unless the location is
found
r17 by cameron.taggart on Dec 21, 2009   Diff
added IP geocoding, "Locate Me"
functionality
r16 by cameron.taggart on Dec 21, 2009   Diff
added IP geocoding, "Locate Me"
functionality
All revisions of this file

File info

Size: 1111 bytes, 42 lines
Powered by Google Project Hosting