Bug 49554 - MKMapViewDelegate.OverlayRenderer only called initial
Summary: MKMapViewDelegate.OverlayRenderer only called initial
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.3.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Paul DiPietro [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-12-10 16:25 UTC by Christian Schwarz
Modified: 2017-03-21 07:43 UTC (History)
4 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:


Attachments
Reproduction of overlay issue (149.71 KB, application/x-zip-compressed)
2016-12-10 16:25 UTC, Christian Schwarz
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Christian Schwarz 2016-12-10 16:25:56 UTC
Created attachment 18855 [details]
Reproduction of overlay issue

I'm trying to render a polyline overlay on iOS. It works fine if the polyline is added before initialization of the MKMapView, but it doesn't work on a button click after.

Expected:
App()
MapViewRenderer.AddPolyline()
MKMapViewDelegate.OverlayRenderer()
App.AddPolyline()
MapViewRenderer.AddPolyline()
MKMapViewDelegate.OverlayRenderer()

Actual:
App()
MapViewRenderer.AddPolyline()
MKMapViewDelegate.OverlayRenderer()
App.AddPolyline()
MapViewRenderer.AddPolyline()

Please see attached project.
Comment 1 adrianknight89 2016-12-11 15:55:47 UTC
Are you convinced that this is an XF issue but not an issue with the way MKMapView is being set up? I'm not strong in its APIs, but a quick search brings similar issues:

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=mkmapview%20addoverlay%20not%20working
Comment 2 Christian Schwarz 2016-12-11 18:10:46 UTC
As it works initial I'm pretty sure it is set up correct.

The other issues I've found never worked in the beginning, because the forgot to set the map delegate or swapped latitude and longitude.

It also works fine for annotations which calls GetViewForAnnotation on the map delegate (initial and on button click).
Comment 3 Paul DiPietro [MSFT] 2017-03-21 03:29:40 UTC
Have you tested standard X.iOS behavior to see what happens, by chance? I'm not familiar with the API, but if what you're doing acts functionally the same on X.iOS, then I imagine it would be a problem somewhere on that end and not with Forms, especially considering there's some custom renderer/native behavior being used. If you could loop back with any more info it'd be appreciated but I'll set assignment for now just so I can keep an eye on this.
Comment 4 Christian Schwarz 2017-03-21 07:43:35 UTC
This issue can be closed.

I was using a inherited MKPolyline and it seems that after initalization I need to pass the polyline returned from MKPolyline.FromCoordinates instead of my inherited one.