目录

Version Change History

6.18.0.307 (2025-10-13)

The feature updates for JavaScript API are as follows:

New Features

Added the destroy method to HWMap. This method is used to destroy a map instance.

Earlier Versions

[h2]6.18.0.300 (2025-09-04)

The feature updates for JavaScript API are as follows:

New Features

Added support for new map types: satellite map and hybrid map.

[h2]6.15.1.300 (2024-09-30)

The feature updates for JavaScript API are as follows:

New Features

Added the setFitView method to HWMap. This method is used to calculate the optimal view based on the provided array of longitudes and latitudes.

Added the setShowDir(showDir:boolean) and getShowDir() methods to HWPolyline. The methods are used to set the direction arrow of a polyline.

[h2]6.12.2.300 (2023-11-31)

The feature updates for JavaScript API are as follows:

New Features

Added the setFitView method to HWMap. This method is used to calculate the optimal view based on the provided array of longitudes and latitudes.

Added the setShowDir(showDir:boolean) and getShowDir() methods to HWPolyline. The methods are used to set the direction arrow of a polyline.

[h2]6.12.1.300 (2023-10-31)

The feature updates for JavaScript API are as follows:

New Features

Added the resize method to HWMap. The method is used to recalculate the size of the map container.

[h2]6.12.0.300 (2023-09-31)

The feature updates for JavaScript API are as follows:

New Features

Added contextmenu right-click events to HWMarker and HWMarkerCluster.

[h2]6.11.1.300 (2023-09-01)

The feature updates for JavaScript API are as follows:

New Features

Added the selectedObjectType attribute to DrawingManagerOptions. This attribute is used to specify the object type for drawing. The options include HW Object and OL Object.

Added the maxPoints attribute to PolygonOptions. This attribute is used to set the maximum number of vertices in a polygon.

Added the getProperties() method to HWMarker. This method is used to obtain custom attributes.

[h2]6.8.0.300 (2022-10-31)

The feature updates for JavaScript API are as follows:

New Features

Added the zIndex attribute to MarkerClusterOptions and the setZIndex(zIndex) and getZIndex() methods to HWMarkerCluster, which can be used to set the cover relationship on the Z axis.

[h2]6.7.0.300 (2022-11-01)

The feature updates for JavaScript API are as follows:

New Features

Added the backgroundColor attribute to MarkerClusterLabelOption. This attribute is used to set the background color of the text.

Added the rasterPreload attribute to MapOptions. This attribute is used to set whether the vector map preloads rasters.

[h2]6.6.0.300 (2022-08-08)

The feature updates for JavaScript API are as follows:

New Features

