Is it possible to pass arguments in the URL?

510
3
08-16-2010 04:02 AM
StephenLead
Regular Contributor III
Is it possible to pass arguments to the map in the URL, using the Silverlight API?

eg, pass the map extent, layer visibility, tool open state, etc as URL parameters.

Thanks,
Steve
0 Kudos
3 Replies
TerryGiles
Occasional Contributor III
Try using System.Windows.Browser.HtmlDocument, it has a QueryString property that will return a dictionary of the parameters and values from the URL.
0 Kudos
BrandonIves
New Contributor
Is it possible to pass arguments to the map in the URL, using the Silverlight API?

eg, pass the map extent, layer visibility, tool open state, etc as URL parameters.

Thanks,
Steve


Steve,

Did you ever get this to work? I would like to pass an address through a URL and have the map zoom to the address when the app launches.


Also I found this very helpful video:

http://www.silverlight.net/learn/videos/silverlight-videos/using-startup-parameters-with-silverlight...
0 Kudos
KrisStitt
New Contributor
Not sure if this is what you are looking for, but I am doing this to grab settings from the URL to set the initial map size:


        Dim uriTest As Uri = HtmlPage.Document.DocumentUri
        Dim preClean As String = uriTest.Query.ToString

preClean would contain the information at the end of the url.  so if my url were:

http://localhost/ourmap.aspx?mapsize=1

preClean would equal "?mapsize=1" 

Then from there I split it apart to get the values..

Not sure if that helps but it seems to work for me.

-Kris Stitt
0 Kudos