Skip to content

Centering the Marker #200

@Fedor85

Description

@Fedor85

Hello! I have a few questions about working with maps!

  1. how can I achieve centering of a marker that is being built through ItemTemplate?
    GMapMarker has the property Offset which I can use as an example:

          **GMapMarker marker = new GMapMarker(new PointLatLng(66.4169575018027, 94.25025752215694));
         marker.PropertyChanged += Marker_PropertyChanged;
         Rectangle recShape = new Rectangle
         {
             Width = 15,
             Height = 15,
             Fill = System.Windows.Media.Brushes.BlueViolet
         };
         marker.Shape = recShape;
         marker.Offset = new Point(-recShape.Width / 2, -recShape.Height / 2);**
    

    But how can it be used when filling through ItemTemplate? I tried to track the event PropertyChanged.
    But it works if you precede Shape in the code itself, as in the example above, but it doesn’t work through ItemTemplate!

  2. Using the example above, I set one marker with centering! but the result was not correct:
    image
    and only when you change the size of the form, the marker moves to the right place along the center
    image
    why such strange behavior?
    3)I have a setting
    MapControl.MouseWheelZoomType = GMap.NET.MouseWheelZoomType.MousePositionAndCenter;
    image
    Zoom does not work in this position, although I want to bring the marker closer!How to solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions