Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centering the Marker #200

Open
Fedor85 opened this issue Dec 13, 2023 · 0 comments
Open

Centering the Marker #200

Fedor85 opened this issue Dec 13, 2023 · 0 comments

Comments

@Fedor85
Copy link

Fedor85 commented Dec 13, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant