MapBox Android版开发 3 地图样式v9

2024-09-02 15:36

本文主要是介绍MapBox Android版开发 3 地图样式v9,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

MapBox Android版开发 3 地图样式v9

  • 前言
  • MapBox样式对比
  • 主要类和方法
    • Style类
      • Style类成员变量
      • Style类Layer方法
      • 默认的MapBox样式
      • OnStyleLoaded 接口
    • MapboxMap类
      • 获取样式
      • 通过Style.StyleUrl设置样式
      • 通过Style.Builder设置样式
      • Style.Builder
  • 示例代码
    • 地图样式类
    • 界面布局
    • 控件响应事件
    • 运行效果图
  • 附不同样式中的图层

前言

MapBox SDK允许自定义地图的外观。可以选择地图样式,也可以调整地图的颜色、图标和字体来创建自定义地图样式。

有两种方法自定义地图的外观:

  1. 使用Mapbox Studio创建自定义地图样式。
  2. 使用Android版Maps SDK在运行时更新地图功能,并可以动态切换语言,调整标签大小以提高可读性,根据一天中的时间调暗地图,个性化图标和地图颜色。

本文重点介绍MapBox默认的样式,样式相关的类和方法,以及如何动态更新样式并本地化语言。

MapBox样式对比

风格常量说明v9v11
Mapbox StandardSTANDARDA dynamic and performant 3D style that is the default for Mapbox maps.-standard
Mapbox Standard SatelliteSTANDARD_SATELLITECombines updated satellite imagery and vector layers to offer users improved clarity and detail.-standard-satellite
Mapbox StreetsMAPBOX_STREETSA complete base map, perfect for incorporating your own data.streets-v11streets-v12
OutdoorsOUTDOORSA general-purpose style tailored to outdoor activities.outdoors-v11outdoors-v12
LightLIGHTSubtle light backdrop for data visualizations.light-v10light-v11
DarkDARKSubtle dark backdrop for data visualizations.dark-v10dark-v11
SatelliteSATELLITEA beautiful global satellite and aerial imagery layer.satellite-v9satellite-v9
Satellite StreetsSATELLITE_STREETSGlobal satellite and aerial imagery with unobtrusive labels.satellite-streets-v11satellite-streets-v12
Traffic DayTRAFFIC_DAYColor-coded roads based on live traffic congestion data.traffic-day-v2traffic-day-v2
Traffic NightTRAFFIC_NIGHTColor-coded roads based on live traffic congestion data, designed to maximize legibility in low-light situations.traffic-night-v2traffic-night-v2

主要类和方法

Style类

Style对象是指应用程序中使用的Mapbox地图样式。通过Style对象添加将SourceLayerImage添加到地图上。必须设置Style对象地图才能正确显示。如果样式加载失败或设置了无效样式URL,地图视图将变为空白,并触发MapView.OnDidFailLoadingMapListener回调。

地图样式是由多个组件组成的,其中最重要的是数据源 source 和图层 layer

  • source 是地图数据的来源,定义地图上显示的数据类型和数据位置。
  • layer 是地图样式中的可视化组件,定义如何渲染数据源中的数据。
  • 每个图层都引用一个数据源,并指定如何将该数据源中的数据绘制到地图上。
  • 一个数据源可以被多个图层引用,从而实现数据的复用和多层次的展示。
  • 通过组合不同的数据源和图层,可以创建出丰富多样的地图样式。

Style类成员变量

public class Style {static final String EMPTY_JSON = "{\"version\": 8,\"sources\": {},\"layers\": []}";private final NativeMap nativeMap;private final HashMap<String, Source> sources = new HashMap<>();private final HashMap<String, Layer> layers = new HashMap<>();private final HashMap<String, Bitmap> images = new HashMap<>();private final Builder builder;private boolean fullyLoaded;......
}

Style类Layer方法

类型方法说明
LayergetLayer(@NonNull String id)Get the layer by id
List< Layer >getLayers()Retrieve all the layers in the style
< T extends Layer > TgetLayerAs(@NonNull String layerId)Tries to cast the Layer to T, throws ClassCastException if it’s another type.
voidaddLayer(@NonNull Layer layer)Adds the layer to the map.
voidvoid addLayerBelow(@NonNull Layer layer, @NonNull String below)Adds the layer to the map.
voidaddLayerAbove(@NonNull Layer layer, @NonNull String above)Adds the layer to the map.
voidaddLayerAt(@NonNull Layer layer, @IntRange(from = 0) int index)Adds the layer to the map at the specified index.
booleanremoveLayer(@NonNull String layerId)Removes the layer
booleanremoveLayer(@NonNull Layer layer)Removes the layer.
booleanremoveLayerAt(@IntRange(from = 0) int index)Removes the layer.

