Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143698 | Apr 1,2019 01:08 PM UTC | Apr 3,2019 06:56 AM UTC | Xamarin.iOS | 2 |
![]() |
Tags: SfMaps |
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.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.