Bug 40752 - Map wont show on a Iphone simmulator, but will on a real device
Summary: Map wont show on a Iphone simmulator, but will on a real device
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.2.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-04-28 07:55 UTC by Troels Thisted
Modified: 2016-12-07 19:59 UTC (History)
3 users (show)

Tags: ac
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 for Bug 40752 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Troels Thisted 2016-04-28 07:55:30 UTC
I have submitted the app to the store but it keeps on getting rejected wit this message:

    The map after allowing the location fails.

and with this screenshot:

http://a1687.phobos.apple.com/us/r30/Purple1/v4/9e/2a/1b/9e2a1ba0-e879-27c4-e5d0-e35bf969d855/temp..uhfrtkpb.png?downloadKey3=1461329798_b099a3b2e7182e20e9fd6fea520e2331

I can only reproduce this in a simulator, due to the fact that the map does not work there, if i use it on a real device it works fine. The solution was as follows:

The map cant load the map on the simulator if i do this:

        map = new Map(MapSpan.FromCenterAndRadius(_currentPos, new Distance(15)))
        {
            IsShowingUser = true,
            HeightRequest = 100,
            WidthRequest = 960,
            VerticalOptions = LayoutOptions.FillAndExpand,
            MapType = MapType.Satellite,
        };

all i had to do was to remove MapType and instantiate it outside like below:

        map = new Map(MapSpan.FromCenterAndRadius(_currentPos, new Distance(15)))
        {
            IsShowingUser = true,
            HeightRequest = 100,
            WidthRequest = 960,
            VerticalOptions = LayoutOptions.FillAndExpand,
        };

        map.MapType = MapType.Satilite;
Comment 1 Paul DiPietro [MSFT] 2016-05-02 14:55:27 UTC
This appears to be more specifically occurring if the map is filling the entire screen, at least based on a cursory look. If the map is in a StackLayout with CenterAndExpand or something similar, at least some portion of the map shows.
Comment 2 adrianknight89 2016-12-07 19:56:26 UTC
I tried to duplicate this on iPhone 6 10.1 simulator, but I could not. Can you answer the following?

- Which simulator are you testing it on?
- Did you add Xamarin.FormsMaps.Init(); to FinishedLaunching?
- Did you add 

    <key>NSLocationAlwaysUsageDescription</key>
    <string>Can we use your location</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>We are using your location</string>

to Info.plist?

- What's your position? I tried new Position(37, -122).
- Can you update to 2.3.3.175 and try again?

You could also attach a repro if it's easier.
Comment 3 adrianknight89 2016-12-07 19:59:55 UTC
I also wasn't able to reproduce this on iPad Pro (9.7 inch) 10.1 simulator.