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

Google Maps marker issue

3 Answers 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Konstantin
Top achievements
Rank 1
Konstantin asked on 01 Apr 2019, 01:12 PM
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.

3 Answers, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 01 Apr 2019, 03:39 PM
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
0
Konstantin
Top achievements
Rank 1
answered on 02 Apr 2019, 05:21 AM

Thanks. How can i close discussion?

 

0
Lance | Manager Technical Support
Telerik team
answered on 02 Apr 2019, 02:45 PM
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
Tags
General Discussions
Asked by
Konstantin
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Konstantin
Top achievements
Rank 1
Share this question
or