{"id":1186,"date":"2023-11-24T13:00:00","date_gmt":"2023-11-24T04:00:00","guid":{"rendered":"https:\/\/avancesys.co.jp\/laboratory\/?post_type=article&#038;p=1186"},"modified":"2023-11-24T16:47:55","modified_gmt":"2023-11-24T07:47:55","slug":"android%e7%94%a8mapbox-maps-sdk%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e5%9c%b0%e5%9b%b3%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b","status":"publish","type":"article","link":"https:\/\/www.avancesys.co.jp\/laboratory\/article\/android%e7%94%a8mapbox-maps-sdk%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e5%9c%b0%e5%9b%b3%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b\/","title":{"rendered":"Android\u7528Mapbox Maps SDK\u3092\u4f7f\u3063\u3066\u5730\u56f3\u3092\u8868\u793a\u3059\u308b"},"content":{"rendered":"\n<p>\u3053\u3093\u306b\u3061\u306f\u3002HA\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306fMapbox\u306eMaps SDK for Android\u3092\u4f7f\u7528\u3057\u3066\u3001<\/p>\n\n\n\n<p>\u5730\u56f3\u3092\u8868\u793a\u3059\u308bAndroid\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3059\u308b\u307e\u3067\u306e\u6d41\u308c\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-1 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<figure class=\"wp-block-pullquote has-border-color has-vivid-cyan-blue-border-color\"><blockquote><p>\u958b\u767a\u74b0\u5883<\/p><\/blockquote><\/figure>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>PC<\/td><td>Windows 10 Pro 64bit<\/td><\/tr><tr><td>Android Studio<\/td><td>2021.3.1 Patch 1<\/td><\/tr><tr><td>Mapbox SDK<\/td><td>Mapbox Maps SDK v10<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-pullquote has-border-color has-vivid-cyan-blue-border-color\"><blockquote><p>MapboxSDK\u306e\u5c0e\u5165<\/p><\/blockquote><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">1.\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u306e\u53d6\u5f97<\/h2>\n\n\n\n<p>Mapbox\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3066\u4ee5\u4e0b\u306e\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30d1\u30d6\u30ea\u30c3\u30af\u30c8\u30fc\u30af\u30f3<\/li>\n\n\n\n<li>\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30c8\u30fc\u30af\u30f3<\/li>\n<\/ul>\n\n\n\n<p>\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30c8\u30fc\u30af\u30f3\u3092\u4f5c\u6210\u3059\u308b\u969b\u306b<strong>DOWNLOAD:READ<\/strong>\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">2.<strong><strong>\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30c8\u30fc\u30af\u30f3\u306e\u8a2d\u5b9a<\/strong><\/strong><\/h2>\n\n\n\n<p>MapboxSDK\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30c8\u30fc\u30af\u30f3\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>MAPBOX_SECRET_TOKEN<\/strong>\u3092\u53d6\u5f97\u3057\u305f\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30c8\u30fc\u30af\u30f3\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-file=\"gradle.properties\" data-show-lang=\"0\"><code>MAPBOX_DOWNLOADS_TOKEN=MAPBOX_SECRET_TOKEN<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">3.\u30d1\u30d6\u30ea\u30c3\u30af\u30c8\u30fc\u30af\u30f3<strong><strong>\u306e\u8a2d\u5b9a<\/strong><\/strong><\/h2>\n\n\n\n<p>\u30d1\u30d6\u30ea\u30c3\u30af\u30c8\u30fc\u30af\u30f3\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>MAPBOX_PUBLIC_TOKEN<\/strong>\u3092\u53d6\u5f97\u3057\u305f\u30d1\u30d6\u30ea\u30c3\u30af\u30c8\u30fc\u30af\u30f3\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-file=\"strings.xml\" data-show-lang=\"0\"><code>&lt;string name=&quot;mapbox_access_token&quot;&gt;MAPBOX_PUBLIC_TOKEN&lt;\/string&gt;<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">4.<strong>Mapbox Maps SDK Android \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><\/h2>\n\n\n\n<p>Mapbox Maps SDK Android \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-file=\"settings.gradle\" data-show-lang=\"0\"><code>dependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        google()\n        mavenCentral()\n        maven {\n            url &#39;https:\/\/api.mapbox.com\/downloads\/v2\/releases\/maven&#39;\n            authentication {\n                basic(BasicAuthentication)\n            }\n            credentials {\n                \/\/ Do not change the username below.\n                \/\/ This should always be `mapbox` (not your username).\n                username = &quot;mapbox&quot;\n                \/\/ Use the secret token you stored in gradle.properties as the password\n                password = MAPBOX_DOWNLOADS_TOKEN\n            }\n        }\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Mapbox Maps SDK for Android\u306e\u4f9d\u5b58\u6027\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-file=\"build.gradle(app)\" data-show-lang=\"0\"><code>dependencies {\n    implementation (&#39;com.mapbox.maps:android:10.4.0&#39;){\n        exclude group: &#39;group_name&#39;, module: &#39;module_name&#39;\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">5.\u5730\u56f3\u306e\u8868\u793a<\/h2>\n\n\n\n<p>layout\u30d5\u30a1\u30a4\u30eb\u306bMapView\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-file=\"fragment_map_view.xml\" data-show-lang=\"1\"><code>&lt;com.mapbox.maps.MapView\n    android:id=&quot;@+id\/mapView&quot;\n    android:layout_width=&quot;match_parent&quot;\n    android:layout_height=&quot;match_parent&quot;\/&gt;<\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"1024\" src=\"https:\/\/avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/MapViewFragment-461x1024.png\" alt=\"\" class=\"wp-image-1197\" srcset=\"https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/MapViewFragment-461x1024.png 461w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/MapViewFragment-135x300.png 135w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/MapViewFragment-768x1707.png 768w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/MapViewFragment-691x1536.png 691w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/MapViewFragment-922x2048.png 922w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/MapViewFragment.png 1080w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/figure><\/div>\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-pullquote has-border-color has-vivid-cyan-blue-border-color\"><blockquote><p>\u5b9f\u88c5<\/p><\/blockquote><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u73fe\u5728\u4f4d\u7f6e\u306e\u8868\u793a<\/h2>\n\n\n\n<p>&nbsp;<strong>\u4f4d\u7f6e\u60c5\u5831\u306e\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<p>location2Plugin\u3067\u4f4d\u7f6e\u60c5\u5831\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>enabled\u3092true\u306b\u3057\u3066\u3001\u73fe\u5728\u4f4d\u7f6e\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u8868\u793a\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>locationPuck\u3067\u73fe\u5728\u4f4d\u7f6e\u306e\u30a2\u30a4\u30b3\u30f3\u304c\u8a2d\u5b9a\u51fa\u6765\u307e\u3059\u3002createDefault2DPuck<strong>()<\/strong>\u3092\u4f7f\u7528\u3059\u308b\u3068\u4e0b\u8a18\u753b\u50cf\u306e\u30a2\u30a4\u30b3\u30f3\u304c\u9069\u7528\u3055\u308c\u307e\u3059\u3002topImage\u3001shadowImage\u3001bearingImage\u306e\u8981\u7d20\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u3066\u4efb\u610f\u306b\u5909\u66f4\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-show-lang=\"0\"><code>binding.mapView.location2\n    .apply {\n        updateSettings {\n            this.enabled = true\n            locationPuck = createDefault2DPuck(requireContext(), true)\n        }\n        addOnIndicatorPositionChangedListener(onIndicatorPositionChangedListener)\n    }<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>\u73fe\u5728\u4f4d\u7f6e\u66f4\u65b0\u30a4\u30d9\u30f3\u30c8<\/strong><\/p>\n\n\n\n<p>\u73fe\u5728\u4f4d\u7f6e\u306e\u60c5\u5831\u304c\u53d6\u5f97\u51fa\u6765\u307e\u3059\u3002<br>\u73fe\u5728\u4f4d\u7f6e\u304c\u4e2d\u5fc3\u3068\u306a\u308b\u3088\u3046\u306b\u753b\u9762\u304c\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-show-lang=\"0\"><code>private val onIndicatorPositionChangedListener = OnIndicatorPositionChangedListener { -&gt; point\n    binding.mapView.getMapboxMap().setCamera(CameraOptions.Builder().zoom(14.0).center(point).build())\n    binding.mapView.gestures.focalPoint = binding.mapView.getMapboxMap().pixelForCoordinate(point)\n}<\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"1024\" src=\"https:\/\/avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationViewFragment-461x1024.png\" alt=\"\" class=\"wp-image-1196\" srcset=\"https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationViewFragment-461x1024.png 461w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationViewFragment-135x300.png 135w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationViewFragment-768x1707.png 768w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationViewFragment-691x1536.png 691w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationViewFragment-922x2048.png 922w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationViewFragment.png 1080w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/figure><\/div>\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c7\u30d0\u30a4\u30b9\u306e\u5411\u304d\u3068\u30de\u30c3\u30d7\u306e\u5411\u304d\u306e\u540c\u671f<\/h2>\n\n\n\n<p>&nbsp;<strong>\u4f4d\u7f6e\u60c5\u5831\u306e\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<p>puckBearingSource\u3067bearingImage\u306e\u5411\u304d\u304c\u5236\u5fa1\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>HEADING\uff1a\u30c7\u30d0\u30a4\u30b9\u304c\u5411\u3044\u3066\u3044\u308b\u65b9\u5411\u306b\u5408\u308f\u305b\u3066\u5411\u304d\u3092\u5909\u3048\u308b\u3002<\/li>\n\n\n\n<li>COURSE\uff1a\u30c7\u30d0\u30a4\u30b9\u306e\u9032\u884c\u65b9\u5411\u306b\u5408\u308f\u305b\u3066\u5411\u304d\u3092\u5909\u3048\u308b\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-show-lang=\"0\"><code>binding.mapView.location2\n    .apply {\n        updateSettings {\n            this.enabled = true\n            locationPuck = createDefault2DPuck(requireContext(), true)\n        }\n        puckBearingSource = PuckBearingSource.HEADING\n        addOnIndicatorPositionChangedListener(onIndicatorPositionChangedListener)\n        addOnIndicatorBearingChangedListener(onIndicatorBearingChangedListener)\n    }<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>\u4f4d\u7f6e\u60c5\u5831\u306ePlugin\u306b\u3064\u3044\u3066<br><\/strong>\u4f4d\u7f6e\u60c5\u5831\u306ePlugin\u306f&nbsp;<strong>location<\/strong>&nbsp;\u3068&nbsp;<strong>location2<\/strong>&nbsp;\u306e2\u3064\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br>bearing\u306e\u5236\u5fa1\u306f&nbsp;<strong>location<\/strong>\u3060\u3068\u7cbe\u5ea6\u304c\u60aa\u3044\u305f\u3081<strong>location2<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>\u30b8\u30a7\u30b9\u30c1\u30e3\u30fc\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<p>\u30b8\u30a7\u30b9\u30c1\u30e3\u30fc\u64cd\u4f5c\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>rotateEnabled\u3092false \u306b\u3057\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u64cd\u4f5c\u306b\u3088\u308b\u753b\u9762\u306e\u56de\u8ee2\u3092\u7121\u52b9\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-show-lang=\"0\"><code>binding.mapView.gestures\n    .apply {\n        rotateEnabled = false\n    }<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>\u30c7\u30d0\u30a4\u30b9\u306e\u5411\u304d\u66f4\u65b0\u30a4\u30d9\u30f3\u30c8<\/strong><\/p>\n\n\n\n<p>\u30c7\u30d0\u30a4\u30b9\u306e\u5411\u304d\u304c\u53d6\u5f97\u51fa\u6765\u307e\u3059\u3002<br>\u753b\u9762\u306e\u5411\u304d\u3092\u30c7\u30d0\u30a4\u30b9\u306e\u5411\u304d\u306b\u5408\u308f\u305b\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-show-lang=\"0\"><code>private val onIndicatorBearingChangedListener = OnIndicatorBearingChangedListener { bearing -&gt;\n    binding.mapView.getMapboxMap().setCamera(CameraOptions.Builder().bearing(bearing).build())\n}<\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"1024\" src=\"https:\/\/avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationBearingViewFragment-461x1024.png\" alt=\"\" class=\"wp-image-1198\" srcset=\"https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationBearingViewFragment-461x1024.png 461w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationBearingViewFragment-135x300.png 135w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationBearingViewFragment-768x1707.png 768w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationBearingViewFragment-691x1536.png 691w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationBearingViewFragment-922x2048.png 922w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/LocationBearingViewFragment.png 1080w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/figure><\/div>\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30de\u30fc\u30ab\u30fc\u8868\u793a<\/h2>\n\n\n\n<p><strong>\u30de\u30fc\u30ab\u30fc(Bitmap)\u306e\u8868\u793a<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-show-lang=\"0\"><code>val pointAnnotationManager = binding.mapView.annotations.createPointAnnotationManager()\nval point = Point.fromLngLat(longitude, latitude)\nval pointAnnotationOptions = PointAnnotationOptions()\n    .withPoint(point)\n    .withIconAnchor(IconAnchor.CENTER)\n    .withTextAnchor(TextAnchor.TOP_LEFT)\n    .withTextOffset(listOf(1.5, 0.0))\n    .withIconImage(Bitmap)\n    .withDraggable(true)\nval pointAnnotation = pointAnnotationManager.create(pointAnnotationOptions)<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>&nbsp;<strong>\u30d3\u30e5\u30fc\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u8868\u793a<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-show-lang=\"0\"><code>val viewAnnotationManager = binding.mapView.viewAnnotationManager\nviewAnnotationManager.addViewAnnotation(\n    resId = R.layout.XXXXXXX,\n    options = viewAnnotationOptions {\n        geometry(pointAnnotation.point)\n        associatedFeatureId(pointAnnotation.featureIdentifier)\n        anchor(ViewAnnotationAnchor.BOTTOM)\n        offsetY(pointAnnotation.iconImageBitmap?.height)\n    }\n)\n\nItemCalloutViewBinding.bind(view)\n    .apply {\n        XXXXXXX.text = &quot;&quot;\n        XXXXXXX.text = &quot;&quot;\n        ......\n    }<\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"1024\" src=\"https:\/\/avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/PointAnnotationViewFragment_viewAnnotation-461x1024.png\" alt=\"\" class=\"wp-image-1199\" srcset=\"https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/PointAnnotationViewFragment_viewAnnotation-461x1024.png 461w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/PointAnnotationViewFragment_viewAnnotation-135x300.png 135w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/PointAnnotationViewFragment_viewAnnotation-768x1707.png 768w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/PointAnnotationViewFragment_viewAnnotation-691x1536.png 691w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/PointAnnotationViewFragment_viewAnnotation-922x2048.png 922w, https:\/\/www.avancesys.co.jp\/laboratory\/wp-content\/uploads\/2023\/11\/PointAnnotationViewFragment_viewAnnotation.png 1080w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/figure><\/div>\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30aa\u30d5\u30e9\u30a4\u30f3<\/h2>\n\n\n\n<p>\u30b9\u30bf\u30a4\u30eb\u30d1\u30c3\u30af\u3068\u30bf\u30a4\u30eb\u9818\u57df\u3092\u4e8b\u524d\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3001<\/p>\n\n\n\n<p>\u30aa\u30d5\u30e9\u30a4\u30f3\u74b0\u5883\u3067\u3082\u5730\u56f3\u3092\u4f7f\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u30aa\u30d5\u30e9\u30a4\u30f3\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u306e\u6e96\u5099<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-show-lang=\"0\"><code>private val tileStore: TileStore by lazy {\n    TileStore.create().also {\n        it.setOption(\n            TileStoreOptions.MAPBOX_ACCESS_TOKEN,\n            TileDataDomain.MAPS,\n            Value(requireContext().getString(R.string.mapbox_access_token))\n        )\n    }\n}\n\nprivate val resourceOptions: ResourceOptions by lazy {\n    ResourceOptions.Builder().applyDefaultParams(requireContext())\n        .tileStore(tileStore)\n        .build()\n}\n\nprivate val offlineManager: OfflineManager by lazy {\n    OfflineManager(resourceOptions)\n}<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>\u30b9\u30bf\u30a4\u30eb\u30d1\u30c3\u30af\u3068<strong><strong>\u30bf\u30a4\u30eb\u9818\u57df<\/strong><\/strong>\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-show-lang=\"0\"><code>\/\/ \u30b9\u30bf\u30a4\u30eb\u30d1\u30c3\u30af\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\nval stylePackCancelable = offlineManager.loadStylePack(\n    Style.MAPBOX_STREETS,\n    StylePackLoadOptions.Builder()\n        .glyphsRasterizationMode(GlyphsRasterizationMode.IDEOGRAPHS_RASTERIZED_LOCALLY)\n        .metadata(Value(STYLE_PACK_METADATA_ID))\n        .build(),\n    { progress -&gt;\n        \/\/ Downloading style pack\n    },\n    { expected -&gt;\n        if (expected.isValue) {\n            expected.value?.let {\n                \/\/ Style pack download finished successfully\n            }\n        }\n        expected.error?.let { StylePackDownloadError -&gt;\n            \/\/ Handle error occurred during the style pack download.\n        }\n    }\n)\n\n\/\/ \u30b9\u30bf\u30a4\u30eb\u30d1\u30c3\u30af\u3068\u30bf\u30a4\u30eb\u9818\u57df\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\nval tilesetDescriptor = offlineManager.createTilesetDescriptor(\n    TilesetDescriptorOptions.Builder()\n        .styleURI(Style.MAPBOX_STREETS)\n        .minZoom(0)\n        .maxZoom(16)\n        .build()\n)\n\nval tilePackCancelable = tileStore.loadTileRegion(\n    TILE_REGION_ID,\n    TileRegionLoadOptions.Builder()\n        .geometry(point)\n        .descriptors(listOf(tilesetDescriptor))\n        .metadata(Value(TILE_REGION_METADATA_ID))\n        .acceptExpired(true)\n        .networkRestriction(NetworkRestriction.NONE)\n        .build(),\n    { progress -&gt;\n        \/\/ Downloading tile region\n    },\n    { expected -&gt;\n        if (expected.isValue) {\n            expected.value?.let {\n                \/\/ Tile region download finishes successfully\n            }\n        }\n        expected.error?.let { TileRegionDownloadError -&gt;\n            \/\/ Handle error occurred during the tile region download.\n        }\n    }\n)<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong><strong>\u5229\u7528\u53ef\u80fd\u306a\u30b9\u30bf\u30a4\u30eb\u30d1\u30c3\u30af\u3068<strong><strong>\u30bf\u30a4\u30eb\u9818\u57df<\/strong><\/strong>\u306e\u53d6\u5f97<\/strong><\/strong><\/p>\n\n\n\n<p>\u4e8b\u524d\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f<strong><strong>\u30b9\u30bf\u30a4\u30eb\u30d1\u30c3\u30af<\/strong><\/strong>\u3068<strong><strong>\u30bf\u30a4\u30eb\u9818\u57df<\/strong><\/strong>\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\" data-show-lang=\"0\"><code>\/\/ \u5229\u7528\u53ef\u80fd\u306a\u30b9\u30bf\u30a4\u30eb\u30d1\u30c3\u30af\u306e\u53d6\u5f97\nofflineManager.getAllStylePacks { expected -&gt;\n    if (expected.isValue) {\n        expected.value?.let { stylePackList -&gt;\n            \/\/ Available style pack\n        }\n    }\n    expected.error?.let { StylePackCheckError -&gt;\n        \/\/ Error\n    }\n}\n\n\/\/ \u5229\u7528\u53ef\u80fd\u306a\u30bf\u30a4\u30eb\u9818\u57df\u306e\u53d6\u5f97\ntileStore.getTileRegion(TILE_REGION_ID) { expected -&gt;\n    if (expected.isValue) {\n        expected.value?.let { tileRegionList -&gt;\n            \/\/ Available tile region\n        }\n    }\n    expected.error?.let { TileRegionCheckError -&gt;\n        \/\/ Error\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-pullquote has-border-color has-vivid-cyan-blue-border-color\"><blockquote><p>\u307e\u3068\u3081<\/p><\/blockquote><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>Mapbox SDK\u306f\u4e8b\u524d\u306b\u30b9\u30bf\u30a4\u30eb\u30d1\u30c3\u30af\u3068\u30bf\u30a4\u30eb\u9818\u57df\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u3067\u30aa\u30d5\u30e9\u30a4\u30f3\u74b0\u5883\u3067\u5730\u56f3\u304c\u4f7f\u3048\u308b\u70b9\u304c\u7279\u5fb4\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30aa\u30d5\u30e9\u30a4\u30f3\u3067\u5229\u7528\u3067\u304d\u308b\u30e1\u30ea\u30c3\u30c8\u3068\u3057\u3066\u4ee5\u4e0b\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u63a5\u7d9a\u304c\u4e0d\u5b89\u5b9a\u306a\u5834\u6240\u3084\u63a5\u7d9a\u304c\u7121\u3044\u5834\u6240\u3067\u3082\u30de\u30c3\u30d7\u3092\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u30c7\u30fc\u30bf\u901a\u4fe1\u91cf\u3084\u30d0\u30c3\u30c6\u30ea\u30fc\u6d88\u8cbb\u91cf\u3092\u7bc0\u7d04\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u30de\u30c3\u30d7\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u901f\u5ea6\u3084\u5fdc\u7b54\u6027\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u7279\u5fb4\u3092\u305c\u3072\u5730\u56f3\u30a2\u30d7\u30ea\u4f5c\u6210\u306e\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"author":35,"featured_media":1209,"template":"","lc":[12],"lt":[21,15],"class_list":["post-1186","article","type-article","status-publish","has-post-thumbnail","hentry","lc-introduction","lt-gps","lt-smartdevice"],"_links":{"self":[{"href":"https:\/\/www.avancesys.co.jp\/laboratory\/wp-json\/wp\/v2\/article\/1186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.avancesys.co.jp\/laboratory\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/www.avancesys.co.jp\/laboratory\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/www.avancesys.co.jp\/laboratory\/wp-json\/wp\/v2\/users\/35"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.avancesys.co.jp\/laboratory\/wp-json\/wp\/v2\/media\/1209"}],"wp:attachment":[{"href":"https:\/\/www.avancesys.co.jp\/laboratory\/wp-json\/wp\/v2\/media?parent=1186"}],"wp:term":[{"taxonomy":"lc","embeddable":true,"href":"https:\/\/www.avancesys.co.jp\/laboratory\/wp-json\/wp\/v2\/lc?post=1186"},{"taxonomy":"lt","embeddable":true,"href":"https:\/\/www.avancesys.co.jp\/laboratory\/wp-json\/wp\/v2\/lt?post=1186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}