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

相关文章

这15个Vue指令,让你的项目开发爽到爆

1. V-Hotkey 仓库地址: github.com/Dafrok/v-ho… Demo: 戳这里 https://dafrok.github.io/v-hotkey 安装: npm install --save v-hotkey 这个指令可以给组件绑定一个或多个快捷键。你想要通过按下 Escape 键后隐藏某个组件,按住 Control 和回车键再显示它吗?小菜一碟: <template

无人叉车3d激光slam多房间建图定位异常处理方案-墙体画线地图切分方案

墙体画线地图切分方案 针对问题:墙体两侧特征混淆误匹配,导致建图和定位偏差,表现为过门跳变、外月台走歪等 ·解决思路:预期的根治方案IGICP需要较长时间完成上线,先使用切分地图的工程化方案,即墙体两侧切分为不同地图,在某一侧只使用该侧地图进行定位 方案思路 切分原理:切分地图基于关键帧位置,而非点云。 理论基础:光照是直线的,一帧点云必定只能照射到墙的一侧,无法同时照到两侧实践考虑:关

Hadoop企业开发案例调优场景

需求 (1)需求:从1G数据中,统计每个单词出现次数。服务器3台,每台配置4G内存,4核CPU,4线程。 (2)需求分析: 1G / 128m = 8个MapTask;1个ReduceTask;1个mrAppMaster 平均每个节点运行10个 / 3台 ≈ 3个任务(4    3    3) HDFS参数调优 (1)修改:hadoop-env.sh export HDFS_NAMENOD

嵌入式QT开发:构建高效智能的嵌入式系统

摘要: 本文深入探讨了嵌入式 QT 相关的各个方面。从 QT 框架的基础架构和核心概念出发,详细阐述了其在嵌入式环境中的优势与特点。文中分析了嵌入式 QT 的开发环境搭建过程,包括交叉编译工具链的配置等关键步骤。进一步探讨了嵌入式 QT 的界面设计与开发,涵盖了从基本控件的使用到复杂界面布局的构建。同时也深入研究了信号与槽机制在嵌入式系统中的应用,以及嵌入式 QT 与硬件设备的交互,包括输入输出设

OpenHarmony鸿蒙开发( Beta5.0)无感配网详解

1、简介 无感配网是指在设备联网过程中无需输入热点相关账号信息,即可快速实现设备配网,是一种兼顾高效性、可靠性和安全性的配网方式。 2、配网原理 2.1 通信原理 手机和智能设备之间的信息传递,利用特有的NAN协议实现。利用手机和智能设备之间的WiFi 感知订阅、发布能力,实现了数字管家应用和设备之间的发现。在完成设备间的认证和响应后,即可发送相关配网数据。同时还支持与常规Sof

活用c4d官方开发文档查询代码

当你问AI助手比如豆包,如何用python禁止掉xpresso标签时候,它会提示到 这时候要用到两个东西。https://developers.maxon.net/论坛搜索和开发文档 比如这里我就在官方找到正确的id描述 然后我就把参数标签换过来

Android实现任意版本设置默认的锁屏壁纸和桌面壁纸(两张壁纸可不一致)

客户有些需求需要设置默认壁纸和锁屏壁纸  在默认情况下 这两个壁纸是相同的  如果需要默认的锁屏壁纸和桌面壁纸不一样 需要额外修改 Android13实现 替换默认桌面壁纸: 将图片文件替换frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.*  (注意不能是bmp格式) 替换默认锁屏壁纸: 将图片资源放入vendo

Android平台播放RTSP流的几种方案探究(VLC VS ExoPlayer VS SmartPlayer)

技术背景 好多开发者需要遴选Android平台RTSP直播播放器的时候,不知道如何选的好,本文针对常用的方案,做个大概的说明: 1. 使用VLC for Android VLC Media Player(VLC多媒体播放器),最初命名为VideoLAN客户端,是VideoLAN品牌产品,是VideoLAN计划的多媒体播放器。它支持众多音频与视频解码器及文件格式,并支持DVD影音光盘,VCD影

Linux_kernel驱动开发11

一、改回nfs方式挂载根文件系统         在产品将要上线之前,需要制作不同类型格式的根文件系统         在产品研发阶段,我们还是需要使用nfs的方式挂载根文件系统         优点:可以直接在上位机中修改文件系统内容,延长EMMC的寿命         【1】重启上位机nfs服务         sudo service nfs-kernel-server resta

【区块链 + 人才服务】区块链集成开发平台 | FISCO BCOS应用案例

随着区块链技术的快速发展,越来越多的企业开始将其应用于实际业务中。然而,区块链技术的专业性使得其集成开发成为一项挑战。针对此,广东中创智慧科技有限公司基于国产开源联盟链 FISCO BCOS 推出了区块链集成开发平台。该平台基于区块链技术,提供一套全面的区块链开发工具和开发环境,支持开发者快速开发和部署区块链应用。此外,该平台还可以提供一套全面的区块链开发教程和文档,帮助开发者快速上手区块链开发。