MapBox Android版开发 3 地图样式v11

news2024/11/27 1:32:19

MapBox Android版开发 3 地图样式v11

  • 前言
  • MapBox样式对比
  • 主要类和方法
    • Style类
      • Style类
      • 默认的MapBox样式
      • OnStyleLoaded 接口
    • MapboxMap类
      • 获取样式
      • 设置样式
    • 本地化扩展
  • 示例代码
    • 地图样式类
    • 界面布局
    • 控件响应事件
    • 运行效果图
  • 附不同样式中的图层

前言

可以使用Mapbox Maps SDK自定义数据样式、调整地图样式、添加字体、创建数据驱动的可视化等。可以使用Mapbox StandardMapbox Standard Satellite,或通过调整地图的颜色、图标和字体来创建自定义地图样式。

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

  • 使用Mapbox Studio创建自定义地图样式。
  • 使用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地图样式。

MapboxStyleManager
+StyleManager styleManager
Style

Style类

class Style internal constructor(
  styleManager: StyleManager,
  pixelRatio: Float,
  mapLoadingErrorDelegate: MapLoadingErrorDelegate,
) : MapboxStyleManager(styleManager, pixelRatio, mapLoadingErrorDelegate) {

  @Volatile
  private var isStyleValid = true
  
  /**
   * Returns the existing style layers.
   *
   * @return The list containing the ids of the existing style layers.
   */
  override val styleLayers: List<StyleObjectInfo>
    @MainThread
    get() {
      checkNativeStyle("getStyleLayers")
      return super.styleLayers
    }
    ...
}
  • MapboxStyleManager 类
open class MapboxStyleManager @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX) constructor(
  /**
   * Native style manager instance.
   */
  @get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
  val styleManager: StyleManager,
  /**
   * Current pixel ratio.
   */
  val pixelRatio: Float,
  /**
   * For internal usage.
   */
  @get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
  val mapLoadingErrorDelegate: MapLoadingErrorDelegate,
) {
  }
  ...
}
  • StyleManager 类
public class StyleManager extends Observable {
    @MainThread
    public native boolean isStyleLoaded();

    @MainThread
    public native boolean styleLayerExists(@NonNull String layerId);

    @NonNull
    @MainThread
    public native List<StyleObjectInfo> getStyleLayers();
    ...
}

默认的MapBox样式

const val STANDARD = "mapbox://styles/mapbox/standard"
const val STANDARD_SATELLITE = "mapbox://styles/mapbox/standard-satellite"
const val MAPBOX_STREETS = "mapbox://styles/mapbox/streets-v12"
const val OUTDOORS = "mapbox://styles/mapbox/outdoors-v12"
const val LIGHT = "mapbox://styles/mapbox/light-v11"
const val DARK = "mapbox://styles/mapbox/dark-v11"
const val SATELLITE = "mapbox://styles/mapbox/satellite-v9"
const val SATELLITE_STREETS = "mapbox://styles/mapbox/satellite-streets-v12"
const val TRAFFIC_DAY = "mapbox://styles/mapbox/traffic-day-v2"
const val TRAFFIC_NIGHT = "mapbox://styles/mapbox/traffic-night-v2"

OnStyleLoaded 接口

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

MapboxMap类

获取样式

var style: Style? = null
  @JvmSynthetic
  internal set
  get() {
    checkNativeMap("getStyle")
    return field
  }

设置样式

@JvmOverloads
fun loadStyle(
  style: String,
  onStyleLoaded: Style.OnStyleLoaded? = null,
) {
  checkNativeMap("loadStyle")
  initializeStyleLoad(
    onStyleLoaded,
    styleDataStyleLoadedListener = {},
  )
  applyStyle(style)
}

private fun applyStyle(style: String) {
  if (style.isValidUri()) {
    nativeMap.setStyleURI(style)
  } else {
    nativeMap.setStyleJSON(style.ifBlank { "{}" })
  }
}

本地化扩展

com.mapbox.maps.extension.localization包中实现了本地化功能,这种方法不支持standard样式。主要实现代码如下:

@JvmOverloads
fun MapboxStyleManager.localizeLabels(locale: Locale, layerIds: List<String>? = null) {
  if (styleURI == "mapbox://styles/mapbox/standard") {
    throw RuntimeException(
      "Mapbox Standard style does not support client-side runtime localization." +
        " Consider using Mapbox internationalization capability instead: https://www.mapbox.com/blog/maps-internationalization-34-languages"
    )
  }
  setMapLanguage(locale, this, layerIds)
}

internal fun setMapLanguage(locale: Locale, style: MapboxStyleManager, layerIds: List<String>?) {
  val convertedLocale = "name_${locale.language}"
  if (!isSupportedLanguage(convertedLocale)) {
    logE(TAG, "Locale: $locale is not supported.")
    return
  }

  layerIds?.forEach { id ->
    localizeTextFieldExpression(
      style = style,
      layerId = id,
      locale = locale,
      convertedLocale = convertedLocale,
      filterSymbolLayers = true,
    )
  } ?: style.styleLayers.forEach { layer ->
    if (layer.type == SYMBOL) {
      localizeTextFieldExpression(
        style = style,
        layerId = layer.id,
        locale = locale,
        convertedLocale = convertedLocale,
        filterSymbolLayers = false,
      )
    }
  }
}

private fun localizeTextFieldExpression(
  style: MapboxStyleManager,
  layerId: String,
  locale: Locale,
  convertedLocale: String,
  filterSymbolLayers: Boolean,
) {
  if (filterSymbolLayers) {
    val type = style.getStyleLayerProperty(layerId, TYPE).value.contents as? String
    if (type != SYMBOL) {
      return
    }
  }
  val textFieldProperty = style.getStyleLayerProperty(layerId, TEXT_FIELD)
  if (textFieldProperty.kind != StylePropertyValueKind.EXPRESSION) {
    return
  }
  val textField = textFieldProperty.value.toJson()
  val adaptedLocale = adaptLocaleToV8orV7IfNeeded(
    style,
    style.getStyleLayerProperty(layerId, SOURCE).value.contents as? String ?: "",
    locale
  ) ?: convertedLocale
  val getExpression = get(adaptedLocale).toJson()
  val localizedTextFieldExpressionAsJson = textField.replace(
    EXPRESSION_REGEX,
    getExpression
  ).replace(EXPRESSION_ABBR_REGEX, getExpression)
  if (BuildConfig.DEBUG) {
    logI(TAG, "Localize layer with expression: $localizedTextFieldExpressionAsJson")
  }
  val expected = Value.fromJson(localizedTextFieldExpressionAsJson)
  expected.value?.let { value ->
    style.setStyleLayerProperty(
      layerId,
      TEXT_FIELD,
      value
    )
  } ?: run {
    logE(TAG, "An error ${expected.error} occurred when converting $localizedTextFieldExpressionAsJson to a Value!")
  }
}

示例代码

地图样式类

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

package com.example.mapdemo

import com.mapbox.maps.MapboxMap
import com.mapbox.maps.Style
import com.mapbox.maps.extension.localization.localizeLabels
import java.util.Locale

class MapStyle(map: MapboxMap) {
    private var map = map

