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