Google Maps marker issue

4 posts, 0 answers
  1. Konstantin
    Konstantin avatar
    2 posts
    Member since:
    Apr 2019

    Posted 01 Apr Link to this post

    there is a package AutoFac - responsible for creating all the components of the application
    there is a package Cirrious.FluentLayouts.Touch - is responsible for the automatic location (of the type of automatic display) of all displayed components
    there is a package Google.Maps

    this link leads to a issue with a marker - the marker is drawn higher than needed

    When creating a Google Map Controller, and then when using it as a child controller, the marker is drawn incorrectly. And more specifically, then:
    1) create a controller (parent)
    2) this controller has a view with frame with an upper indent of 64 (any value)
    `View.frame = ((0, 64), (width, height))`
    3) create a controller with google maps
    4) create mapview 
    `mapView = new MapView(new CGRect(0, 0, parentView.Frame.Width, parentView.Frame.Height))`
    5) add a controller with google maps to the parent
    `parentController.AddChildViewController(googleMapsViewController)`
    6) add a view of google maps to the parent controller
    `parentController.Add(mapView)`
    `parentView.AddConstraints(mapView.FullSizeOf(parentView))`
    7) inside the controller with google maps initiate display a marker
    ```
    var mapCenter = new CGPoint(mapView.Center.X, mapView.Center.Y);
    var mapCenterCoordinate = mapView.Projection.CoordinateForPoint(mapCenter);

    var googleMarker = new Marker()
                {
                    Title = "title",
                    Snippet = "someText",
                    Position = mapCenterCoordinate,
                    Icon = ...someImage,
                    Tappable = true,
                    Map = mapView
                };
    ```
    8) the marker is displayed incorrectly (empirically found that the readout of the Y coordinate comes from 0 and not from 64 as expected)

    When creating a mapview with a frame with an upper indent of 64, the marker is drawn correctly, but then inside the map delegate the position definition is shifted along the Y axis by the same 64 points.
  2. Lance | Technical Support Engineer, Principal
    Admin
    Lance | Technical Support Engineer, Principal avatar
    1002 posts

    Posted 01 Apr Link to this post

    Hello Konstantin,

    I think you may have ended up on the wrong forum. This forum is focused on the Telerik UI for Xamarin  components. I don't see any Telerik controls, or problems with a Telerik API, in that implementation.

    You should re-post this on the Xamarin Forums or StackOverflow to get support for general Xamarin development problems.

    Thank you for your understanding and good luck!

    Regards,
    Lance | Technical Support Engineer, Principal
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Konstantin
    Konstantin avatar
    2 posts
    Member since:
    Apr 2019

    Posted 02 Apr Link to this post

    Thanks. How can i close discussion?

     

  4. Lance | Technical Support Engineer, Principal
    Admin
    Lance | Technical Support Engineer, Principal avatar
    1002 posts

    Posted 02 Apr Link to this post

    Hi Konstantin,

    You can mark my last post "As Answer", this will close the thread. Alternatively, if there is 7 days of inactivity, the thread will automatically close.

    Note that because this is a public forum thread, it will remain in the forums for other to read in case they were looking for a similar answer. Thank you for for you understanding.

    Regards,
    Lance | Technical Support Engineer, Principal
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top