Hint: Simple URLs
There is a knowledge base article on this support site about simplifying the public URL to your Essentials map, which also makes it impervious to changes in viewer version. The idea is to make an HTML file which contains an iframe which loads up your viewer. Well, the problem with this approach is that the new address doesn't forward the query string to the viewer. So, if you plan on using startup actions, the simplified URL idea won't work on its own.
As a working example, I created a file called index.htm and stuck it in a folder called Trees, which I created in the inetpub\wwwroot folder. And because we're in a reverse proxy environment, I had to add a "trees" rewrite rule on the external server. So, here are the contents of the index.htm file:
<html><p> </p> <head><p> </p> <title>Tree Map - Orem</title><p> </p> </head><p> </p> <script language="JavaScript"><p> </p> var gxViewer = "SilverlightViewer_1_5";<p> </p> var gxConfig = "SilverTrees";<p> </p> var innerMap = "http://maps.orem.org/" + gxViewer + "/?Viewer=" + gxConfig;<p> </p> var startupActions = "";<p> </p> if (location.search.length > 0) startupActions = "&" + location.search.substr(1);<p> </p> var iFrame = '<iframe style="z-index:1;overflow:hidden;border:0px" src="' +<p> </p> innerMap +<p> </p> startupActions +<p> </p> '" frameborder="0" scrolling="NO" width="100%" height="100%" marginwidth="0" marginheight="0" name="viewer" NORESIZE></iframe>';<p> </p> document.write(iFrame);<p> </p> </script><p> </p> </head><p> </p> <body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" style="overflow:hidden" /><p> </p> </noframes><p> </p> </html>
So, when all this is working, my site is accessed like this with an attribute search:
http://maps.orem.org/trees/?attributeSearch=City+Trees,TREEID,CITYP175
instead of this uglier, viewer-version-dependent URL:
Isn't that cool? So, when the Silverlight Viewer 1.6 comes out, I can make a new Viewer for my site, toy around with it before the public knows it exists. When when I'm ready, I'll edit the HTML file, change SilverlightViewer_1_5 to SilverlightViewer_1_6 and everything should be OK!
And in case you're interested, it didn't really work to have maps.orem.org/trees do a forward to the Silverlight Viewer URL, because if people bookmarked it, then they would always be returning to the old viewer, which would eventually be taken down, and they'd be left wondering, "What happened to this site? It used to work and now it doesn't!"
So, if you decide to go with this idea, you just need to change 3 variables per file: gxViewer, gxConfig, and innerMap.
You're welcome, if this helps.
"Roj"
-
I learned something new today. In the post I made above, there is a critical piece of information I was missing. Although my Viewer was named SilverTrees in Manager, I didn't specify this name in C:\inetpub\wwwroot\SilverlightViewer_1_5\Config\Viewer.Setting.xml. Instead of having an Id of SilverTrees, I had renamed it to Trees. Therefore, the value of gxConfig should be Trees as well. I've changed it, and it works again. That also means that the longer URL above should be changed to:
http://maps.orem.org/SilverlightViewer_1_5/?Viewer=Trees&attributeSearch=City+Trees,TREEID,CITYP175
The shorter one should still work, however, because I changed C:\inetpub\wwwroot\Trees\index.htm on the server today.
"Roj"
0 -
Cool, Thanks Roj!
0 -
Thanks for that tip Roji
-Alex
0
Please sign in to leave a comment.
Comments
3 comments