首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Xamarin Forms Maps - Custom Pin Images local:CustomMap错误

Xamarin Forms Maps - Custom Pin Images local:CustomMap错误
EN

Stack Overflow用户
提问于 2021-01-28 05:11:19
回答 1查看 21关注 0票数 0

为什么我的本地:CustomMap错误对不起我是英语初学者,https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/map-pin我的项目名称PTSSRU

代码语言:javascript
复制
    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)));
            }
        }
    }
EN

回答 1

Stack Overflow用户

发布于 2021-01-29 14:02:13

代码语言:javascript
复制
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:\Users\MrC4\source\repos\PTSSRU\PTSSRU\PTSSRU\Views\MapPage.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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65927476

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档