This is a migrated thread and some comments may be shown as answers.

Scaled MapPinPoint on RadMap

2 Answers 111 Views
Map
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 09 Jan 2013, 02:15 PM
I am building a large facility map that will show facility equipment using a RadMap with bitmaps to portray equipment (computers, printers, etc).  MapPinPoint seems to be the best approach to this.  I can successfully add a MapPinPoint to a RadMap with code like this:

Uri uri = new Uri("/Printer.jpg", UriKind.Relative);

MapPinPoint newMapPoint = new MapPinPoint();
newMapPoint.ImageSource = new BitmapImage(uri);
newMapPoint.Text = "Test";
MapLayer.SetLocation(newMapPoint, new Location(19.70240, -154.08088));
informationLayer.Items.Add(newMapPoint);

This displays the image MapPinPoint with the correct image but introduces a zoom issue.  When I zoom in/out, I need the MapPinPoint to keep its scale.  If I zoom in, the image should get larger and I zoom out the image should get smaller.

How do I accomplish this?  Or, is there a better approach to add image items on the map on the fly and have them scale with zooms?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 14 Jan 2013, 08:51 AM
Hi James,

You can use the MinScale, MaxScale and BaseZoomLevel attachable properties of MapLayer. They can be applied to any framework element and they allow to make the framework element scaleable relatively to the zoom level.
The sample code is below.
Uri uri = new Uri("/Printer.jpg", UriKind.Relative);
 
MapPinPoint newMapPoint = new MapPinPoint();
newMapPoint.ImageSource = new BitmapImage(uri);
newMapPoint.Text = "Test";
MapLayer.SetLocation(newMapPoint, new Location(19.70240, -154.08088));
 
MapLayer.SetMinScale(newMapPoint, 0);
MapLayer.SetMaxScale(newMapPoint, double.PositiveInfinity);
MapLayer.SetBaseZoomLevel(newMapPoint, 10);
 
informationLayer.Items.Add(newMapPoint);

All the best,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
James
Top achievements
Rank 1
answered on 21 Jan 2013, 06:42 PM
This worked great.  Thanks very much.
Tags
Map
Asked by
James
Top achievements
Rank 1
Answers by
Andrey
Telerik team
James
Top achievements
Rank 1
Share this question
or