POST
|
The only operation you can really do with point geometry is to move them. This is why Editor.EditVertices does not make sense to activate on a graphic with point geometry. I agree. It doesn't make sense to use EditVertices for points. But then, what is the proper way for moving points? Are you planning to add an Editor.Move command for points? What you can do is only activate EditVertices for polyline and polygon geometries. And handle the move on point geometries by providing offset to its X,Y values using MouseMove and MouseLeftButtonUp events or you can listen to the next MouseClick that sets the new location of the point geometry. I'll do that as a workaround 😞 Thank you
... View more
05-13-2011
10:27 AM
|
0
|
0
|
321
|
POST
|
If CommandParameter is a graphic, then EditVertices will act only on the specified graphic (Points are not supported in this case). ok but then I'm back to my initial concern: how could I perform check on the graphics (using MapPoints) before EditVertices command is activated?
... View more
05-04-2011
09:56 AM
|
0
|
0
|
321
|
POST
|
Another way to do it is to use a Polygon instead and use an ImageFill that stretches with the polygon (the image contains the text). That way you won't have to do anything to make it scale. That's what I was doing before Dominique's solution. However, because the text is transformed into an image, it looks very bad when zooming in because of stretching.
... View more
05-04-2011
09:33 AM
|
0
|
0
|
441
|
POST
|
If you need to perform check on the graphic before EditVertices command is activated, you can activate EditVertices in code-behind instead.
private void FeatureLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
{
bool canEdit = IsEditAllowed(e.Graphic);
if (canEdit && MyEditor.EditVertices.CanExecute(e.Graphic))
MyEditor.EditVertices.Execute(e.Graphic);
}
This solution works fine except for MapPoints. I'm using a GraphicsLayer. When passing a graphic that uses a MapPoint geometry to the EditVertices command, it doesn't work. However, when passing null and then the user clicks on the graphic, it is possible to move it. This means that the only way to move a MapPoint is to use the EditVertices.Execute(null) with null parameter. Then the user will be able to move the MapPoint using mouse drag and drop. Is this a bug? If this is the expected behaviour, how should I perform check on the graphic before EditVertices command is activated?
... View more
05-04-2011
06:04 AM
|
0
|
0
|
321
|
POST
|
We are considering making EditVertices public like Draw so you can customize the symbols in the future. I think it would be very useful if some kind of event was fired when a graphic entered into edit mode, so us developers could do something with it if we needed to. I totally agree with both features above. This would be a big improvement that would give a lot more flexibility to developers.
... View more
05-03-2011
05:57 AM
|
0
|
0
|
276
|
POST
|
You can fix that by hooking up the same handler to the map event 'ExtentChanging'. Working wonderfully! Thank you
... View more
04-29-2011
05:40 AM
|
0
|
0
|
441
|
POST
|
Merci Dominique, that's exactly what I needed! The only drawback of this method is that the text is re-scaled only when the MapExtend has changed, unlike the other geometries (polygons, lines, etc.) that change gradually as the MapExtend is changing.
... View more
04-29-2011
04:45 AM
|
0
|
0
|
441
|
POST
|
Hi, Because the TextSymbols are a MarkerSymbol (therefore using MapPoints), the text do not scale when zooming in/out. Is there a way to make the text to scale when zooming in/out? Thank you
... View more
04-21-2011
06:26 AM
|
0
|
7
|
1267
|
POST
|
Using Reflector, I discovered that the function I need to call is: ESRI.ArcGIS.Client.FeatureService.Editing.Editor.StopEdit() However it is not exposed in the API: the ESRI.ArcGIS.Client.FeatureService.Editing.Editor class is internal. Any workaround?
... View more
04-13-2011
10:08 AM
|
0
|
0
|
202
|
POST
|
Hi, I'm using the EditVertices command (from the Editor class) with a GraphicsLayer to edit geometries. The CancelActive command allows me to cancel the current edition but is there another command (or any other line of code) that would allow me to stop the edition without cancelling it? The only way to stop the edition is to click on the geometry that is being edited or another geometry but what if I want to stop editing without a user click (e.g. an apply button)? You can easily reproduce this behaviour using this sample. Thank you
... View more
04-11-2011
12:46 PM
|
0
|
3
|
479
|
POST
|
I found a way to do it. It is not really clean, but at least it works... public void MoveUpLayer(Layer layer)
{
int index = Map.Layers.IndexOf(layer);
if (index < 0)
return;
Map.Layers.RemoveAt(index);
Map.Layers.Insert(index - 1, layer);
}
public void MoveDownLayer(Layer layer)
{
int index = Map.Layers.IndexOf(layer);
if (index < 0)
return;
Map.Layers.RemoveAt(index);
Map.Layers.Insert(index + 1, layer);
} I don't know if ArcGIS developers are reading these posts, but they should consider adding SetZIndex and GetZIndex to the Layer class. It would be a lot cleaner...
... View more
03-24-2011
04:58 AM
|
2
|
1
|
1421
|
POST
|
Thank you Brent for your help. You are right: I could also use the MouseRightButtonUp from the Graphics Layer and use the EventArgs to retrieve the graphics information. However, I can't use the Map itself as the UIElement for the PlacementTarget property. The PlacementTarget is the element relative to which the ContextMenu is positioned when it opens. Setting it to the map wouldn't make sense. I'm using the standard ContextMenu class from the .NET Framework. I should also mention that I'm developing a WPF application, not Silverlight.
... View more
03-24-2011
04:51 AM
|
0
|
1
|
744
|
POST
|
I found some ways to do add Context Menus. The easiest way is to add the Context Menu to the Symbol's ControlTemplate. However, when doing this, I haven't found a way to retrieve the Graphic object when executing the Context Menu's Command which is sad because you won't be able to give some context to the Command. The second way is to do it by code by creating your own Graphic class. You won't be able to set the PlacementTarget property because the ArcGIS API doesn't give you access to the corresponding UIElement but it doesn't seem to make any difference since the ContextMenu will show up properly. In addition, by doing it this way, it is very easy to set the CommandParameter to the Graphic object. Here is the code for the second option: class MyGraphic : ESRI.ArcGIS.Client.Graphic
{
public MyGraphic()
{
MouseRightButtonUp += (sender, e) =>
{
ContextMenu contextMenu = BuildContextMenu();
contextMenu.IsOpen = true;
e.Handled = true;
};
}
private ContextMenu BuildContextMenu()
{
ContextMenu contextMenu = new ContextMenu();
BuildContextMenuCore(contextMenu);
return contextMenu;
}
protected virtual void BuildContextMenuCore(ContextMenu contextMenu)
{
contextMenu.Items.Add(new MenuItem
{
Header = "Properties",
CommandParameter = this,
Command = Commands.Map.Properties
});
}
} Please let me know if you find a better way...
... View more
03-23-2011
11:33 AM
|
0
|
1
|
744
|
POST
|
Any idea anybody? This is really annoying. I have two GraphicLayers: GL1 and GL2. The graphics from GL1 are drawn over graphics from GL2 because GL1 is added first to Map Control. How can I control that?
... View more
03-23-2011
10:45 AM
|
1
|
0
|
1421
|
POST
|
Hi, I know about Graphic.SetZIndex and Graphic.GetZIndex. These methods allow to change the Z index of Graphics in a layer. However, these methods don't exist for the Layer itself. How should I control the Z index for all my different GraphicsLayers? It seems to be related to the order in which my layers are added to the map. Thank you
... View more
03-18-2011
01:05 PM
|
1
|
4
|
8293
|
Title | Kudos | Posted |
---|---|---|
1 | 03-23-2011 10:45 AM | |
1 | 03-18-2011 01:05 PM | |
2 | 03-24-2011 04:58 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|