Select to view content in your preferred language

How to use relative path in ArcGISLocalTiledLayer?

2267
1
09-11-2013 12:12 AM
Labels (1)
ae
by
Frequent Contributor
Hi,

Could someone give me an example of how I can use relative paths in the Path property of the ArcGISLocalTiledLayer? Everything I've tried gives me exceptions.

Cheers
0 Kudos
1 Reply
AnttiKajanus1
Deactivated User
Atleast when working with mpk's this is how you can do it: (snipped from old test, not guaranteed 😃

    <Window.Resources>
        <esri:LocalFeatureService x:Key="FeatureService" Path="Data\\stuff.mpk" MaxRecords="3000" EnableDynamicLayers="True"/>
        <esri:SimpleRenderer x:Key="MySimpleRenderer">
            <esri:SimpleRenderer.Symbol>
                <esri:SimpleFillSymbol BorderBrush="Blue" BorderThickness="4" Fill="Red"/>
            </esri:SimpleRenderer.Symbol>
        </esri:SimpleRenderer>
    </Window.Resources>
 
    <Grid>  
        <esri:Map x:Name="_map" UseAcceleratedDisplay="True" IsEnabled="false" >
            <esri:ArcGISTiledMapServiceLayer ID="World Topo Map" 
                       Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>


            <esri:ArcGISLocalDynamicMapServiceLayer Service="{StaticResource FeatureService}"/>
        </esri:Map>
    </Grid>
</Window>


or from code:

private const string PATH = "Data\\stuff.mpk";
private LocalMapService _mapService;

 LocalMapService.GetServiceAsync(PATH, localMapService =>
            {
                _mapService = localMapService;
                _map.IsEnabled = true;
            });
0 Kudos