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

相关文章

基于Python开发PDF转PNG的可视化工具

《基于Python开发PDF转PNG的可视化工具》在数字文档处理领域,PDF到图像格式的转换是常见需求,本文介绍如何利用Python的PyMuPDF库和Tkinter框架开发一个带图形界面的PDF转P... 目录一、引言二、功能特性三、技术架构1. 技术栈组成2. 系统架构javascript设计3.效果图

Android WebView无法加载H5页面的常见问题和解决方法

《AndroidWebView无法加载H5页面的常见问题和解决方法》AndroidWebView是一种视图组件,使得Android应用能够显示网页内容,它基于Chromium,具备现代浏览器的许多功... 目录1. WebView 简介2. 常见问题3. 网络权限设置4. 启用 JavaScript5. D

Android如何获取当前CPU频率和占用率

《Android如何获取当前CPU频率和占用率》最近在优化App的性能,需要获取当前CPU视频频率和占用率,所以本文小编就来和大家总结一下如何在Android中获取当前CPU频率和占用率吧... 最近在优化 App 的性能,需要获取当前 CPU视频频率和占用率,通过查询资料,大致思路如下:目前没有标准的

基于Python开发PDF转Doc格式小程序

《基于Python开发PDF转Doc格式小程序》这篇文章主要为大家详细介绍了如何基于Python开发PDF转Doc格式小程序,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 用python实现PDF转Doc格式小程序以下是一个使用Python实现PDF转DOC格式的GUI程序,采用T

使用Python开发一个图像标注与OCR识别工具

《使用Python开发一个图像标注与OCR识别工具》:本文主要介绍一个使用Python开发的工具,允许用户在图像上进行矩形标注,使用OCR对标注区域进行文本识别,并将结果保存为Excel文件,感兴... 目录项目简介1. 图像加载与显示2. 矩形标注3. OCR识别4. 标注的保存与加载5. 裁剪与重置图像

Android开发中gradle下载缓慢的问题级解决方法

《Android开发中gradle下载缓慢的问题级解决方法》本文介绍了解决Android开发中Gradle下载缓慢问题的几种方法,本文给大家介绍的非常详细,感兴趣的朋友跟随小编一起看看吧... 目录一、网络环境优化二、Gradle版本与配置优化三、其他优化措施针对android开发中Gradle下载缓慢的问

HTML5中下拉框<select>标签的属性和样式详解

《HTML5中下拉框<select>标签的属性和样式详解》在HTML5中,下拉框(select标签)作为表单的重要组成部分,为用户提供了一个从预定义选项中选择值的方式,本文将深入探讨select标签的... 在html5中,下拉框(<select>标签)作为表单的重要组成部分,为用户提供了一个从预定义选项中

前端 CSS 动态设置样式::class、:style 等技巧(推荐)

《前端CSS动态设置样式::class、:style等技巧(推荐)》:本文主要介绍了Vue.js中动态绑定类名和内联样式的两种方法:对象语法和数组语法,通过对象语法,可以根据条件动态切换类名或样式;通过数组语法,可以同时绑定多个类名或样式,此外,还可以结合计算属性来生成复杂的类名或样式对象,详细内容请阅读本文,希望能对你有所帮助...

使用Go语言开发一个命令行文件管理工具

《使用Go语言开发一个命令行文件管理工具》这篇文章主要为大家详细介绍了如何使用Go语言开发一款命令行文件管理工具,支持批量重命名,删除,创建,移动文件,需要的小伙伴可以了解下... 目录一、工具功能一览二、核心代码解析1. 主程序结构2. 批量重命名3. 批量删除4. 创建文件/目录5. 批量移动三、如何安

Android 悬浮窗开发示例((动态权限请求 | 前台服务和通知 | 悬浮窗创建 )

《Android悬浮窗开发示例((动态权限请求|前台服务和通知|悬浮窗创建)》本文介绍了Android悬浮窗的实现效果,包括动态权限请求、前台服务和通知的使用,悬浮窗权限需要动态申请并引导... 目录一、悬浮窗 动态权限请求1、动态请求权限2、悬浮窗权限说明3、检查动态权限4、申请动态权限5、权限设置完毕后