Map Control or Reporting Control?

1 Answer 19 Views
Map
Brian
Top achievements
Rank 1
Brian asked on 18 Aug 2022, 04:09 PM

Hello,  I am developing a RFID RTLS map that uses an API to obtain a floorplan image, zone polygon coordinates and item X/Y location.  I am trying to use the Map control with the LocalMapProvider however the background image is being duplicated when zooming and scrolling.  I understand why this is happening.  Also all of the properties and functions in the map control should work perfectly.  The problem is the background image.  Since I only have a single static image is the Map control the best control to use?  Can I force the map control to not replicate images and force the polygon points XY to start based on the top left of the image?  Mind you the item location will need to be updated in real time so I wasn't sure if using a report viewer would be the ideal solution. 

Thoughts?
Brian

1 Answer, 1 is accepted

Sort by
0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 23 Aug 2022, 10:52 AM

Hello Brian,

Generally speaking, the LocalMapProvider expects you have more than one image. You can imagine it like a puzzle. Every piece will have x y coordinates and z zoom level. Zooming out you will see the whole picture and zooming in you will see only a single piece. As you have only one image, I think the RadMap control won't be the best option here. 

The approach here depends on if you want to add additional elements to the image. If not, you can use our RadPictureBox control which has zooming functionality.

Another option is to use RadDiagram control. You can add the image and place the shape above it if needed at a specific position. You could also check the floor plan example.

You can share some more details regarding your requirements so I can think of a suitable control.

Regards,
Dinko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Brian
Top achievements
Rank 1
commented on 30 Aug 2022, 10:18 PM

Thank you the RadDiagram worked!  I am having one issue though.  Once I draw a polygon using the below routine the focus is captured by the polygon.  When I go to pan or zoom over the zone I am unable to.  What I want is the polygon to not steal the focus and stop the diagram from panning and zooming.   I've tried multiple settings but nothing seems to work.

 

 RadDiagramShape poly = new RadDiagramShape()
                    {
                        Size = map.Data.Size,
                        Shape = new PolyShape(points.ToArray(), zone.Name),
                        BackColor = Color.FromArgb(50, System.Drawing.ColorTranslator.FromHtml(zone.Color)),
                        Visibility = ElementVisibility.Visible,
                        AllowCopy = false,
                        AllowDelete = false,
                        AllowCut = false,
                        AllowDrop = false,
                        AllowPaste = false,
                        IsDraggingEnabled = true,
                        IsEditable = false,
                        IsResizingEnabled = false,
                        IsRotationEnabled = false,
                        IsHitTestVisible = false,
                        IsConnectorsManipulationEnabled = false,
                        CaptureOnMouseDown = false,
                        IsEnabled = false,
                        IsFocusable = false,
                        ShouldHandleMouseInput = false,
                        NotifyParentOnMouseInput = false
                    };
                    
                    uiMap.AddShape(poly, points[0]);
Brian
Top achievements
Rank 1
commented on 30 Aug 2022, 10:36 PM

Disregard I found it.  The CustomPanningTool just needs to null out the HitItem before processing MouseMove.  Thanks again!

Telerik.Windows.Diagrams.Core.ToolService toolService = uiMap.ServiceLocator.GetService<Telerik.Windows.Diagrams.Core.IToolService>() as Telerik.Windows.Diagrams.Core.ToolService;

if (toolService != null)
                        toolService.ToolList[0] = new CustomPanningTool();

uiMap.ActiveTool = Telerik.Windows.Diagrams.Core.MouseTool.PanTool;public class CustomPanningTool : Telerik.Windows.Diagrams.Core.PanningTool
{
    public override bool MouseMove(Telerik.Windows.Diagrams.Core.PointerArgs e)
    {
        if (this.IsActive)
        {
            if (this.HitItem != null )
                this.HitItem = null;
        }

        return base.MouseMove(e);
    }
}
Tags
Map
Asked by
Brian
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or