Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
938 views
in Technique[技术] by (71.8m points)

xamarin.forms - Xamarin Forms Maps - Custom Pin Images local:CustomMap Error

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

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

1 Reply

0 votes
by (71.8m points)
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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...