默认的MapBox样式

/*** Indicates the parameter accepts one of the values from Style. Using one of these* constants means your map style will always use the latest version and may change as we* improve the style*/
@StringDef({MAPBOX_STREETS, OUTDOORS, LIGHT, DARK, SATELLITE, SATELLITE_STREETS, TRAFFIC_DAY, TRAFFIC_NIGHT})
@Retention(RetentionPolicy.SOURCE)
public @interface StyleUrl {
}public static final String MAPBOX_STREETS = "mapbox://styles/mapbox/streets-v11";
public static final String OUTDOORS = "mapbox://styles/mapbox/outdoors-v11";
public static final String LIGHT = "mapbox://styles/mapbox/light-v10";
public static final String DARK = "mapbox://styles/mapbox/dark-v10";
public static final String SATELLITE = "mapbox://styles/mapbox/satellite-v9";
public static final String SATELLITE_STREETS = "mapbox://styles/mapbox/satellite-streets-v11";
public static final String TRAFFIC_DAY = "mapbox://styles/mapbox/traffic-day-v2";
public static final String TRAFFIC_NIGHT = "mapbox://styles/mapbox/traffic-night-v2";

OnStyleLoaded 接口

/*** Callback to be invoked when a style has finished loading.*/
public interface OnStyleLoaded {/*** Invoked when a style has finished loading.** @param style the style that has finished loading*/void onStyleLoaded(@NonNull Style style);
}

MapboxMap类

类型方法说明
StylegetStyle()Get the Style of the map.
voidgetStyle(@NonNull Style.OnStyleLoaded onStyleLoaded)Get the Style of the map asynchronously.
voidsetStyle(@Style.StyleUrl String style)Loads a new map style from the specified bundled style.
voidsetStyle(@Style.StyleUrl String style, final Style.OnStyleLoaded callback)Loads a new map style from the specified bundled style.
The callback to be invoked when the style has loaded
voidsetStyle(Style.Builder builder)Loads a new map style from the specified builder.
voidsetStyle(Style.Builder builder, final Style.OnStyleLoaded callback)Loads a new map style from the specified builder.
The callback to be invoked when the style has loaded

获取样式

/*** Get the Style of the map asynchronously.*/
public void getStyle(@NonNull Style.OnStyleLoaded onStyleLoaded) {if (style != null && style.isFullyLoaded()) {onStyleLoaded.onStyleLoaded(style);} else {awaitingStyleGetters.add(onStyleLoaded);}
}/*** Get the Style of the map.* <p>* Returns null when style is being loaded.* </p>** @return the style of the map*/
@Nullable
public Style getStyle() {if (style == null || !style.isFullyLoaded()) {return null;} else {return style;}
}

通过Style.StyleUrl设置样式

/*** Loads a new map style from the specified bundled style.* <p>* This method is asynchronous and will return before the style finishes loading.* If you wish to wait for the map to finish loading, listen to the {@link MapView.OnDidFinishLoadingStyleListener}* callback or use the {@link #setStyle(String, Style.OnStyleLoaded)} method instead.* </p>* If the style fails to load or an invalid style URL is set, the map view will become blank.* An error message will be logged in the Android logcat and {@link MapView.OnDidFailLoadingMapListener} callback* will be triggered.** @param style The bundled style* @see Style*/
public void setStyle(@Style.StyleUrl String style) {this.setStyle(style, null);
}/*** Loads a new map style from the specified bundled style.* <p>* If the style fails to load or an invalid style URL is set, the map view will become blank.* An error message will be logged in the Android logcat and {@link MapView.OnDidFailLoadingMapListener} callback* will be triggered.* </p>** @param style    The bundled style* @param callback The callback to be invoked when the style has loaded* @see Style*/
public void setStyle(@Style.StyleUrl String style, final Style.OnStyleLoaded callback) {this.setStyle(new Style.Builder().fromUri(style), callback);
}

