Bug 27418 - [iOS] Map.VisibleRegion in a custom renderer remains null using Google Maps
Summary: [iOS] Map.VisibleRegion in a custom renderer remains null using Google Maps
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.4
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-02-25 12:04 UTC by Dominic N [MSFT]
Modified: 2015-03-02 09:06 UTC (History)
6 users (show)

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

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:

Description Dominic N [MSFT] 2015-02-25 12:04:45 UTC
## Overview

We have a report of an issue in Forms for iOS when using Google Maps. A custom renderer has been created and Map.VisibleRegion is called, but remains null on iOS.

I have confirmed this issue. Putting a breakpoint on line 77 of the App.cs file will allow you to observe the value of VisibleRegion when the 'Marker' button in the app is clicked. On Android, the value is 'Xamarin.Forms.Maps.MapSpan' while on iOS is it simply 'null'.

## Steps to reproduce

1. Download sample app
2. Run on an Android device/emulator set up with Google Play Services
3. Click on 'Marker'
4. Break point at line 77 should be hit: check value of VisibleRegion on line 79
5. Run on iOS
6. Click on 'Marker'
7. Break point at line 77 should be hit: check value of VisibleRegion on line 79

## Expected results

Value of VisibleRegion should be the same in both iOS and Android (Xamarin.Forms.Maps.MapSpan)

## Actual results

Value of VisibleRegion is 'null' on iOS and 'Xamarin.Forms.Maps.MapSpan' on Android
Comment 2 Udham Singh 2015-02-26 06:57:39 UTC
I have checked this issue with the help of test steps given in bug description and able to reproduce the reported behaviour. Please refer the screencast : http://www.screencast.com/t/6czO8hY039a

iOS Device Log : https://gist.github.com/Udham1/9cdefb53cd0ffa3e8104
Ide Logs : https://gist.github.com/Udham1/b927a2ec101b7237e0e1
iOS Designer Log : https://gist.github.com/Udham1/01d42a20476a364dcdb4

Environment Info : 

Xamarin.Forms :

=== Xamarin Studio ===

Version 5.7.2 (build 7)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
	Mono 3.12.0 ((detached/b8f5055)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000077

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 862702c
Build date: 2015-02-18 15:19:23-0500

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/xamarin76/Desktop/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 507020007
Git revision: dcf3f486177d3e625349b51a8f3be807e3fa7712
Build date: 2015-02-24 09:14:27-05
Xamarin addins: ea7c65bb7876e4a876ab365208e94acdf8f330ef

=== Operating System ===

Mac OS X 10.9.5
Darwin Xamarin76s-Mac-mini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 3 Jason Smith [MSFT] 2015-03-02 09:06:37 UTC
On iOS the custom renderer is derived from ViewRenderer and not MapRenderer. This means it is the job of the renderer to update all and any properties needed. You probably mean to derive from MapRenderer.

On Android you are calling SetNativeControl needlessly. The Control is set up for you by the renderer.