Troubleshooting ArcGIS API for Silverlight loading map intranet access issues

Source: Internet
Author: User
Tags silverlight

The original: Resolves an intranet access issue for the ArcGIS API for Silverlight loading map

First, go to a class, as follows:


public class baseclass{public static string Getfulluri (String olduristring) {string Newuristrin            g = olduristring;                Handle relative Address ============================================================ if (newuristring[0] = = '/') {                string shost = System.Windows.Browser.HtmlPage.Document.DocumentUri.Host;                int sport = System.Windows.Browser.HtmlPage.Document.DocumentUri.Port; newuristring = "http//" + Shost + (sport = = 80?) "": ":" + sport.            ToString ()) + newuristring; } if (!newuristring.startswith ("http")) {string shost = System.Windows.Browser.HtmlP Age.                Document.DocumentUri.Host;                int sport = System.Windows.Browser.HtmlPage.Document.DocumentUri.Port;                string slocal = System.Windows.Browser.HtmlPage.Document.DocumentUri.LocalPath; Slocal = slocal. Substring (0, slocal.                LastIndexOf ('/')); Uri Turi = NEW Uri ("http +/" + Shost + (sport = = 80?) "": ":" + sport.                ToString ()) + slocal + "/" + newuristring, Urikind.absolute); newuristring = Turi.            ToString ();        } return newuristring; }} <esri:Map> <esri:Map.Layers> <esri:arcgistiledmapservicelayer id= "Baselayer" Ur      L= "/arcgis/rest/services/hsdq/mapserver/"/> </esri:Map.Layers> </esri:Map> public MainPage () {      InitializeComponent ();      Arcgistiledmapservicelayer layer = mymap.layers["Baselayer"] as Arcgistiledmapservicelayer; Layer. URL = Baseclass.getfulluri (layer. URL);}



This will solve the problem of intranet IP address access and the same access to the IP address of the extranet.

Troubleshooting ArcGIS API for Silverlight loading map intranet access issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.