Xamarin.forms.googlemaps: How to display a 'blue dot' of the current position?

Created on 30 Oct 2017  路  12Comments  路  Source: amay077/Xamarin.Forms.GoogleMaps

BUG / PROBREM REPORT

SUMMARY

How to display a 'blue dot' of the current position?

VERSIONS

  • Xamarin.Forms.GoogleMaps - 2.2.1-beta1

PLATFORMS

  • [x] iOS

HOW TO REPRODUCE

  1. By testing the sample solutions / iOS / BasicMapPage

  2. Once we click on the My Location Button we can't see the blue-dot
    (as shows on Google Map via browser) googlemap-bluedot

  3. The sample screen on iOS
    googlemap-ios-emu-screen

All 12 comments

Yhis is a bug reported here: https://github.com/amay077/Xamarin.Forms.GoogleMaps/issues/371 please wait for new version.

I released v2.2.1-beta2.

And you should call Map.MyLocationEnabled = true.
Could you try below code with v2.2.1-beta2?

public partial class BasicMapPage : ContentPage
{
    public BasicMapPage()
    {
        InitializeComponent();

        map.MyLocationEnabled = true;  // <-- added
        map.UiSettings.MyLocationButtonEnabled = true;
    }
}

capture
Still it is not working for me even with v2.2.1-beta2.

Try add MyLocationEnabled = "true" in Xaml.

@deextercz ,
I can not reproduced.
I added below code in XFGoogleMapSample, works fine.

// CustomMap.cs
using System;

namespace XFGoogleMapSample
{
    public class CustomMap : Xamarin.Forms.GoogleMaps.Map
    {
        public CustomMap()
        {
            MyLocationEnabled = true;
            UiSettings.MyLocationButtonEnabled = true;
        }
    }
}
// BasicMapPage.xml
<?xml version="1.0" encoding="UTF-8"?>

<ContentPage
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:cmaps="clr-namespace:XFGoogleMapSample;assembly=XFGoogleMapSample"
    x:Class="XFGoogleMapSample.BasicMapPage"
    Title="BasicMap">
    <ContentPage.Content>
        <cmaps:CustomMap x:Name="map"
                  InitialCameraUpdate="-23.68, -46.87, 13, 30, 60"
                  VerticalOptions="FillAndExpand" />
    </ContentPage.Content>
</ContentPage>
// BasicMapPage.xml.cs
using System;
using System.Collections.Generic;
using System.Linq;

using Xamarin.Forms;
using Xamarin.Forms.GoogleMaps;

namespace XFGoogleMapSample
{
    public partial class BasicMapPage : ContentPage
    {
        public BasicMapPage()
        {
            InitializeComponent();
        }
    }
}

image

Probably it was in some cache, now it is working.

I tried on both on code and xaml = the blue-dot won't show either.

Dear @deextercz //cache? how?

Clean solution helped me to make it works

Not yet testing with the new solution suggested by @deextercz:

Tested on either my solution & sample solutions / iOS / BasicMapPage = still not working

@maniti could you try Android ?

@deextercz : will test / thanks

@amay077 last version (2.2.1) MyLocationEabled works in Android but not in iOS (no blue dot, and no certer if you tap in MyLocationButton)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

idan-rubin picture idan-rubin  路  6Comments

JKennedy24 picture JKennedy24  路  6Comments

Gavrielo picture Gavrielo  路  3Comments

woellij picture woellij  路  4Comments

amay077 picture amay077  路  7Comments