private void StateLayerReaderReadCompleted(object sender, ReadShapesCompletedEventArgs eventArgs)
{
ScaleTransform scaleMap;
scaleMap = new ScaleTransform(1.2, 1.2);
TranslateTransform moveMap;
moveMap = new TranslateTransform(-50, 0);
TransformGroup tg = new TransformGroup();
tg.Children.Add(moveMap);
tg.Children.Add(scaleMap);
RadMap1.RenderTransform = tg;
if (eventArgs.Error != null)
return;
this.LabelLayer.Items.Clear();
HotSpot hotSpot = new HotSpot();
hotSpot.X = 0.5;
hotSpot.Y = 0.5;
foreach (MapShape shape in this.InformationLayer.Items)
{
string name = (string)shape.ExtendedData.GetValue("STATE_NAME");
TextBlock lblState = new TextBlock();
lblState.Text = name;
lblState.FontFamily = new FontFamily("Trebuchet MS");
lblState.FontSize = 9.5;
lblState.FontWeight = FontWeight.FromOpenTypeWeight(750);
if (
(
name.ToLower().Equals("alaska")
)
)
{
//ScaleTransform scaleAK;
//scaleAK = new ScaleTransform(-4.5, -4.5);
//TranslateTransform moveAK;
//moveAK = new TranslateTransform(100, -200);
//TransformGroup tgAK = new TransformGroup();
//tgAK.Children.Add(moveAK);
//tgAK.Children.Add(scaleAK);
//shape.RenderTransform = scaleAK;
TranslateTransform moveTransform;
moveTransform = new TranslateTransform(800, 200);
shape.RenderTransform = moveTransform;
}
This worked for me on a map of Pennsylvania (I could move a county shape this way), but not for Alaska and Hawaii on the us ESRI shapefile. I want to scale down Alaska and move is closer so that its visible and scale up Hawaii and move it as well. The transforms seem to not work at all in this case, but, like I said, worked fine on a PA county.