Xamarin Forms Maps - how to refresh/update the map - CustomMap Renderer

前端 未结 4 2065
予麋鹿
予麋鹿 2021-02-06 14:06

If you are searching for a full polylines, pins, tiles, UIOptions (and 3D effects soon) renderings/implementations, you should take a loot at the public github I made at

4条回答
  •  没有蜡笔的小新
    2021-02-06 14:11

    So after lot of searches and, of course, the answer of @Sven-Michael Stübe, you can have your proper maps which works on each platform "Android, iOS, WinPhone". Follow my code, then edit it following the @Sven-Michael Stübe's answer.

    Once you finished everything, it could works (like for @Sven-Michael Stübe), but it also couldn't work (like for me). If it doesn't works, try to change the following code:

    public static readonly BindableProperty RouteCoordinatesProperty =
        BindableProperty.Create>(
            p => p.RouteCoordinates, new List());
    

    by

    public static readonly BindableProperty RouteCoordinatesProperty =
        BindableProperty.Create(nameof(RouteCoordinates), typeof(List), typeof(CustomMap), new List(), BindingMode.TwoWay);
    

    See the documentation for more information about it. (Deprecated implementation)

    Then the code works !

    PS: You can have some troubles with the polyline at the end, which not following the road right, I'm working on it.

    PS2: I'll also make a video to explain how to code your customMap to don't have to install a NuGet package, to be able to edit everything at the end ! (The first one will be in French, the second in English, this post will be edited when the video will be made)

    Thank angain to @Sven-Michael Stübe !! Thank to up his answer as well :)

提交回复
热议问题