<esri:LineSymbol x:Key="MyLineSymbol">
<esri:LineSymbol.ControlTemplate>
<ControlTemplate>
<Path x:Name="Element" Stroke="Orange" StrokeThickness="10" >
<i:Interaction.Behaviors>
<b:PathSymbolBehavior Attributes="{Binding Attributes}" />
</i:Interaction.Behaviors>
</Path>
</ControlTemplate>
</esri:LineSymbol.ControlTemplate>
</esri:LineSymbol>Hi,
Would like to know if multitouch-able Map object is in the pipelline?
i created my own multi-touch behavior attached to the map object and it lags when i add a feature layer... however when i use the mouse, there is no lag.... so i'm guessing my algorithm is doing some heavy processing to get the Map rendered...
thanks
void targetMap_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
{
e.Handled = true;
if (this.targetMap == null) { return; }
if (this.targetMap.Extent == null) { return; }
if ((e.DeltaManipulation.Translation.X == 0) && (e.DeltaManipulation.Translation.Y == 0) && (e.DeltaManipulation.Scale.X == 1)) { return; }
Matrix transformationMatrix = new Matrix();
if ((e.DeltaManipulation.Translation.X != 0) || (e.DeltaManipulation.Translation.Y != 0))
{
transformationMatrix.Translate(-e.DeltaManipulation.Translation.X, -e.DeltaManipulation.Translation.Y);
}
if (!e.IsInertial)
{
if (e.DeltaManipulation.Scale.X != 1)
{
if (targetMap.TouchesCaptured.Count() > 1)
{
transformationMatrix.ScaleAt(1/e.DeltaManipulation.Scale.X, 1/e.DeltaManipulation.Scale.Y, e.ManipulationOrigin.X, e.ManipulationOrigin.Y);
}
}
}
Envelope en = this.targetMap.Extent;
Point screenTopLeft = this.targetMap.MapToScreen(new MapPoint(en.Extent.XMin, en.Extent.YMin));
Point screenBottomRight = this.targetMap.MapToScreen(new MapPoint(en.Extent.XMax, en.Extent.YMax));
Point newScreenTopLeft = transformationMatrix.Transform(screenTopLeft);
Point newScreenBottomRight = transformationMatrix.Transform(screenBottomRight);
MapPoint newMapTopLeft = this.targetMap.ScreenToMap(newScreenTopLeft);
MapPoint newMapBottomRight = this.targetMap.ScreenToMap(newScreenBottomRight);
this.targetMap.Extent = new Envelope(newMapTopLeft, newMapBottomRight);
}