通过Style.Builder设置样式

/*** Loads a new map style from the specified builder.* <p>* If the builder fails to load, the map view will become blank. An error message will be logged in the Android logcat* and {@link MapView.OnDidFailLoadingMapListener} callback will be triggered. If you wish to wait for the map to* finish loading, listen to the {@link MapView.OnDidFinishLoadingStyleListener} callback or use the* {@link #setStyle(String, Style.OnStyleLoaded)} instead.* </p>** @param builder The style builder* @see Style*/
public void setStyle(Style.Builder builder) {this.setStyle(builder, null);
}/*** Loads a new map style from the specified builder.* <p>* If the builder fails to load, the map view will become blank. An error message will be logged in the Android logcat* and {@link MapView.OnDidFailLoadingMapListener} callback will be triggered.* </p>** @param builder  The style builder* @param callback The callback to be invoked when the style has loaded* @see Style*/
public void setStyle(Style.Builder builder, final Style.OnStyleLoaded callback) {styleLoadedCallback = callback;locationComponent.onStartLoadingMap();if (style != null) {style.clear();}style = builder.build(nativeMapView);if (!TextUtils.isEmpty(builder.getUri())) {nativeMapView.setStyleUri(builder.getUri());} else if (!TextUtils.isEmpty(builder.getJson())) {nativeMapView.setStyleJson(builder.getJson());} else {// user didn't provide a `from` component, load a blank style insteadnativeMapView.setStyleJson(Style.EMPTY_JSON);}
}

Style.Builder

类型方法说明
BuilderfromUrl(@NonNull String url)Will loads a new map style asynchronous from the specified URL.
BuilderfromUri(@NonNull String uri)Will loads a new map style asynchronous from the specified URI.
BuilderfromJson(@NonNull String styleJson)Will load a new map style from a json string.
BuilderwithSource(@NonNull Source source)Will add the source when map style has loaded.
BuilderwithSources(@NonNull Source… sources)Will add the sources when map style has loaded.
BuilderwithLayer(@NonNull Layer layer)Will add the layer when the style has loaded.
BuilderwithLayers(@NonNull Layer… layers)Will add the layers when the style has loaded.
BuilderwithLayerAt(@NonNull Layer layer, int index)Will add the layer when the style has loaded at a specified index.
BuilderwithLayerAbove(@NonNull Layer layer, @NonNull String aboveLayerId)Will add the layer when the style has loaded above a specified layer id.
BuilderwithLayerBelow(@NonNull Layer layer, @NonNull String belowLayerId)Will add the layer when the style has loaded below a specified layer id.
BuilderwithTransition(@NonNull TransitionOptions transition)Will add the transition when the map style has loaded.
BuilderwithImage(@NonNull String id, @NonNull Drawable drawable)Will add the drawable as image when the map style has loaded.
Builder

示例代码

地图样式类

设置地图样式,样式加载完成后重新本地化地图语言。

public class MapStyle {MapboxMap map;public MapStyle(MapboxMap map) {this.map = map;}public void changeStyle(String style) {map.setStyle(style, new Style.OnStyleLoaded() {@Overridepublic void onStyleLoaded(@NonNull Style style) {// Custom map style has been loaded and map is now ready setLanguage(style);}});}public void setLanguage(@NonNull Style style) {final String chinese = "{name_zh-Hans}";List<Layer> layers = style.getLayers();for (Layer layer : layers) {if (layer instanceof SymbolLayer) {SymbolLayer symbolLayer = (SymbolLayer) layer;String id = symbolLayer.getId();if (id.contains("-label")) {symbolLayer.setProperties(textField(chinese));}}}}
}

界面布局

在这里插入图片描述

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MapViewActivity"><com.mapbox.mapboxsdk.maps.MapViewandroid:id="@+id/mapView"android:layout_width="match_parent"android:layout_height="0dp"app:layout_constraintBottom_toTopOf="@id/bottomView"app:layout_constraintTop_toTopOf="parent"app:mapbox_cameraTargetLat="32.2857965"app:mapbox_cameraTargetLng="104.293174"app:mapbox_cameraZoom="2"app:mapbox_uiCompassGravity="start|top" /><HorizontalScrollViewandroid:id="@+id/bottomView"android:layout_width="match_parent"android:layout_height="wrap_content"android:background="@android:color/background_dark"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintTop_toBottomOf="@id/mapView"><RadioGroupandroid:id="@+id/RadioGroup"android:layout_width="wrap_content"android:layout_height="wrap_content"android:gravity="center_horizontal"android:orientation="horizontal"android:paddingHorizontal="10dp"><RadioButtonandroid:id="@+id/streets"android:layout_width="wrap_content"android:layout_height="wrap_content"android:checked="true"android:onClick="setMapStyle"android:text="基础"android:textColor="@color/white"android:textStyle="bold" /><RadioButtonandroid:id="@+id/satellite"android:layout_width="wrap_content"android:layout_height="wrap_content"android:onClick="setMapStyle"android:text="影像"android:textColor="@color/white"android:textStyle="bold" /><RadioButtonandroid:id="@+id/satelliteStreets"android:layout_width="wrap_content"android:layout_height="wrap_content"android:onClick="setMapStyle"android:text="影像标签"android:textColor="@color/white"android:textStyle="bold" /><RadioButtonandroid:id="@+id/outdoors"android:layout_width="wrap_content"android:layout_height="wrap_content"android:onClick="setMapStyle"android:text="户外"android:textColor="@color/white"android:textStyle="bold" /><RadioButtonandroid:id="@+id/light"android:layout_width="wrap_content"android:layout_height="wrap_content"android:checked="false"android:onClick="setMapStyle"android:text=""android:textColor="@color/white"android:textStyle="bold" /><RadioButtonandroid:id="@+id/dark"android:layout_width="wrap_content"android:layout_height="wrap_content"android:checked="false"android:onClick="setMapStyle"android:text=""android:textColor="@color/white"android:textStyle="bold" /></RadioGroup></HorizontalScrollView></androidx.constraintlayout.widget.ConstraintLayout>

控件响应事件

public void setMapStyle(View view) {boolean checked = ((RadioButton) view).isChecked();if (!checked)return;int id = view.getId();if (id == R.id.streets) {mapStyle.changeStyle(Style.MAPBOX_STREETS);} else if (id == R.id.satellite) {mapStyle.changeStyle(Style.SATELLITE);} else if (id == R.id.satelliteStreets) {mapStyle.changeStyle(Style.SATELLITE_STREETS);} else if (id == R.id.outdoors) {mapStyle.changeStyle(Style.OUTDOORS);} else if (id == R.id.light) {mapStyle.changeStyle(Style.LIGHT);} else if (id == R.id.dark) {mapStyle.changeStyle(Style.DARK);}
}

运行效果图

基础影像影像+标签
在这里插入图片描述在这里插入图片描述在这里插入图片描述
户外
在这里插入图片描述在这里插入图片描述在这里插入图片描述

附不同样式中的图层

查看地图样式的图层Z索引顺序和图层ID。

样式图层
Mapbox Streetsland, landcover, national-park, landuse, pitch-outline, water-shadow, waterway, water, hillshade, land-structure-polygon, land-structure-line, aeroway-polygon, aeroway-line, building-outline, building, tunnel-street-minor-low, tunnel-street-minor-case, tunnel-primary-secondary-tertiary-case, tunnel-major-link-case, tunnel-motorway-trunk-case, tunnel-construction, tunnel-path, tunnel-steps, tunnel-major-link, tunnel-pedestrian, tunnel-street-minor, tunnel-primary-secondary-tertiary, tunnel-oneway-arrow-blue, tunnel-motorway-trunk, tunnel-oneway-arrow-white, ferry, ferry-auto, road-path-bg, road-steps-bg, turning-feature-outline, road-pedestrian-case, road-minor-low, road-street-low, road-minor-case, road-street-case, road-secondary-tertiary-case, road-primary-case, road-major-link-case, road-motorway-trunk-case, road-construction, road-path, road-steps, road-major-link, road-pedestrian, road-pedestrian-polygon-fill, road-pedestrian-polygon-pattern, road-polygon, road-minor, road-street, road-secondary-tertiary, road-primary, road-oneway-arrow-blue, road-motorway-trunk, road-rail, road-rail-tracks, level-crossing, road-oneway-arrow-white, turning-feature, golf-hole-line, bridge-path-bg, bridge-steps-bg, bridge-pedestrian-case, bridge-street-minor-low, bridge-street-minor-case, bridge-primary-secondary-tertiary-case, bridge-major-link-case, bridge-motorway-trunk-case, bridge-construction, bridge-path, bridge-steps, bridge-major-link, bridge-pedestrian, bridge-street-minor, bridge-primary-secondary-tertiary, bridge-oneway-arrow-blue, bridge-motorway-trunk, bridge-rail, bridge-rail-tracks, bridge-major-link-2-case, bridge-motorway-trunk-2-case, bridge-major-link-2, bridge-motorway-trunk-2, bridge-oneway-arrow-white, aerialway, admin-1-boundary-bg, admin-0-boundary-bg, admin-1-boundary, admin-0-boundary, admin-0-boundary-disputed, building-number-label, road-label, road-number-shield, road-exit-shield, golf-hole-label, waterway-label, natural-line-label, natural-point-label, water-line-label, water-point-label, poi-label, transit-label, airport-label, settlement-subdivision-label, settlement-label, state-label, country-label, com.mapbox.annotations.points
Satellitebackground, satellite, com.mapbox.annotations.points
Satellite Streetsbackground, satellite, tunnel-primary-secondary-tertiary-case, tunnel-major-link-case, tunnel-motorway-trunk-case, tunnel-path, tunnel-steps, tunnel-major-link, tunnel-pedestrian, tunnel-primary-secondary-tertiary, tunnel-oneway-arrow-blue, tunnel-motorway-trunk, tunnel-oneway-arrow-white, ferry, ferry-auto, road-pedestrian-case, road-street-low, road-street-case, road-secondary-tertiary-case, road-primary-case, road-major-link-case, road-motorway-trunk-case, road-path, road-steps, road-major-link, road-pedestrian, road-street, road-secondary-tertiary, road-primary, road-oneway-arrow-blue, road-motorway-trunk, road-oneway-arrow-white, bridge-pedestrian-case, bridge-primary-secondary-tertiary-case, bridge-major-link-case, bridge-motorway-trunk-case, bridge-path, bridge-steps, bridge-major-link, bridge-pedestrian, bridge-primary-secondary-tertiary, bridge-oneway-arrow-blue, bridge-motorway-trunk, bridge-major-link-2-case, bridge-motorway-trunk-2-case, bridge-major-link-2, bridge-motorway-trunk-2, bridge-oneway-arrow-white, aerialway, admin-1-boundary-bg, admin-0-boundary-bg, admin-1-boundary, admin-0-boundary, admin-0-boundary-disputed, road-label, road-number-shield, road-exit-shield, waterway-label, natural-line-label, natural-point-label, water-line-label, water-point-label, poi-label, transit-label, airport-label, settlement-subdivision-label, settlement-label, state-label, country-label, com.mapbox.annotations.points
Outdoorsland, landcover, national-park, national_park-tint-band, landuse, pitch-outline, waterway-shadow, water-shadow, waterway, water, wetland, wetland-pattern, hillshade, contour-line, land-structure-polygon, land-structure-line, aeroway-polygon, aeroway-line, building-outline, building, tunnel-street-minor-low, tunnel-street-minor-case, tunnel-primary-secondary-tertiary-case, tunnel-major-link-case, tunnel-motorway-trunk-case, tunnel-construction, tunnel-path-smooth-rough, tunnel-path-cycleway-piste, tunnel-steps, tunnel-major-link, tunnel-pedestrian, tunnel-street-minor, tunnel-primary-secondary-tertiary, tunnel-oneway-arrow-blue, tunnel-motorway-trunk, tunnel-oneway-arrow-white, cliff, ferry, ferry-auto, road-path-bg, road-steps-bg, road-pedestrian-case, road-street-low, road-minor-case, road-street-case, road-secondary-tertiary-case, road-primary-case, road-major-link-case, road-motorway-trunk-case, road-construction, road-path-smooth, road-path-rough, road-path-cycleway-piste, road-steps, road-major-link, road-pedestrian, road-pedestrian-polygon-fill, road-pedestrian-polygon-pattern, road-polygon, road-minor, road-street, road-secondary-tertiary, road-primary, road-oneway-arrow-blue, road-motorway-trunk, road-rail, road-rail-tracks, level-crossing, road-oneway-arrow-white, golf-hole-line, gate-fence-hedge, bridge-path-bg, bridge-steps-bg, bridge-pedestrian-case, bridge-street-minor-low, bridge-street-minor-case, bridge-primary-secondary-tertiary-case, bridge-major-link-case, bridge-motorway-trunk-case, bridge-construction, bridge-path-smooth-rough, bridge-path-cycleway-piste, bridge-steps, bridge-major-link, bridge-pedestrian, bridge-street-minor, bridge-primary-secondary-tertiary, bridge-oneway-arrow-blue, bridge-motorway-trunk, bridge-rail, bridge-rail-tracks, bridge-major-link-2-case, bridge-motorway-trunk-2-case, bridge-major-link-2, bridge-motorway-trunk-2, bridge-oneway-arrow-white, aerialway-bg, aerialway, admin-1-boundary-bg, admin-0-boundary-bg, admin-1-boundary, admin-0-boundary, admin-0-boundary-disputed, contour-label, building-number-label, road-label, road-number-shield, road-exit-shield, golf-hole-label, waterway-label, natural-line-label, natural-point-label, water-line-label, water-point-label, poi-label, transit-label, airport-label, settlement-subdivision-label, settlement-label, state-label, country-label, com.mapbox.annotations.points
Lightland, landcover, national-park, landuse, water-shadow, waterway, water, hillshade, land-structure-polygon, land-structure-line, aeroway-polygon, aeroway-line, building-outline, building, tunnel-street-minor-low, tunnel-street-minor-case, tunnel-primary-secondary-tertiary-case, tunnel-major-link-case, tunnel-motorway-trunk-case, tunnel-construction, tunnel-path, tunnel-steps, tunnel-major-link, tunnel-pedestrian, tunnel-street-minor, tunnel-primary-secondary-tertiary, tunnel-motorway-trunk, road-pedestrian-case, road-minor-low, road-street-low, road-minor-case, road-street-case, road-secondary-tertiary-case, road-primary-case, road-major-link-case, road-motorway-trunk-case, road-construction, road-path, road-steps, road-major-link, road-pedestrian, road-minor, road-street, road-secondary-tertiary, road-primary, road-motorway-trunk, road-rail, bridge-pedestrian-case, bridge-street-minor-low, bridge-street-minor-case, bridge-primary-secondary-tertiary-case, bridge-major-link-case, bridge-motorway-trunk-case, bridge-construction, bridge-path, bridge-steps, bridge-major-link, bridge-pedestrian, bridge-street-minor, bridge-primary-secondary-tertiary, bridge-motorway-trunk, bridge-rail, bridge-major-link-2-case, bridge-motorway-trunk-2-case, bridge-major-link-2, bridge-motorway-trunk-2, admin-1-boundary-bg, admin-0-boundary-bg, admin-1-boundary, admin-0-boundary, admin-0-boundary-disputed, road-label, waterway-label, natural-line-label, natural-point-label, water-line-label, water-point-label, poi-label, airport-label, settlement-subdivision-label, settlement-label, state-label, country-label, com.mapbox.annotations.points
Darkland, landcover, national-park, landuse, water-shadow, waterway, water, hillshade, land-structure-polygon, land-structure-line, aeroway-polygon, aeroway-line, building-outline, building, tunnel-street-minor-low, tunnel-street-minor-case, tunnel-primary-secondary-tertiary-case, tunnel-major-link-case, tunnel-motorway-trunk-case, tunnel-construction, tunnel-path, tunnel-steps, tunnel-major-link, tunnel-pedestrian, tunnel-street-minor, tunnel-primary-secondary-tertiary, tunnel-motorway-trunk, road-pedestrian-case, road-minor-low, road-street-low, road-minor-case, road-street-case, road-secondary-tertiary-case, road-primary-case, road-major-link-case, road-motorway-trunk-case, road-construction, road-path, road-steps, road-major-link, road-pedestrian, road-minor, road-street, road-secondary-tertiary, road-primary, road-motorway-trunk, road-rail, bridge-pedestrian-case, bridge-street-minor-low, bridge-street-minor-case, bridge-primary-secondary-tertiary-case, bridge-major-link-case, bridge-motorway-trunk-case, bridge-construction, bridge-path, bridge-steps, bridge-major-link, bridge-pedestrian, bridge-street-minor, bridge-primary-secondary-tertiary, bridge-motorway-trunk, bridge-rail, bridge-major-link-2-case, bridge-motorway-trunk-2-case, bridge-major-link-2, bridge-motorway-trunk-2, admin-1-boundary-bg, admin-0-boundary-bg, admin-1-boundary, admin-0-boundary, admin-0-boundary-disputed, road-label, waterway-label, natural-line-label, natural-point-label, water-line-label, water-point-label, poi-label, airport-label, settlement-subdivision-label, settlement-label, state-label, country-label, com.mapbox.annotations.points

这篇关于MapBox Android版开发 3 地图样式v9的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1130355

相关文章

基于 Cursor 开发 Spring Boot 项目详细攻略

《基于Cursor开发SpringBoot项目详细攻略》Cursor是集成GPT4、Claude3.5等LLM的VSCode类AI编程工具,支持SpringBoot项目开发全流程,涵盖环境配... 目录cursor是什么?基于 Cursor 开发 Spring Boot 项目完整指南1. 环境准备2. 创建

Python实现Excel批量样式修改器(附完整代码)

《Python实现Excel批量样式修改器(附完整代码)》这篇文章主要为大家详细介绍了如何使用Python实现一个Excel批量样式修改器,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一... 目录前言功能特性核心功能界面特性系统要求安装说明使用指南基本操作流程高级功能技术实现核心技术栈关键函

SpringBoot 多环境开发实战(从配置、管理与控制)

《SpringBoot多环境开发实战(从配置、管理与控制)》本文详解SpringBoot多环境配置,涵盖单文件YAML、多文件模式、MavenProfile分组及激活策略,通过优先级控制灵活切换环境... 目录一、多环境开发基础(单文件 YAML 版)(一)配置原理与优势(二)实操示例二、多环境开发多文件版

使用docker搭建嵌入式Linux开发环境

《使用docker搭建嵌入式Linux开发环境》本文主要介绍了使用docker搭建嵌入式Linux开发环境,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面... 目录1、前言2、安装docker3、编写容器管理脚本4、创建容器1、前言在日常开发全志、rk等不同

Android协程高级用法大全

《Android协程高级用法大全》这篇文章给大家介绍Android协程高级用法大全,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友跟随小编一起学习吧... 目录1️⃣ 协程作用域(CoroutineScope)与生命周期绑定Activity/Fragment 中手

Python实战之SEO优化自动化工具开发指南

《Python实战之SEO优化自动化工具开发指南》在数字化营销时代,搜索引擎优化(SEO)已成为网站获取流量的重要手段,本文将带您使用Python开发一套完整的SEO自动化工具,需要的可以了解下... 目录前言项目概述技术栈选择核心模块实现1. 关键词研究模块2. 网站技术seo检测模块3. 内容优化分析模

基于Java开发一个极简版敏感词检测工具

《基于Java开发一个极简版敏感词检测工具》这篇文章主要为大家详细介绍了如何基于Java开发一个极简版敏感词检测工具,文中的示例代码简洁易懂,感兴趣的小伙伴可以跟随小编一起学习一下... 目录你是否还在为敏感词检测头疼一、极简版Java敏感词检测工具的3大核心优势1.1 优势1:DFA算法驱动,效率提升10

Python利用GeoPandas打造一个交互式中国地图选择器

《Python利用GeoPandas打造一个交互式中国地图选择器》在数据分析和可视化领域,地图是展示地理信息的强大工具,被将使用Python、wxPython和GeoPandas构建的交互式中国地图行... 目录技术栈概览代码结构分析1. __init__ 方法:初始化与状态管理2. init_ui 方法:

Python开发简易网络服务器的示例详解(新手入门)

《Python开发简易网络服务器的示例详解(新手入门)》网络服务器是互联网基础设施的核心组件,它本质上是一个持续运行的程序,负责监听特定端口,本文将使用Python开发一个简单的网络服务器,感兴趣的小... 目录网络服务器基础概念python内置服务器模块1. HTTP服务器模块2. Socket服务器模块

Android 缓存日志Logcat导出与分析最佳实践

《Android缓存日志Logcat导出与分析最佳实践》本文全面介绍AndroidLogcat缓存日志的导出与分析方法,涵盖按进程、缓冲区类型及日志级别过滤,自动化工具使用,常见问题解决方案和最佳实... 目录android 缓存日志(Logcat)导出与分析全攻略为什么要导出缓存日志?按需过滤导出1. 按