{"id":2339,"date":"2024-09-05T23:51:42","date_gmt":"2024-09-05T14:51:42","guid":{"rendered":"https:\/\/y42u.net\/tec001\/?p=2339"},"modified":"2024-09-06T23:46:32","modified_gmt":"2024-09-06T14:46:32","slug":"xamrin_maui_map1","status":"publish","type":"post","link":"https:\/\/y42u.net\/tec001\/2024\/09\/05\/xamrin_maui_map1\/","title":{"rendered":"Xamarin\u304b\u3089NetMAUI\u3078\u79fb\u884c\u4e2d(\uff13\uff09:\u5730\u56f3\u79fb\u690d(1)\uff1aCustomPin"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">GeoDiveExa\u306e\u30e1\u30a4\u30f3\u6a5f\u80fd\u3067\u3042\u308b\u5730\u56f3\u306e\u79fb\u690d\u306f\u3001CustomPin\u3084\u80cc\u666f\u5730\u56f3\u3001\u30c7\u30b8\u30bf\u30eb\u30ba\u30fc\u30e0\u6a5f\u80fd\u304c\uff11\u756a\u306e\u554f\u984c\u3067\u3059\u3002\u307e\u305a\u306fCustomPin\u306e\u79fb\u690d\u3092\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"570\" height=\"261\" src=\"https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/08\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-08-23-10.24.19.png?resize=570%2C261&#038;ssl=1\" alt=\"\" class=\"wp-image-2345\" srcset=\"https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/08\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-08-23-10.24.19.png?w=570&amp;ssl=1 570w, https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/08\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-08-23-10.24.19.png?resize=300%2C137&amp;ssl=1 300w, https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/08\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-08-23-10.24.19.png?resize=40%2C18&amp;ssl=1 40w\" sizes=\"(max-width: 570px) 100vw, 570px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\uff11\uff09Map\u306e\u79fb\u690d<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">GeoDiveExa\u306fMark\u4f4d\u7f6e\u3092\u8868\u3059\u30d4\u30f3\u3084\u30bf\u30fc\u30b2\u30c3\u30c8\u3092\u8868\u3059\u30d4\u30f3\u306a\u3069\u8272\u3005\u306a\u30bf\u30a4\u30d7\u306e\u30d4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u80cc\u666f\u5730\u56f3\u3082\u4f7f\u7528\u3057\u3066\u5c45\u305f\u306e\u3067Xamarin\u306e\u5834\u5408\u306fCustomMap\u3092\u4f5c\u6210\u3057CustomRander\u3067iOS\u90e8\u5206\u306e\u5b9f\u88c5\u3092\u884c\u306a\u3063\u3066\u5c45\u307e\u3057\u305f\u304cNetMAUI\u3067\u306fCustomHandler\u306e\u307f\u3067\u5927\u4f53\u306e\u5b9f\u88c5\u306f\u51fa\u6765\u305d\u3046\u3067\u3059\u3002\u958b\u767a\u74b0\u5883\u306e\u30d5\u30a9\u30eb\u30c0\u30fc\u69cb\u9020\u3092\u898b\u3066\u3082\u5b9f\u969b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u898b\u3066\u3082\u968f\u5206\u30b9\u30c3\u30ad\u30ea\u3057\u3066\u304a\u308a\u3001iOS\u90e8\u5206\u3082\u5c11\u306a\u304f\u306a\u3063\u3066\u5c45\u307e\u3059\u306e\u3067\u3001Android\u3078\u306e\u79fb\u690d\u3082Xamarin\u3088\u308aNetMAUI\u304c\u7c21\u5358\u306e\u69d8\u306b\u898b\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\uff11\u2212\uff11\uff09\u95a2\u9023\u30d5\u30a1\u30a4\u30eb\u3068\u30af\u30e9\u30b9\u5bfe\u6bd4<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Map\u95a2\u9023\u30d5\u30a1\u30a4\u30eb\u5bfe\u5fdc\u8868\u3002\u4e00\u756a\u5927\u304d\u306a\u9055\u3044\u306f<strong>CustomMapRenderer<\/strong>\u304c<strong>CustomMapHandler<\/strong>\u306b\u306a\u308b\u4e8b\u3067\u3059\u3002\u307e\u305f<strong>CustomMapHandler<\/strong>\u3092\u4f7f\u3046\u70ba\u306b\u3001MauiProgram.cs\u306bMap\u3068<strong>CustomMapHandler<\/strong>\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u3092\u5ba3\u8a00\u3057\u3066\u5c45\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Xamarin\u306eMap\u95a2\u9023\u90e8\u5206<\/th><th>NetMAUI\u306eMap\u95a2\u9023\u90e8\u5206<\/th><\/tr><\/thead><tbody><tr><td>&lt;CustomMap.cs&gt;<br>    <strong>CustomPin<\/strong>\u3000\u5b9f\u88c5<br>    CustomMAP\u3000\u5b9f\u88c5<\/td><td>&lt;CustomPin.cs&gt;<br>       <strong>CustomPin<\/strong>\u3000\u5b9f\u88c5<\/td><\/tr><tr><td>&lt;CustomMapRenderer.cs&gt;<br>   <strong>CustomMKAnnotationView<\/strong>\u3000\u5b9f\u88c5<br>   <strong>CustomTileOverlay<\/strong>\u3000\u5b9f\u88c5<br>   <strong>CustomMapRenderer<\/strong>\u3000\u5b9f\u88c5<br><\/td><td>&lt;CustomMapClass.cs&gt;<br>    <strong>CustomAnnotation<\/strong>\u3000\u5b9f\u88c5<br>    <strong>CustomTileOverlay<\/strong>\u3000\u5b9f\u88c5<br>    <strong>CustomMapHandler<\/strong>\u3000\u5b9f\u88c5<\/td><\/tr><tr><td>\u306a\u3057<\/td><td>&lt;MauiProgram.cs&gt;<br>    .<strong>UseMauiMaps<\/strong>()   \u5b9f\u884c<br>    .ConfigureMauiHandlers(handlers =&gt;<br> \u3000 {\u3000handlers.AddHandler<br>      &lt;Microsoft.Maui.Controls.Maps.Map, <br>           <strong>CustomMapHandler<\/strong>&gt;();<br>        }); \u5b9f\u884c<br>\u3000\u3000<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\uff12\uff09CustomPin\u306e\u79fb\u690d\uff08\uff11\uff09<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Xamarin\u306eCustomPin\u3092NetMAUI\u306b\u79fb\u690d\u3059\u308b\u306b\u306f\u3001CustomRenderer\u3092CustomHandler\u306b\u3057\u3066\u3002\u3002\u3002\u3068\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u304c\u3001\u4eca\u4e00\u3064\u30d4\u30f3\u3068\u304d\u307e\u305b\u3093\u3002\u306a\u306e\u3067Gemini\u306b\u805e\u3044\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\uff1cgemini\u306e\u56de\u7b54\u4f8b\uff1e\nXamarin.Forms\u304b\u3089.NET MAUI\u306b\u79fb\u884c\u3055\u308c\u305f\u306e\u3067\u3059\u306d\u3002.NET MAUI\u3067\u306f\u3001\u3088\u308a\u67d4\u8edf\u306b\u30ab\u30b9\u30bf\u30e0\u30d4\u30f3\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306b\u3001.NET MAUI\u3067CustomPin\u3092\u5b9f\u88c5\u3059\u308b\u969b\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3068\u89e3\u8aac\u3092\u3044\u304f\u3064\u304b\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\n\nC#\npublic class CustomPin : Pin\n{\n    public CustomPin(string label, double latitude, double longitude, string pinImage)\n    {\n        Label = label;\n        Position = new Position(latitude, longitude);\n        IconImageSource = pinImage;\n    }\n}\n\n&#91;assembly: ExportRenderer(typeof(CustomPin), typeof(CustomPinRenderer))]\nnamespace YourNamespace.iOS\n{\n    public class CustomPinRenderer : ViewRenderer&lt;CustomPin, MKAnnotationView&gt;\n    {\n        protected override void OnElementChanged(ElementChangedEventArgs&lt;CustomPin&gt; e)\n        {\n            base.OnElementChanged(e);\n\n            if (e.NewElement != null)\n            {\n                var annotationView = (MKAnnotationView)Control;\n                annotationView.Image = UIImage.FromFile(\"custom_pin.png\");\n                annotationView.CanShowCallout = true;\n\n                annotationView.Selected += (sender, args) =&gt;\n                {\n                    var customPin = (CustomPin)Element;\n                    \/\/ \u30d4\u30f3\u304c\u30bf\u30c3\u30d7\u3055\u308c\u305f\u6642\u306e\u51e6\u7406\n                    \/\/ \u4f8b: \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\n                    var alert = UIAlertController.Create(\"\u30d4\u30f3\u30bf\u30c3\u30d7\", $\"\u30d4\u30f3\u30e9\u30d9\u30eb: {customPin.Label}\", UIAlertAction.Cancel);\n                    UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(alert, true, null);\n                };\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u3092\u305d\u306e\u307e\u307e\u5b9f\u88c5\u3057\u3066\u3082\u30a8\u30e9\u30fc\u3070\u304b\u308a\u3067\u3059\u3002\u56de\u7b54\u306e\u30bd\u30fc\u30b9\u306fXamarin\u6642\u4ee3\u306e\u7269\u3082\u6df7\u3058\u3063\u3066\u3044\u308b\u69d8\u306a\u611f\u3058\u3067\u3059\u306d\u3002<strong>Position<\/strong>\u304c\u3042\u308b\u3057<strong>assembly<\/strong>\u3082<strong>Renderer<\/strong>\u3082\u3042\u308a\u307e\u3059\u3002\u3044\u304f\u3064\u304b\u805e\u3044\u3066\u307f\u3066\u3082\u6709\u7528\u306a\u30b3\u30fc\u30c9\u30b5\u30f3\u30d7\u30eb\u306f\u51fa\u3066\u304d\u307e\u305b\u3093\u306e\u3067\u3001\u901a\u5e38\u306eGoogle\u691c\u7d22\u3067\u53c2\u8003\u3068\u306a\u308b\u30b5\u30a4\u30c8\u3084\u30b5\u30f3\u30d7\u30eb\u3092\u63a2\u3057\u307e\u3057\u305f\u304c\u3001\u53f3\u5f80\u5de6\u5f80\u3059\u308b\u3070\u304b\u308a\u3067\u3001\u540c\u3058\u69d8\u306a\u4eba\u3005\u304c\u591a\u304f\u5c45\u307e\u3057\u305f\u3002\u7d50\u5c40\u4f7f\u3048\u305f\u306e\u306f\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u306e\u307f\u3067\u3057\u305f\uff08\uff1d\u6709\u6599\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3057\u305f\uff09\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><a href=\"https:\/\/vladislavantonyuk.github.io\/articles\/Customize-map-pins-in-.NET-MAUI\/\">Customize map pins in .NET MAUI<\/a><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">CustomPin\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u30ad\u30fc\u9805\u76ee\u306f\u4ee5\u4e0b\u306e\uff14\u9805\u76ee\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30ad\u30fc\u9805\u76ee<\/th><th>\u5185\u5bb9\u3068\u611f\u60f3<\/th><\/tr><\/thead><tbody><tr><td>\uff11\uff09\u30ab\u30b9\u30bf\u30e0\u30de\u30c3\u30d7\u30cf\u30f3\u30c9\u30e9\u30fc\u3092\u767b\u9332\u3059\u308b<br>\u4f8b\uff09<br><code>var builder = MauiApp.CreateBuilder();<\/code><br><code> builder.UseMauiApp&lt;App&gt;().UseMauiMaps(); <\/code><br><code>builder.ConfigureMauiHandlers(handlers =&gt; { handlers.AddHandler&lt;Microsoft.Maui.Controls.Maps.Map, CustomMapHandler&gt;();  });<\/code><\/td><td>\u30de\u30c3\u30d7\u306e\u52d5\u4f5c\u30a4\u30d9\u30f3\u30c8\u3092\u5909\u66f4\u3057\u3066Pin\u306e\u753b\u50cf\u3092\u8a2d\u5b9a\u3059\u308b\u306e\u3067\u3001\u305d\u306e\u30cf\u30f3\u30c9\u30e9\u30fc\u3092\u8a2d\u5b9a\u3057\u306a\u3044\u3068\u3001CustomMapHandler\u52d5\u4f5c\u81ea\u4f53\u304c\u3067\u304d\u306a\u3044\u3002\u3053\u306e\u70b9\u304c\u691c\u7d22\u3057\u3066\u3082AI\u306b\u805e\u3044\u3066\u3082\u306a\u304b\u306a\u304b\u51fa\u3066\u3053\u306a\u3044\u306e\u3067\u3001\u307f\u3093\u306a\u82e6\u52b4\u3057\u3066\u3044\u308b\u70b9\u306a\u306e\u3067\u3057\u3087\u3046\u3002<\/td><\/tr><tr><td>\uff12\uff09Pin\u306b\u30a4\u30e1\u30fc\u30b8\u60c5\u5831\u3092\u4ed8\u52a0\u3059\u308b\u70ba\u306bCustomPin\u3092\u4f5c\u6210\u3059\u308b<br>\u4f8b\uff09<br><code>public class CustomPin : Pin { public static readonly BindableProperty ImageSourceProperty = BindableProperty.Create(nameof(ImageSource), typeof(ImageSource), typeof(CustomPin);<br><br>public ImageSource? ImageSource { get =&gt; (ImageSource?)GetValue(ImageSourceProperty); set =&gt; SetValue(ImageSourceProperty, value); } }<\/code><\/td><td>\u30a4\u30e1\u30fc\u30b8\u60c5\u5831\uff08ImageSource)\u3092\u8ffd\u52a0\u3057\u305fCustomPin\u3092\u4f5c\u6210\u3059\u308b\u306e\u306f\u666e\u901a\u306e\u4e8b\u3068\u3057\u3066\u7d0d\u5f97\u3044\u304d\u307e\u3059\u3002<\/td><\/tr><tr><td>\uff13\uff09Map.Pins\u306bCustomPin\u3092\u8ffd\u52a0\u3059\u308b\u3068\u3001Pins\u306ePropertyChanged\u30a4\u30d9\u30f3\u30c8\u304c\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3055\u308c\u308b\u3067\u3001\u305d\u308c\u3092\u53d7\u3051\u53d6\u308b\u70ba\u306b<code>PropertyMapper<\/code>\u3092CustomMapHandler\u306b\u8ffd\u52a0\u3059\u308b\u3002<br>\u4f8b\uff09\u4f8b\u3067\u306fMap.Pins\u306e\u5909\u66f4\u30a4\u30d9\u30f3\u30c8\u3067\u95a2\u6570<strong>MapPins<\/strong>\u3092\u5b9f\u884c\u3059\u308b\u69d8\u306b\u3057\u3066\u3044\u307e\u3059\u3002<br><code>public static readonly IPropertyMapper&lt;IMap, IMapHandler&gt; CustomMapper = new PropertyMapper&lt;IMap, IMapHandler&gt;(Mapper) { [nameof(IMap.Pins)] = MapPins, };<\/code><\/td><td>\u3053\u3053\u3082\u5d4c\u308b\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u306d\u3002\u7279\u306b\u8a2d\u5b9a\u305b\u305a\u3068\u3082<strong>Map.Pins<\/strong>\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u5b9f\u884c\u3055\u308c\u308b\u306a\u3093\u3066\u3001\u3069\u3053\u306b\u66f8\u3044\u3066\u3042\u308b\u306e\u304b\uff1f(=\u77e5\u3063\u305f\u5f8c\u306b\u8abf\u3079\u308b\u3068\u78ba\u304b\u306b\u3042\u308a\u307e\u3057\u305f\u304c\u3001PropertyChanged\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3059\u308b\u3068\u306f\u66f8\u3044\u3066\u3042\u308a\u307e\u305b\u3093\u3002\u3002\u3002\u304c\u3001<strong>\u5e38\u8b58<\/strong>\u306a\u306e\u3067\u3059\u306d\uff09\u3002<br>\u3053\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u6700\u521d\u304b\u3089\u3042\u308b\u306e\u3067\u3001\u7279\u5225\u306b\u4f5c\u308b\u5fc5\u8981\u3082\u306a\u3044\u306e\u304c\u3001\u8ff7\u308f\u305b\u308b\u70b9\u3067\u3059\u306d\u3002<br>\u5f8c\u306f\u3001\u3053\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u6a2a\u53d6\u308a\u3057\u3066<strong>MapPins<\/strong>\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/td><\/tr><tr><td>\uff14\uff09Pins\u306ePropertyChanged\u3092CustomMapHandler\u306e<strong>MapPins<\/strong>\u3067\u5224\u5b9a\u3057\u3066\u3001\u30a4\u30e1\u30fc\u30b8\u3092\u8a2d\u5b9a\u3059\u308b\u4e8b\u306b\u3088\u308a\u30ab\u30b9\u30bf\u30e0\u30d4\u30f3\u3092\u4f5c\u6210\u3059\u308b\u3002<\/td><td>MapPins\u3067\u3001map.Pins\u306e\u30c7\u30fc\u30bf(CustomPin)\u3092\u53d6\u5f97\u3057\u3066\u3001\u5f8c\u306f\u81ea\u7531\u306biOS\u306eMap\u7528\u306e<code><strong>MKAnnotation<\/strong><\/code>\u3092\u4f5c\u6210\u3059\u308c\u3070\u30ab\u30b9\u30bf\u30e0\u30d4\u30f3\u306e\u51fa\u6765\u4e0a\u304c\u308a\u3067\u3059\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u65b9\u6cd5\u3067CustomPin\u3092\u4f5c\u6210\u3057\u3066GeoDiveExa\u3067\u4f7f\u7528\u3057\u3066\u3044\u308bPin\u306e\u63cf\u753b\u304c\u3067\u304d\u308b\u69d8\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\uff13\uff09CustomPin\u306e\u79fb\u690d\uff08\uff12\uff09<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">CustomPin\u306f\u4e00\u5fdc\u3067\u304d\u307e\u3057\u305f\u304c\u3001\u4e0a\u8a18\u306e\u30d5\u30ed\u30fc\u3067\u306fPins=List&lt;CustomPin&gt;\u306e\u5909\u66f4\u30a4\u30d9\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u30ab\u30b9\u30bf\u30e0\u30d4\u30f3\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u70ba\u306b\u3001\u6bce\u56de\u5168\u90e8\u306e<code><strong>MKAnnotation<\/strong><\/code>\u3092\u6d88\u3057\u3066\u304b\u3089\u4f5c\u6210\u3057\u3066\u3044\u308b\u30d5\u30ed\u30fc\u306a\u306e\u3067<strong>\u975e\u52b9\u7387<\/strong>\u3067\u3057\u305f\u3002<br>GeoDiveExa\u306e\u52d5\u4f5c\u3067\u306fCustomPin\u306e<strong>\u8ffd\u52a0<\/strong>\u3068\u3001\u4ee5\u524d\u4f5c\u6210\u3057\u305fCustomPin\u306e<strong>\u4ea4\u63db<\/strong>\u306e\u307f\u3067\u3059\uff08\uff1d\u524a\u9664\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u901a\u5e38\u52d5\u4f5c\u3067\u53ef\u80fd\u3067\u3059\u304b\u3089\u8003\u616e\u3057\u307e\u305b\u3093\uff09\u3002<\/p>\n\n\n\n<div class=\"wp-block-media-text is-stacked-on-mobile is-vertically-aligned-top\"><figure class=\"wp-block-media-text__media\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"586\" height=\"540\" src=\"https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/09\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-09-05-22.44.53.png?resize=586%2C540&#038;ssl=1\" alt=\"\" class=\"wp-image-2378 size-full\" srcset=\"https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/09\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-09-05-22.44.53.png?w=586&amp;ssl=1 586w, https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/09\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-09-05-22.44.53.png?resize=300%2C276&amp;ssl=1 300w, https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/09\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-09-05-22.44.53.png?resize=40%2C37&amp;ssl=1 40w\" sizes=\"(max-width: 586px) 100vw, 586px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p class=\"wp-block-paragraph\">Pin\u306e<strong>\u8ffd\u52a0<\/strong>\u3068<strong>\u4ea4\u63db<\/strong>\u306b\u4f7f\u7528\u3067\u304d\u308b\u69d8\u306a\u30d7\u30ed\u30d1\u30c6\u30a3\u30fc\u304cIMap\u306b\u306a\u3044\u304b\uff1f\uff1f\uff1f\u3068\u8abf\u3079\u307e\u3057\u305f\u304c\u3001\u4f7f\u3048\u305d\u3046\u306a\u7269\u304c\u6709\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u306a\u306e\u3067\u3001\u300c<strong>\u5e38\u8b58<\/strong>\u306e\u72ec\u81ea\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f5c\u6210\u3057\u3066\u3001PropertyChanged\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u751f\u3055\u305b\u3066\u3001CustomMapHandler\u3067\u6a2a\u53d6\u308a\u300d\u3059\u308b\u4e8b\u306b\u3057\u307e\u3059\uff08\uff1d\u3053\u308c\u306f\u3001NetMAUI\u306e\u304a\u4f5c\u6cd5\u306b\u5247\u3063\u3066\u3044\u308b\u65b9\u6cd5\u3068\u306f\u8a00\u3048\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3082\u3063\u3068\u6839\u6e90\u7684\u306a<strong>\u5e38\u8b58<\/strong>\u306a\u306e\u3067\u826f\u3057\u3068\u3057\u307e\u3057\u3087\u3046\uff09\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>CustomPin\u306e\u4fee\u6b63<\/th><th>\u5185\u5bb9<\/th><\/tr><\/thead><tbody><tr><td>\uff11\uff09MapViewModel\u306b<strong>AddNewPin<\/strong>\u3068<strong>ReplacePin<\/strong>\u3092\u4f5c\u6210\u3059\u308b<\/td><td>PropertyChanged\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\u5909\u6570\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/td><\/tr><tr><td>\uff12\uff09<strong>AddNewPin<\/strong>\u3068<strong>ReplacePin<\/strong>\u306eset\u306b<strong>OnPropertyChanged<\/strong>\u3092\u8ffd\u52a0\u3059\u308b\u3002<br>\u4f8b\uff09<br><code>private CustomPin _addNewPin; public CustomPin AddNewPin { get =&gt; _addNewPin; set { if (_addNewPin != value) { _addNewPin = value; OnPropertyChanged(); } } }<\/code><\/td><td>\u5909\u6570\u306b\u5024\u3092\u8a2d\u5b9a\u3057\u305f\u3089PropertyChanged\u30a4\u30d9\u30f3\u30c8\u5b9f\u884c\u3057\u307e\u3059\u3002<\/td><\/tr><tr><td>\uff13\uff09CustomMapHandler\u3067<strong>AddNewPin<\/strong>\u3068<strong>ReplacePin<\/strong>\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u3001MapViewModel\u306e<strong>PropertyChanged<\/strong>\u30a4\u30d9\u30f3\u30c8\u3092CustomMapHandler\u306e<strong>OnMapViewModelPropertyChanged<\/strong>\u306b\u5bfe\u5fdc\u3065\u3051\u308b\u3002<br>\u4f8b\uff09<br><code>\/\/ CustomPin\u7528 MapViewModel.PropertyChanged += OnMapViewModelPropertyChanged;<\/code><\/td><td>\u5e38\u8b58\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u30fc\u30c1\u30a7\u30f3\u30b8\u30a4\u30d9\u30f3\u30c8\u3092\u3068\u306b\u304b\u304fCustomMapHandler\u5185\u3067\u51e6\u7406\u3067\u304d\u308b\u69d8\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/td><\/tr><tr><td>\uff14\uff09<strong>OnMapViewModelPropertyChanged<\/strong>\u3067PropertyName\u3092\u6bd4\u8f03\u3057\u3066\u3001<strong>AddNewPin<\/strong>\u306a\u3089<strong>MapAddNewPin<\/strong>\u3092\u5b9f\u884c\u3059\u308b\u3002<br><strong>ReplacePin<\/strong>\u306a\u3089<strong>MapReplacePin<\/strong>\u3092\u5b9f\u884c\u3059\u308b\u3002<\/td><td>\u3053\u308c\u3067\uff11\u3064\u306eCustomPin\u306e\u8ffd\u52a0\u3084\u3001\u5909\u66f4\u3092\u81ea\u7531\u306b\u884c\u3048\u307e\u3059\u306e\u3067<strong>\u52b9\u7387\u7684<\/strong>\u3067\u3059\u3002<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">\u52dd\u624b\u306bProperty\u4f5c\u3063\u3066\u3001\u81ea\u7531\u306b\u6a5f\u80fd\u62e1\u5f35\u3059\u308b\uff1d\u4f55\u3067\u3082\u3067\u304d\u305d\u3046<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\uff14\uff099\u6708\u521d\u3081\u306e\u79fb\u690d\u5730\u56f3\u753b\u9762<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u79fb\u52d5Pin\u3082\u540c\u3058\u69d8\u306b\u8868\u793a\u3055\u308c\u308b\u69d8\u306b\u306a\u308a\u307e\u3057\u305f(=\u5de6\uff1aXamarin\u7248\u3001\u53f3\uff1aNetMAUI\u7248\uff09\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"988\" height=\"1024\" src=\"https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/09\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-09-05-23.40.10.jpg?resize=988%2C1024&#038;ssl=1\" alt=\"\" class=\"wp-image-2379\" srcset=\"https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/09\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-09-05-23.40.10.jpg?resize=988%2C1024&amp;ssl=1 988w, https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/09\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-09-05-23.40.10.jpg?resize=289%2C300&amp;ssl=1 289w, https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/09\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-09-05-23.40.10.jpg?resize=40%2C40&amp;ssl=1 40w, https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/09\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-09-05-23.40.10.jpg?resize=768%2C796&amp;ssl=1 768w, https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/09\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-09-05-23.40.10.jpg?w=1322&amp;ssl=1 1322w\" sizes=\"(max-width: 988px) 100vw, 988px\" \/><figcaption class=\"wp-element-caption\">\u79fb\u52d5Pin\u8868\u793a<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>GeoDiveExa\u306e\u30e1\u30a4\u30f3\u6a5f\u80fd\u3067\u3042\u308b\u5730\u56f3\u306e\u79fb\u690d\u306f\u3001CustomPin\u3084\u80cc\u666f\u5730\u56f3\u3001\u30c7\u30b8\u30bf\u30eb\u30ba\u30fc\u30e0\u6a5f\u80fd\u304c\uff11\u756a\u306e\u554f\u984c\u3067\u3059\u3002\u307e\u305a\u306fCustomPin\u306e\u79fb\u690d\u3092\u884c\u3044\u307e\u3057\u305f\u3002 \uff11\uff09Map\u306e\u79fb\u690d GeoDiveExa\u306fMark\u4f4d\u7f6e\u3092\u8868 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2345,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"common","vkexunit_cta_each_option":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[145,1],"tags":[149,148,147,146],"class_list":["post-2339","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-netmaui","category-uncategorized","tag-custommap","tag-custompin","tag-netmaui","tag-xamarin"],"veu_head_title_object":{"title":"","add_site_title":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/y42u.net\/tec001\/wp-content\/uploads\/2024\/08\/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-08-23-10.24.19.png?fit=570%2C261&ssl=1","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/posts\/2339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/comments?post=2339"}],"version-history":[{"count":7,"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/posts\/2339\/revisions"}],"predecessor-version":[{"id":2390,"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/posts\/2339\/revisions\/2390"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/media\/2345"}],"wp:attachment":[{"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/media?parent=2339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/categories?post=2339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/y42u.net\/tec001\/wp-json\/wp\/v2\/tags?post=2339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}