ThinkGeo.com    |     Documentation    |     Premium Support

Adding Navigation Context

Hi there,



I have a problem, I’m using MapSuite to show Tab file Map.

I load the tab file using serverlayer in default.aspx.cs, and load via serverlayeroverlay on the silverlight map.



I’m able to add/edit/delete map feature on the tab file via WCF service,

but I have to refresh the page manually if I want to see the result.



Does anyone have any recommendation on how to refresh the silverlight page automatically, and keep the Map’s state (Current Extent, zoom level).



I have tried adding Navigation Context Query String, but I just got Script Error on Slverlight Map Connector,

I notice that MapSuite for Silverlight remove any aspx and Silverlight Page Name on the url of the browser, it just showing the folder where my default.aspx reside.

CMIIW, I think mapsuite cannot  get to work if there is any navigation context query string?



Thanks.


Hi Syarief,



Thanks for your post, We try to refresh automatically with a timer in client side, but we encountered an issue that the requests didn’t be sent except pan or zoom. So, we need a little time to solve it.



About “MapSuite for Silverlight remove any aspx and Silverlight Page Name on the url of the browser”, could you please provide more information about it? As far as I know, the Silverlight client side didn’t include any page and we can treat the client side is an app which can be run at browser and desktop. If I am wrong, please feel free to correct me.



As for the “Navigation Context Query String”, could you please provide some code about it? Or if possible,  a "self-contained" sample will be highly appreciated.



Waiting for your further information.



Summer




Hi Summer,



Thanks for your response, I’ll kindly wait for the solution.



1. about “MapSuite remove any aspx or silverlight page” is actually my application consist of more than 1 silverlight app, so i make a folder for each of my silverlight app and put the default.aspx that load the xap in each folder.

eg:

- Site Root

     - Map

          - Default.aspx -> load Map.xap

     - Common

          - Default.aspx -> load common.xap

     - Default.aspx -> load portal.xap



and in my Map SIlverlight App (Map.xap), I’m using silverlight navigation and I put MapSuite Control in PageMap.

in my SIlverlight App the outer control is MainPage that has Frame as a container to load silverlight page (PageMap).



AFAIK, if I access the PageMap, then  the url in the browser will written  like “localhost/Map/#/” or “localhost/Map/Deafult.aspx#/” or “localhost/Map/Deafult.aspx#/PageMap”.

but I’m just seeing “localhost/Map/” in the url bar.





 2. AFAIK, Navigation Context Query String is HTTP GET-like query string in silverlight page, so I try to put the string representation of the Map’s current extent

eg:

localhost/Map/Deafult.aspx#/PageMap/{POLYGON=“379849…”}

and in My UrlMapping of the frame i put

<urimapper:urimapping uri="/PageMap/{currentExtent}" mappeduri="/Views/PageMap.xaml?ce={currentExtent}">


<uriMapper:UriMapping MappedUri="/Viewst/PageMap.xaml?ce={currentExtent}" Uri="/PageMap/{currentExtent}" />



Hope it helps elaborate my questions.



Thanks.

</urimapper:urimapping>

Hi Syarief,


I guess Summer is right, you can try calling overlay.Refresh() with a timer to refresh the map automatically, it will keep the map’s state, such as Current Extent, zoom level etc.


For the “Map Suite remove any aspx or Silverlight page”, I’m not sure whether I understand you clear, but I guess it depends what’s kind of Overlay you are using, for your sample, the ServerOverlay, it must be hosted in a aspx page, so that we can take the advantage of the aspx to call the SilverlightConnector to request the images, I guess the reason why you get localhost/map/ in the url bar is you didn’t set the aspx as the start page, can you have a try?


For the “Navigation Context Query String error message ”, could you let me know what’s the exception is? Something like “unable to load resource” or others, is it possible for you to send your demo to forumsupport@thinkgeo.com to let us have a try?


 


Thanks,


Johnny



Hi Johnny, 
  
 I found the root cause for this problem, even if I reload the page manually, it won’t update the screen. 
 Actually it’s all about browser cache, because I use server overlay that generate some tile image, then the browser cache those images. Till I clear browser’s cache it won’t get the newly created tile from the server. 
  


Hi Syarief, 
  
 Great to hear the cause is sorted out, if you have any more question, please feel free to let us know. 
  
 Best Regards 
  
 Summer