    fun changeStyle(style: String) {
        map.loadStyle(style) {
            var layers = it.styleLayers
            if (style != Style.STANDARD && style != Style.STANDARD_SATELLITE) {
                it.localizeLabels(Locale.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=".MainActivity">

    <com.mapbox.maps.MapView
        android: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_cameraBearing="0.0"
        app:mapbox_cameraPitch="0.0"
        app:mapbox_cameraTargetLat="32.2857965"
        app:mapbox_cameraTargetLng="104.293174"
        app:mapbox_cameraZoom="2" />

    <HorizontalScrollView
        android: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">

        <RadioGroup
            android:id="@+id/RadioGroup"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:orientation="horizontal"
            android:paddingHorizontal="10dp">

            <RadioButton
                android:id="@+id/standard"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:checked="false"
                android:onClick="setMapStyle"
                android:text="3D基础"
                android:textColor="@color/white"
                android:textStyle="bold" />

            <RadioButton
                android:id="@+id/standardSatellite"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:onClick="setMapStyle"
                android:text="3D影像"
                android:textColor="@color/white"
                android:textStyle="bold" />

            <RadioButton
                android: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" />

            <RadioButton
                android: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" />

            <RadioButton
                android: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" />

            <RadioButton
                android: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" />

            <RadioButton
                android: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" />

            <RadioButton
                android: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>

控件响应事件

fun setMapStyle(view: View) {
    val checked = (view as RadioButton).isChecked
    if (!checked)
        return

    val id = view.getId()
    if (id == R.id.standard) {
        mapStyle.changeStyle(Style.STANDARD)
    } else if (id == R.id.standardSatellite) {
        mapStyle.changeStyle(Style.STANDARD_SATELLITE)
    } else 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)
    }
}

运行效果图

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

附不同样式中的图层

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

样式图层
Mapbox Standard-
Mapbox Standard Satellite-
Mapbox Streetsland, landcover, national-park, landuse, pitch-outline, waterway-shadow, water-shadow, waterway, water, water-depth, hillshade, land-structure-polygon, land-structure-line, aeroway-polygon, aeroway-line, building, building-underground, tunnel-minor-case, tunnel-street-case, tunnel-minor-link-case, tunnel-secondary-tertiary-case, tunnel-primary-case, tunnel-major-link-case, tunnel-motorway-trunk-case, tunnel-path, tunnel-steps, tunnel-pedestrian, tunnel-construction, tunnel-minor, tunnel-minor-link, tunnel-major-link, tunnel-street, tunnel-street-low, tunnel-secondary-tertiary, tunnel-primary, tunnel-motorway-trunk, tunnel-oneway-arrow-blue, tunnel-oneway-arrow-white, ferry, ferry-auto, road-pedestrian-polygon-fill, road-pedestrian-polygon-pattern, road-path-bg, road-steps-bg, road-pedestrian-case, road-path, road-steps, road-pedestrian, golf-hole-line, road-polygon, turning-feature-outline, road-minor-case, road-street-case, road-minor-link-case, road-secondary-tertiary-case, road-primary-case, road-major-link-case, road-motorway-trunk-case, turning-feature, road-construction, road-minor, road-minor-link, road-major-link, road-street, road-street-low, road-secondary-tertiary, road-primary, road-motorway-trunk, road-rail, road-rail-tracks, level-crossing, road-oneway-arrow-blue, road-oneway-arrow-white, crosswalks, bridge-path-bg, bridge-steps-bg, bridge-pedestrian-case, bridge-path, bridge-steps, bridge-pedestrian, bridge-minor-case, bridge-street-case, bridge-minor-link-case, bridge-secondary-tertiary-case, bridge-primary-case, bridge-major-link-case, bridge-motorway-trunk-case, bridge-construction, bridge-minor, bridge-minor-link, bridge-major-link, bridge-street, bridge-street-low, bridge-secondary-tertiary, bridge-primary, bridge-motorway-trunk, bridge-major-link-2-case, bridge-motorway-trunk-2-case, bridge-major-link-2, bridge-motorway-trunk-2, bridge-oneway-arrow-blue, bridge-oneway-arrow-white, bridge-rail, bridge-rail-tracks, aerialway, admin-1-boundary-bg, admin-0-boundary-bg, admin-1-boundary, admin-0-boundary, admin-0-boundary-disputed, building-entrance, building-number-label, block-number-label, road-label, road-intersection, road-number-shield, road-exit-shield, path-pedestrian-label, golf-hole-label, ferry-aerialway-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-minor-label, settlement-major-label, state-label, country-label, continent-label
Satellitebackground, satellite
Satellite Streetsbackground, satellite, tunnel-minor-case, tunnel-street-case, tunnel-minor-link-case, tunnel-secondary-tertiary-case, tunnel-primary-case, tunnel-major-link-case, tunnel-motorway-trunk-case, tunnel-path, tunnel-steps, tunnel-pedestrian, tunnel-minor, tunnel-minor-link, tunnel-major-link, tunnel-street, tunnel-street-low, tunnel-secondary-tertiary, tunnel-primary, tunnel-motorway-trunk, road-path, road-steps, road-pedestrian, road-minor-case, road-street-case, road-minor-link-case, road-secondary-tertiary-case, road-primary-case, road-major-link-case, road-motorway-trunk-case, road-minor, road-minor-link, road-major-link, road-street, road-street-low, road-secondary-tertiary, road-primary, road-motorway-trunk, bridge-path, bridge-steps, bridge-pedestrian, bridge-minor-case, bridge-street-case, bridge-minor-link-case, bridge-secondary-tertiary-case, bridge-primary-case, bridge-major-link-case, bridge-motorway-trunk-case, bridge-minor, bridge-minor-link, bridge-major-link, bridge-street, bridge-street-low, bridge-secondary-tertiary, bridge-primary, bridge-motorway-trunk, bridge-major-link-2-case, bridge-motorway-trunk-2-case, bridge-major-link-2, bridge-motorway-trunk-2, aerialway, admin-1-boundary-bg, admin-0-boundary-bg, admin-1-boundary, admin-0-boundary, admin-0-boundary-disputed, road-label, road-intersection, road-number-shield, road-exit-shield, path-pedestrian-label, ferry-aerialway-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-minor-label, settlement-major-label, state-label, country-label, continent-label
Outdoorsland, landcover, national-park, national-park_tint-band, landuse, pitch-outline, waterway-shadow, water-shadow, waterway, water, water-depth, wetland, wetland-pattern, hillshade, contour-line, land-structure-polygon, land-structure-line, aeroway-polygon, aeroway-line, building, building-underground, tunnel-minor-case, tunnel-street-case, tunnel-minor-link-case, tunnel-secondary-tertiary-case, tunnel-primary-case, tunnel-major-link-case, tunnel-motorway-trunk-case, tunnel-path-trail, tunnel-path-cycleway-piste, tunnel-path, tunnel-steps, tunnel-pedestrian, tunnel-construction, tunnel-minor, tunnel-minor-link, tunnel-major-link, tunnel-street, tunnel-street-low, tunnel-secondary-tertiary, tunnel-primary, tunnel-motorway-trunk, tunnel-oneway-arrow-blue, tunnel-oneway-arrow-white, cliff, ferry, ferry-auto, road-pedestrian-polygon-fill, road-pedestrian-polygon-pattern, road-path-bg, road-steps-bg, road-pedestrian-case, road-path-trail, road-path-cycleway-piste, road-path, road-steps, road-pedestrian, golf-hole-line, road-polygon, turning-feature-outline, road-minor-case, road-street-case, road-minor-link-case, road-secondary-tertiary-case, road-primary-case, road-major-link-case, road-motorway-trunk-case, turning-feature, road-construction, road-minor, road-minor-link, road-major-link, road-street, road-street-low, road-secondary-tertiary, road-primary, road-motorway-trunk, road-rail, road-rail-tracks, level-crossing, road-oneway-arrow-blue, road-oneway-arrow-white, crosswalks, gate-fence-hedge, bridge-path-bg, bridge-steps-bg, bridge-pedestrian-case, bridge-path-trail, bridge-path-cycleway-piste, bridge-path, bridge-steps, bridge-pedestrian, gate-label, bridge-minor-case, bridge-street-case, bridge-minor-link-case, bridge-secondary-tertiary-case, bridge-primary-case, bridge-major-link-case, bridge-motorway-trunk-case, bridge-construction, bridge-minor, bridge-minor-link, bridge-major-link, bridge-street, bridge-street-low, bridge-secondary-tertiary, bridge-primary, bridge-motorway-trunk, bridge-major-link-2-case, bridge-motorway-trunk-2-case, bridge-major-link-2, bridge-motorway-trunk-2, bridge-oneway-arrow-blue, bridge-oneway-arrow-white, bridge-rail, bridge-rail-tracks, aerialway, admin-1-boundary-bg, admin-0-boundary-bg, admin-1-boundary, admin-0-boundary, admin-0-boundary-disputed, contour-label, building-entrance, building-number-label, block-number-label, road-label, road-intersection, road-number-shield, road-exit-shield, path-pedestrian-label, golf-hole-label, ferry-aerialway-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-minor-label, settlement-major-label, state-label, country-label, continent-label
Lightland, national-park, landuse, waterway, water, land-structure-polygon, land-structure-line, aeroway-polygon, aeroway-line, building, tunnel-path-trail, tunnel-path-cycleway-piste, tunnel-path, tunnel-steps, tunnel-pedestrian, tunnel-simple, road-path-trail, road-path-cycleway-piste, road-path, road-steps, road-pedestrian, road-simple, road-rail, bridge-path-trail, bridge-path-cycleway-piste, bridge-path, bridge-steps, bridge-pedestrian, bridge-case-simple, bridge-simple, bridge-rail, admin-1-boundary-bg, admin-0-boundary-bg, admin-1-boundary, admin-0-boundary, admin-0-boundary-disputed, road-label-simple, waterway-label, natural-line-label, natural-point-label, water-line-label, water-point-label, poi-label, airport-label, settlement-subdivision-label, settlement-minor-label, settlement-major-label, state-label, country-label, continent-label
Darkland, national-park, landuse, waterway, water, land-structure-polygon, land-structure-line, aeroway-polygon, aeroway-line, building, tunnel-path-trail, tunnel-path-cycleway-piste, tunnel-path, tunnel-steps, tunnel-pedestrian, tunnel-simple, road-path-trail, road-path-cycleway-piste, road-path, road-steps, road-pedestrian, road-simple, road-rail, bridge-path-trail, bridge-path-cycleway-piste, bridge-path, bridge-steps, bridge-pedestrian, bridge-case-simple, bridge-simple, bridge-rail, admin-1-boundary-bg, admin-0-boundary-bg, admin-1-boundary, admin-0-boundary, admin-0-boundary-disputed, road-label-simple, waterway-label, natural-line-label, natural-point-label, water-line-label, water-point-label, poi-label, airport-label, settlement-subdivision-label, settlement-minor-label, settlement-major-label, state-label, country-label, continent-label

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2100242.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

LLM大模型教程:低使用门槛开源大模型服务框架Ollama

这一年来&#xff0c;AI 发展的越来越快&#xff0c;大模型使用的门槛也越来越低&#xff0c;每个人都可以在自己的本地运行大模型。今天再给大家介绍一个最厉害的开源大模型服务框架——Ollama。 项目介绍 Ollama 是一个开源的大语言模型&#xff08;LLM&#xff09;服务工具…

平价运动耳机推荐有哪些?业界五大爆款推荐!

近两年&#xff0c;开放式蓝牙耳机的热度可以说是不断提高&#xff0c;相较于一般的蓝牙耳机&#xff0c;开放式蓝牙耳机因为不需要入耳&#xff0c;对于耳道狭小或者耳道敏感的人群比较友好&#xff0c;能够避免耳道不适、中耳炎等&#xff0c;长时间佩戴更舒适&#xff0c;适…

【一嗨租车-注册安全分析报告-滑动验证加载不正常导致安全隐患】

前言 由于网站注册入口容易被黑客攻击&#xff0c;存在如下安全问题&#xff1a; 暴力破解密码&#xff0c;造成用户信息泄露短信盗刷的安全问题&#xff0c;影响业务及导致用户投诉带来经济损失&#xff0c;尤其是后付费客户&#xff0c;风险巨大&#xff0c;造成亏损无底洞…

大模型时代,开发者怎么办

随着ChatGPT的出圈&#xff0c;基于大模型开发的应用也不断涌现&#xff0c;不管是不是相关方向的从业人员&#xff0c;在这一年多总能听到很多新名词&#xff0c;从LLM、Prompt、RAG到Fine-tuning、Agent&#xff0c;各个大企业都在讲All in AI&#xff0c;一些技术会议也明显…

Massive Exploration of Neural Machine Translation Architectures论文解读

基本信息 作者D Britzdoi发表时间2017期刊EMNLP网址https://arxiv.org/abs/1703.03906v1 研究背景 1. What’s known 既往研究已证实 神经机器翻译NMT是一种自动翻译的端到端方法&#xff08;Neural Machine Translation by Jointly Learning to Align and Translate论文里的…

Gartner《2024中国安全技术成熟度曲线》AI安全助手代表性产品:开发者安全助手D10

海云安关注到&#xff0c;近日&#xff0c;国际权威研究机构Gartner发布了《2024中国安全技术成熟度曲线》(Hype Cycle for Security in China,2024)报告。 在此次报告中&#xff0c;安全技术成熟度曲线将安全周期划分为技术萌芽期&#xff08;Innovation Trigger&#xff09;…

快捷开发技巧-idea如何提取代码成方法

1.首选选中要抽取的代码段 2.右键选择Refactor->Extract Method 3.调整方法名称 4.回车保存

Find My资讯|腾势联名九号推出F2 升级版电动滑板车,支持苹果Find My功能

比亚迪腾势与九号电动推出的联名电动滑板车 F2 升级版已在腾势商城上架&#xff0c;该车支持苹果“Find My”查找功能&#xff0c;续航里程 40 公里&#xff0c;售价为 2999 元。 该车配备 30 毫米双筒减振&#xff0c;采用 10 英寸自修复果冻胎&#xff0c;拥有前碟刹 后 E…

改变地址栏的网址链接路径或传参,不刷新当前网页页面

window.history.replaceState(null, null, "/网址后面的路径?参数参数值1");window.history.replaceState(null, null, "./当前路径保留?参数参数值1");

linux 系统中关于文件压缩效率/压缩比的说明

前言 tar.gz&#xff08;或tgz&#xff09;格式是Linux中常用的压缩格式&#xff0c;它结合了tar的打包功能和gzip的压缩功能。根据搜索结果&#xff0c;tar.gz格式在压缩比率、压缩和解压速度上取得了较好的平衡。 在一项测试中&#xff0c;一个大约23GB的目录使用tar.gz格式…

win7一键修复所有dll缺失!全面介绍电脑DLL文件丢失修复过程!

在Windows 7操作系统中&#xff0c;DLL&#xff08;动态链接库&#xff09;文件扮演着至关重要的角色。它们是Windows系统和其他应用程序正常运行所必需的组件。然而&#xff0c;由于各种原因&#xff0c;如系统更新不当、软件卸载不完全或恶意软件攻击&#xff0c;DLL文件可能…

线性结构队列栈知识点(软件设计师)

线性结构 1.线性表2.线性表存储结构顺序存储链式存储 3.栈4.队列5.串 1.线性表 线性表是最简单、最基本的数据结构。线性表常采用顺序存储和链式存储&#xff0c;主要的基本操作是插入、删除和查找等 2.线性表存储结构 顺序存储 插入、删除 移动元素查找时间复杂度O(1) 可以随…

极简的go语言channel入门

写在文章开头 很久没写go语言相关的文章了&#xff0c;近期准备整理整理go语言channel相关的知识点&#xff0c;而本文将通过几个示例快速带读者了解channel的基本概念&#xff0c;希望对你有帮助。 Hi&#xff0c;我是 sharkChili &#xff0c;是个不断在硬核技术上作死的 ja…

Vue笔记总结(Xmind格式):第六天

Xmind鸟瞰图&#xff1a; 简单文字总结&#xff1a; 动态组件 1.组件中name属性的作用 递归组件:一个组件要用自己的时候&#xff0c;可以通过自己的名字来使用自己。 2.组件缓存 组件切换会导致组件被频繁销毁和重新创建, 所以性能不高,Vue内置的keep-alive组件包起来要频繁切…

2024年(第7届)“泰迪杯”数据分析技能赛通知

由泰迪杯数据分析技能赛组织委员会、广东泰迪智能科技股份有限公司主办&#xff0c;广东省工业与应用数学学会、人民邮电出版社和北京泰迪云智信息技术研究院协办的“泰迪杯”数据分析技能赛&#xff08;以下简称竞赛&#xff09;即将开展。 竞赛目的在于以赛促学、以赛促教、…

企业架构的概念及发展历程简述(附TOGAF架构理论学习资料下载链接)

企业架构在数字化转型中发挥着至关重要的作用。它不仅确保了战略一致性、提高了运营效率、强化了信息安全&#xff0c;还指导了数字化转型路径、推动了技术与业务的深度融合以及促进了生态系统的连接。因此&#xff0c;在数字化转型过程中&#xff0c;企业应高度重视企业架构的…

2023年中国90后十大影响力人物

“2023年中国90后十大影响力人物” 2024年1月23日&#xff0c;揭晓了由网友投票评选的中国2023年90后十大影响力人物。

一文读懂蒙特卡洛算法:从概率模拟到机器学习模型优化的全方位解析

爱德华蒙克(Edvard Munch)的"蒙特卡洛赌场的轮盘桌"(1892) 蒙特卡洛方法的起源与发展 1945年&#xff0c;在第二次世界大战即将结束之际&#xff0c;一场看似简单的纸牌游戏引发了计算领域的重大突破。这项突破最终导致了蒙特卡洛方法的诞生。参与曼哈顿计划的科学…

day05 1.运算符重载

#include <iostream> #include <cstring> using namespace std;class myString {private:char *str; //记录c风格的字符串int size; //记录字符串的实际长度public://无参构造myString():size(10){str new char[size]; //构造出一个长度为10的…

解除禁售!Ozon重新开放电子产品等品类销售,Ozon出单了怎么发货?

今年6月份&#xff0c;俄罗斯电商平台Ozon暂时关闭了电子产品、汽车配件和DIY工具三大品类&#xff0c;相关数据显示&#xff0c;有69%的电子产品是中国制造的&#xff0c;如耳机耳麦、充电器、智能手机、平板电脑、电子元器件等。这项禁售政策影响了众多卖家的销售业务&#x…