Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

why my local:CustomMap Error sorry i'm beginner in english, https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/map-pin my project name PTSSRU

    xaml code
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 x:Class="PTSSRU.Views.MapPage"            
                 xmlns:local="clr-namespace:PTSSRU;assembly=PTSSRU"             
        
        <local:CustomMap x:Name="customMap"
                         MapType="Street" />
    </ContentPage>
    
    cs code
    using PTSSRU.Custom;
    using System.Collections.Generic;
    using Xamarin.Forms;
    using Xamarin.Forms.Maps;
    
    namespace PTSSRU.Views
    {
        public partial class MapPage : ContentPage
        {       
            public MapPage()
            {
                InitializeComponent();
    
                CustomPin pin = new CustomPin
                {
                    Type = PinType.Place,
                    Position = new Position(37.79752, -122.40183),
                    Label = "Xamarin San Francisco Office",
                    Address = "394 Pacific Ave, San Francisco CA",
                    Name = "Xamarin",
                    Url = "http://xamarin.com/about/"
                };
                customMap.CustomPins = new List<CustomPin> { pin };
                customMap.Pins.Add(pin);
                customMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(37.79752, -122.40183), 
                Distance.FromMiles(1.0)));
            }
        }
    }
question from:https://stackoverflow.com/questions/65927476/xamarin-forms-maps-custom-pin-images-localcustommap-error

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
829 views
Welcome To Ask or Share your Answers For Others

1 Answer

I have finished the map

But I want to change the pin icon.
Error Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 7, position 5. PTSSRU C:UsersMrC4source
eposPTSSRUPTSSRUPTSSRUViewsMapPage.xaml 7
incode
<local:CustomMap x:Name="customMap"
MapType="Street" />
im not sure xmlns:local="clr-namespace:PTSSRU;assembly=PTSSRU" it Correct.
my git hub
https://github.com/s58122519013/Xamarin.Map.git

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...