Note that there are some explanatory texts on larger screens.

plurals
  1. POspatial reference
    primarykey
    data
    text
    <p>I'm new to Windows Phone 7 development here. I have recently downloaded and tried out the Arcgis sample Map and it gives me this error after changing the TiledMapserverlayer's URL. </p> <pre><code>Invalid spatial reference. Spatial reference must match map's spatial reference. Clear the map layers collection prior to changing the spatial reference. </code></pre> <p>.xaml </p> <pre><code> &lt;esri:GraphicsLayer ID="MyGraphicsLayer"&gt; &lt;esri:GraphicsLayer.Graphics&gt; &lt;esri:Graphic Symbol="{StaticResource RedMarkerSymbol}"&gt; &lt;esriGeometry:MapPoint X="11560518.5450925" Y="153495.271364825"&gt; &lt;/esriGeometry:MapPoint&gt; &lt;/esri:Graphic&gt; &lt;/esri:GraphicsLayer.Graphics&gt; &lt;/esri:GraphicsLayer&gt; &lt;esri:ArcGISTiledMapServiceLayer ID="MyLayer" Url="http://www.onemap.sg/ArcGIS/rest/services/basemap/MapServer" /&gt; &lt;/esri:Map&gt; </code></pre> <p>.cs</p> <pre><code> public partial class Map : PhoneApplicationPage { GeoCoordinateWatcher _watcher; Graphic _graphicLocation; private static ESRI.ArcGIS.Client.Projection.WebMercator mercator = new ESRI.ArcGIS.Client.Projection.WebMercator(); bool initialLoad = true; public Map() { InitializeComponent(); _graphicLocation = (MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer).Graphics[0]; _watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); _watcher.MovementThreshold = 20; _watcher.StatusChanged += watcher_StatusChanged; _watcher.PositionChanged += watcher_PositionChanged; // Start data acquisition _watcher.Start(); } void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e) { switch (e.Status) { case GeoPositionStatus.Disabled: // The location service is disabled or unsupported. // Alert the user StatusTextBlock.Text = "Location is unsupported on this device"; break; case GeoPositionStatus.Initializing: // The location service is initializing. // Disable the Start Location button StatusTextBlock.Text = "Initializing location service"; break; case GeoPositionStatus.NoData: // The location service is working, but it cannot get location data // Alert the user and enable the Stop Location button StatusTextBlock.Text = "Data unavailable"; break; case GeoPositionStatus.Ready: // The location service is working and is receiving location data // Show the current position and enable the Stop Location button StatusTextBlock.Text = "Ready - retrieving data"; break; } } void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs&lt;GeoCoordinate&gt; e) { _graphicLocation.Geometry = mercator.FromGeographic(new MapPoint(e.Position.Location.Longitude, e.Position.Location.Latitude)); // Use horizontal accuracy (returned in meters) to zoom to the location if (initialLoad) { Envelope rect = new Envelope( (_graphicLocation.Geometry as MapPoint).X - (e.Position.Location.HorizontalAccuracy / 2), (_graphicLocation.Geometry as MapPoint).Y - (e.Position.Location.HorizontalAccuracy / 2), (_graphicLocation.Geometry as MapPoint).X + (e.Position.Location.HorizontalAccuracy / 2), (_graphicLocation.Geometry as MapPoint).Y + (e.Position.Location.HorizontalAccuracy / 2)); MyMap.ZoomTo(rect.Expand(20)); initialLoad = false; } else { MyMap.PanTo(_graphicLocation.Geometry); } } private void PhoneApplicationPage_Unloaded(object sender, RoutedEventArgs e) { _watcher.Stop(); }} </code></pre> <p>I have tried many solution such as adding in the wkid but it doesn't work. I have been having this error for very long. Can someone please help! Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload