POST
|
How can I create an empty MPK file with ArcMap that only contains a specific spatial reference? This will be used to load shape files dynamically.
... View more
03-27-2013
08:00 AM
|
0
|
3
|
2914
|
POST
|
Hi Mike, If you scroll up a little bit, you'll see that I'm using similar code. The only difference is that I'm getting my input features from the SelectedGraphics collection. And I will emphasize that these features have a different attribute schema than the one I used to save my GPK. Thanks.
... View more
03-25-2013
05:59 AM
|
0
|
0
|
452
|
POST
|
Hi, You could use try using Button Command and CommandParameter properties. Once the selection has been removed you can not select again until you click the SelectTool button. This is also demonstrated in the Selecting a FeatureLayer sample. http://resources.arcgis.com/en/help/runtime-wpf/samples/index.html#/Selecting_a_FeatureLayer/02q200000066000000/ Cheers, Kerrie Hi Kerrie, I'm actually using the commands in my toolbar items already. I'm not saying that the button is left enabled, I'm saying that when I click the map after canceling the selection, instead of panning, it allows me to select one more time. After that one time, when I click the map, I'm in pan mode. Thanks.
... View more
03-20-2013
12:51 PM
|
0
|
0
|
317
|
POST
|
Hi, I can't immediately account for the difference between the dynamic map service layer and feature layer but it's basically down to the spatial reference not being set on the map. Better to define the spatial reference explicitly on the Map probably:
<esri:Map x:Name="MyMap" Background="#FFE3E3E3" >
<esri:Map.Extent>
<esri:Envelope XMin="-15000000" YMin="2000000" XMax="-7000000" YMax="8000000">
<esri:Envelope.SpatialReference>
<esri:SpatialReference WKID="102100"/>
</esri:Envelope.SpatialReference>
</esri:Envelope>
</esri:Map.Extent>
<esri:ArcGISLocalDynamicMapServiceLayer ID="DynamicLayer"
Path="..\\Data\\MPKS\\USCitiesStates_Lambert_Conformal_Conic.mpk"/>
</esri:Map>
Cheers Mike Thanks for the pointing me in the right direction. Perhaps you can help me narrow this down and find a solution. I don't know much about spatial references but I am beginning to see that there are different spatial reference systems and I may be crossing a boundary between the one used in my shapefile and the one that my .mpk is associated with. We assumed that we would be able to use the EmptyMPK_WGS84.mpk found in the project that I linked to above in order to start out with an empty map. With EmptyMPK_WGS84.mpk... When I create my dynamic map service layer from my shapefile using the EmptyMPK_WGS84.mpk, the SpatialReference.WKID is set correctly but my FullExtent for the layer comes up as {NaN, NaN, NaN, NaN}. After adding the layer to the map, the map's extent also become {NaN, NaN, NaN, NaN}. If I manually set the FullExtent XMin, XMax, YMin, and YMax prior to adding the layer to the map, it works. The problem with that is that I have to know what the full extent is in order to set the correct values. On the feature layer....When I create a feature layer from the same dynamic map service layer, the FullExtent shows up as null prior to adding it to the map. After adding it to the map, the map is able to determine the correct extent (this is where I got the values that I used above). With a non-empty .mpk file that I have created through ArcMap... When I create my dynamic map service layer from my shapefile, the SpatialReference.WKID comes up as an entirely different number than when I used the other .mpk (which is why I think the difference in spatial reference systems might be to blame). When I check my FullExtent for the layer here it has values populated. Adding it to the map works. This is a bit concerning as I would like for our application to be generic enough to allow someone to start out with an empty map and add any shapefile that they wanted.
... View more
03-19-2013
07:27 AM
|
0
|
0
|
163
|
POST
|
Using the example found here: http://www.arcgis.com/home/item.html?id=953a530ada30477d95cc69e788268bc9 I am able to add a shapefile via a LocalDynamicMapServiceLayer. The map in the example is defined as follows: <esri:Map x:Name="_map" UseAcceleratedDisplay="False">
<!-- ArcGIS Online Tiled Basemap Layer -->
<esri:ArcGISTiledMapServiceLayer ID="World Topographic Basemap (3857)" x:Name="_worldTopographicBasemap"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
</esri:Map>
If I remove the ArcGISTiledMapServiceLayer above the sample no longer works. I am not able to see the LocalDynamicMapServiceLayer that I add when starting with an empty map. Why is this? Note: If I create a FeatureLayer from my LocalDynamicMapServiceLayer and add that to the map prior to adding my LocalDynamicMapServiceLayer then the LocalDynamicMapServiceLayer seems to show up. Very strange.
... View more
03-18-2013
01:11 PM
|
0
|
2
|
2344
|
POST
|
Hey Matthew, I'm using the Navigation toolkit control that already contains a Full Extent button. It seems I don't have a problem when I've loaded my layers through an MPK; it seems loading from a shape file has this problem.
... View more
03-18-2013
05:19 AM
|
0
|
0
|
161
|
POST
|
I'm loading a couple of shapefiles into my map. I zoom into the layer and then try to click the Full Extent button, but it only zooms out a little bit, not to full extent. I then click the button one more time and it zooms out a little bit more, and so on until it gets to full extent. Any ideas why this would happen?
... View more
03-15-2013
01:55 PM
|
0
|
2
|
346
|
POST
|
Hi, I have a toolbar item that sets selection mode to Rectangle, and another toolbar item that clears the current selection. When it clears the current selection, I want it to stop allowing me to select, until I press the former toolbar item again. So I have this code:
private void selectTool_Click(object sender, RoutedEventArgs e)
{
if (MapEditor.Select.CanExecute("Keyboard"))
{
MapEditor.SelectionMode = DrawMode.Rectangle;
//MapEditor.Select.Execute("Keyboard");
}
}
private void unselectTool_Click(object sender, RoutedEventArgs e)
{
if (MapEditor.ClearSelection.CanExecute(null))
{
MapEditor.ClearSelection.Execute(null);
//MapEditor.SelectionMode = DrawMode.None;
}
if (MapEditor.CancelActive.CanExecute(null))
{
MapEditor.CancelActive.Execute(null);
}
}
The unselect tool correctly unselects everything, but still allows me to use my mouse to select one more time. When I release the mouse click, I am now in pan-mode. Any ideas?
... View more
03-15-2013
01:44 PM
|
0
|
4
|
501
|
POST
|
This may not be related but we had some problems with local GP tasks intermittently failing on some machines, often returning "Error: 000210 : Cannot create output..." (amongst others). This was related to anti-virus and group policy security settings in our corporate environment. (Everything worked fine in my dev environment, but the same code/data failed elsewhere.) Interesting. The thing is, the tool runs fine if I don't specify the Fields collection. But then the output doesn't contain the fields of the input features; it contains the fields of the schema set in the GPK; which is the problem I'm trying to resolve. Are you running 1.0 or 10.1.1? The upgrade solved a few quirky issues we were having, so might be worth a try. I'm running 10.1.1 already. Also, if you have access to ArcGIS Server, try publishing a GP service and calling that from your Runtime app. (In my case the full AGS GP service worked, when the local GPK failed.) I don't have access to ArcGIS Server right now. Thanks!
... View more
03-15-2013
05:45 AM
|
0
|
0
|
335
|
POST
|
Hi Dominique, sorry for taking so long to respond, but was tied up in something else. I have a toolbar, and on one of its buttons click event handler: if (MapEditor.Select.CanExecute("Keyboard"))
{
MapEditor.SelectionMode = DrawMode.LineSegment;
//MapEditor.Select.Execute("Keyboard");
} When I click the toolbar icon, I can click and drag to draw a line, release the mouse click and nothing happens. Only Rectangle and Point selection modes work, then others do nothing after I release the mouse click.
... View more
03-13-2013
01:44 PM
|
0
|
0
|
304
|
POST
|
Hey Dominique, So this worked for the Rectangle selection tool of the Editor control, but doesn't work with the Line selection tool. Any ideas how to make this work? No features get selected by the line tool. Thanks, George
... View more
03-07-2013
07:22 AM
|
0
|
0
|
304
|
POST
|
Hey Dominique, You had mentioned using ObjectID, what did you mean by that exactly? The problem with my code, apparently, is that I'm adding a feature to the Graphics collection of my layer, but since my layer is OnDemand, whenever I zoom to the region that contains the feature that I added, it seems to be duplicating that feature on top of it, so the selected graphic is hidden. I might be understanding it incorrectly too. This does seem to be happening only if I do this in the Initialized event handler of my layer... If I do this moments after the event has finished, this doesn't happen. I'm able to see my selected graphics.
... View more
03-07-2013
04:14 AM
|
0
|
0
|
293
|
POST
|
Hi Dominique, Can you provide an example of what you're suggesting? I think I understand what you're saying, but not sure. Currently what I was doing was that I would add the graphic returned by the query if it didn't exist in the Graphics collection. But then it looks like the graphic gets duplicated by the layer. Note: this is a dynamic feature layer. var queryTask = new QueryTask(context.Layers.ActiveParcelLayer.Url);
queryTask.ExecuteCompleted += new EventHandler<QueryEventArgs>(queryTask_ExecuteCompleted);
var query = new Query();
query.OutFields.Add("*");
query.Source = layer.Source;
query.ReturnGeometry = true;
query.OutSpatialReference = map.SpatialReference;
query.Where = string.Format("PROP_ID in ({0})", string.Join(",", propIds));
var featureSet = queryTask.Execute(query);
if (featureSet != null)
{
foreach (var feature in featureSet)
{
var propId = GisHelper.GetPropertyId(feature);
var graphic = layer.Graphics.FirstOrDefault(
g => GisHelper.GetPropertyId(g) == propId
);
if (graphic == null)
{
graphic = feature;
layer.Graphics.Add(graphic);
}
graphic.Selected = true;
}
} Any suggestions?
... View more
03-06-2013
12:29 PM
|
0
|
0
|
293
|
Title | Kudos | Posted |
---|---|---|
1 | 11-22-2013 10:46 AM | |
1 | 11-09-2012 11:26 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|