Added the Drawing Layer and introduced the drawing.js file (https://mapapi.cloud.huawei.com/mapjs/v1/api/js/drawing.js) to support shape drawing on the map using the mouse.

[h2]6.5.1.300 (2022-07-12)

The feature updates for JavaScript API are as follows:

New Features

Added the authOptions attribute to MapOptions to support map initialization using access token authentication.

[h2]6.5.0.300 (2022-05-24)

The feature updates for JavaScript API are as follows:

New Features

Added the mouseOver and mouseOut events to HWCircle, HWPolyline, and HWPolygon.

[h2]6.4.1.300 (2022-04-24)

The feature updates for JavaScript API are as follows:

New Features

[h2]6.3.1.300 (2022-02-14)

The feature updates for JavaScript API are as follows:

New Features

  • Added the setTextStrokeColor, setTextStrokeWeight, getTextStrokeColor, and getTextStrokeWeight methods to HWNaviLine, and added the textStrokeColor and textStrokeWeight attributes to NaviLineOptions. The attributes are used to set the stroke color and width of an earthworm line.
  • Added the rotation attribute to CustomPoiIconOption. This attribute is used to set the rotation angle of the icon.
  • Added Configuring a Listener for Custom POI Events.
    • Added the addListener and removeListener methods to HWCustomPoi. These methods are used to listen for custom POI addition and deletion events.
    • Added the click event to HWCustomPoi.

Modified Features

Updated the Petal Maps logo.

[h2]6.3.0.300 (2022-01-11)

The feature updates for JavaScript API are as follows:

New Features

[h2]6.2.1.300 (2021-12-06)

The feature updates for JavaScript API are as follows:

New Features

[h2]6.2.0.300 (2021-11-11)

The feature updates for JavaScript API are as follows:

New Features

Added the quantityUrls attribute to MarkerIconOption. This attribute allows you to customize the icon of clustered markers based on the number of markers to be clustered. For details, please refer to Customizing the Icon of Clustered Markers.

Modified Features

Deprecated the style editor. To customize the map style, use the style editor provided by Petal Maps Studio.

[h2]6.1.1.300 (2021-10-09)

The feature updates for JavaScript API are as follows:

New Features

Added the option TERRAIN (terrain map) for the mapType attribute in MapOptions. For details, please refer to Map Type.

[h2]6.0.0.300 (2021-07-15)

The feature updates for JavaScript API are as follows:

New Features

[h2]5.3.0.300 (2021-04-27)

The feature updates for JavaScript API are as follows:

New Features

  • Added the setLogoPosition method to HWMap and the logoPosition attribute to MapOptions, which are used to set the position of the Petal Maps logo.
  • Added the icon attribute to the Poi object.
  • Added HWHeatmapLayer to support adding, deleting, and customizing a heatmap.

[h2]5.2.1.300 (2021-04-08)

The feature updates for JavaScript API are as follows:

New Features

[h2]5.2.0.300 (2021-03-09)

The feature updates for JavaScript API are as follows:

New Features

  • Provided Petal Maps Studio, with which you can add, modify, delete, and release custom map styles. Once a map style is released, it will be applied to all apps that use it, without needing to update the apps.
  • Added the setPreviewId and setStyleId methods to the HWMap class. The methods can be used to apply a custom style to a map.
  • Added the hasRestrictedRoad, dstInRestrictedArea, crossCountry, crossMultiCountries, hasRoughRoad, dstInDiffTimeZone, hasFerry, hasTrafficLight, hasTolls, and trafficLightNum attributes to the Route object.

[h2]5.1.1.300 (2021-01-29)

The feature updates for JavaScript API are as follows:

New Features

Added the sourceType parameter to MapOptions, which is used to set the type of tiles loaded for the map. The options are vector and raster.

[h2]5.1.0.300 (2020-12-31)

The feature updates for JavaScript API are as follows:

Modified Features

Deprecated the politicalView parameter for Keyword Search, Nearby Place Search, Place Detail Search, Place Search Suggestion, Autocomplete, Forward Geocoding, and Reverse Geocoding.

[h2]5.0.5.300 (2020-11-27)

The feature updates for JavaScript API are as follows:

New Features

  • Added the legal copyright logo in the lower left corner of the sample image.
  • Modified the pricing policy to charge for the JavaScript APIs from January 1, 2021. For details, please refer to Service Pricing.

[h2]5.0.2.300 (2020-09-18)

The feature updates for JavaScript API are as follows:

New Features

[h2]5.0.1.300 (2020-07-13)

The feature updates for JavaScript API are as follows:

New Features

Added the function of seamlessly adjusting the map scale through gestures on Web JavaScript clients.

[h2]4.0.4.300 (2020-05-25)

The feature updates for JavaScript API are as follows:

New Features

  • Added the strokeLineDash attribute to HWCircle, HWPolyline, and HWPolygon.
  • Added the location button as a map control.
  • Added the function to customize the map style.

[h2]4.0.3.300 (2020-03-27)

The feature updates for JavaScript API are as follows:

New Features

  • Added Distance Matrix to calculate route distances between multiple departure places and destinations and traveling duration required for each route.
  • Added the current location control, and supported display of the current location.
  • Added the distanceText and durationText attributes for the Path and Step objects to provide tips on traveling distance and duration.
  • Added the durationInTrafficText attribute for the Path object to provide tips on traveling duration calculated based on real-time traffic status.
  • Added the instruction attribute for the Step object to provide tips on steps.

[h2]4.0.2.300 (2020-03-12)

The feature updates for JavaScript API are as follows:

New Features

  • Added the searchByText method in the HWSiteService class to search for places by keyword.
  • Added the nearbySearch method in the HWSiteService class to search for nearby places.
  • Added the searchById method in the HWSiteService class to query address of a place based on the place ID.
  • Added the querySuggestion method in the HWSiteService class to provide place search suggestions.
  • Supported preset standard map styles.

[h2]4.0.1.300 (2020-01-21)

The feature updates for JavaScript API are as follows:

New Features

  • Supported authentication based on the API key and service account, and changed the authentication credential from the access token to the API key for the Web APIs.
  • Supported mouse and gesture actions.
  • Added the Marker class to allow you to add markers on the map.
  • Added the GroundOverlay class to display images based on Bbox and automatically pad the overlay.
  • Added the function to plan (walking, cycling, and driving) routes. Before using route planning capabilities of JavaScript APIs in your project, you need to enable Directions APIs for the project.

[h2]4.0.0.300 (2019-12-30)

The feature updates for JavaScript API are as follows:

New Features

Provided JavaScript APIs for you to easily build map apps applicable to browsers. Supported basic map display, map drawing, and map interaction.