The MapConductor React SDK is now at 0.3.0. All 23 packages on npm are at 0.3.0, and three of them are published for the first time.
In 0.2.1 we left packages whose contents had not changed at their old versions. This time every package moves together: the peerDependencies of js-sdk-core and js-sdk-react are now ^0.3.0, so a provider or extension package has to be ^0.3.0 to install alongside them. Upgrade every @mapconductor/* package at once.
First: bearing now turns the other way
The change with the widest reach comes first. MapCameraPosition.bearing now means increasing the value turns the map clockwise: at 90 the map turns 90° to the right and west is up. In 0.2.x the value was handed straight to each map SDK's camera heading, which turns the opposite way. The change brings the web in line with Android and iOS.
If your code hard-codes a bearing or stores one, flip its sign. Values from camera events, visibleRegion, screen projection and fitBounds all come back in the new direction too.
// Convert a bearing stored under 0.2.x to the 0.3.0 direction const bearing = (360 - oldBearing) % 360;
Two more changes are easy to trip over:
- The InfoBubble DOM changed. The SVG is gone; it is a single
div.mc-info-bubble, with the tail drawn by::before/::after. CSS aimed at the old SVG needs rewriting. In exchange the look can now be set withclassNameand CSS custom properties:--mc-bubble-color,--mc-bubble-border-color,--mc-bubble-border-width,--mc-bubble-padding,--mc-bubble-corner-radius,--mc-bubble-tail-size. MapLibreDesign.styleJsonURLis nowstring | object, so a parsed style can be a design as it is. TypeScript code that reads it as a string needs to narrow the type.
Vector styles, on every map
This is what 0.3.0 is about. Every *MapView now takes mapStyle, and the map's vector style can be adjusted with rules such as "roads in white", "labels off" or "darker water".
import { buildStyleRules, createVectorStyle, LayerRole } from '@mapconductor/js-vectorstyle';
const mapStyle = createVectorStyle({
rules: buildStyleRules((r) => {
r.all({ color: '#000000' });
r.role(LayerRole.label, { visible: false });
r.role(LayerRole.road, { color: '#ffffff', widthScale: 1.4 });
}),
});
<MapLibreMapView2D state={state} mapStyle={mapStyle} />The rules come from the new @mapconductor/js-vectorstyle. Selectors name a role — roads, water, labels — rather than layer ids, and the OpenMapTiles, Shortbread and Mapbox Streets schemas are recognised automatically. Android and iOS read the same rules JSON unchanged.
MapLibre, Mapbox and MapTiler read the style themselves. A rule change applies only the properties that differ, so dragging a slider never reloads a tile.
The other maps — Google Maps, Leaflet, OpenLayers, ArcGIS, Cesium, HERE, MapKit, deck.gl — cannot read a vector style. For them there is the second new package, @mapconductor/react-vectortile, which draws the style into raster tiles in the browser with a Rust renderer compiled to wasm, running in a Web Worker. Use it as a <VectorTileLayer> on top of the map, or pass a VectorTileRasteriser to createVectorStyle() and go through mapStyle. Changing a colour redraws the tiles already in memory and costs no network traffic.
Pass mapStyle to a map without a vector renderer and without a rasteriser, and onStyleDiagnostics says the style is unsupported — rather than the map quietly drawing nothing.
deck.gl is a new provider
We added @mapconductor/react-for-deckgl. <DeckGLMapView> has the same state and camera API as every other *MapView, and markers, circles, polylines, polygons, ground images and raster layers are drawn with the same code. No key is needed.
deck.gl has no map of its own, so the basemap is drawn from XYZ raster tiles. Four designs are built in — OpenStreetMap, Esri imagery, and CARTO light and dark — and passing a tile URL lets you use your own.
One caution: deck.gl registers its version on globalThis.deck and throws if a different version is already there. The Longdo and Mappls SDKs bring their own deck.gl, so keep them off the same page. @mapconductor/react-for-deckgl/state exposes only the state and the designs, so the map itself can be loaded later with lazy().
Other new features
- Blank designs. ArcGIS, HERE, Longdo, Mapbox, MapLibre, MapTiler and TomTom gain
None(Cesium, Leaflet, OpenLayers and Google already had it), for drawing only a vector style or overlays. ArcGIS'sNonestays in Web Mercator, so a missing basemap no longer drops the view to WGS84 and a silent blank map. - Switching designs keeps the map. Changing
mapDesignTypenow swaps the design in place, keeping the map, its overlays and the camera (except on Azure Maps and MapKit). It used to rebuild the map. Code that relied on that rebuild to reset overlays or the camera should be revisited. - Marker label position.
ColorDefaultIconandImageDefaultIcontakelabelPosition, written like CSSbackground-position:"right center"puts the label to the right. The default"center center"looks as before. - Let taps pass through. Polygon, Polyline and GroundImage take
clickable(defaulttrue). Withfalse, a tap reaches the overlay below or the map. - Marker decluttering.
MarkerTilingOptions.declutterPxkeeps one marker per N tile pixels. The default 0 changes nothing. - Faster marker tiles. A tile with 20,000 markers that took 277 ms now takes 38 ms (Chromium). ArcGIS's SceneView now asks for 256 px tiles and no longer fetches four times as many.
Fixes
- Zoom 0 was ignored.
createMapCameraPosition({ position, zoom: 0 })left the map where it was, swallowed by an "all zeros means position only" heuristic. The camera now remembers which fields you set, and only the unset ones are taken from the current camera. - A marker's
onClickwent stale. Rebuilding a marker with the same look viacreateMarkerState({ position, onClick })made clicks call the handler from an earlier render. - Holes in marker tiles. A tile whose render failed was cached forever as transparent, leaving a hole with icons cut off at its edge. Failures now return 503, so the map fetches again.
- Old raster or marker tiles came back. Changing tiled markers while the style was not editable left old tiles until the next change, or brought back a removed layer or a previous opacity.
- Marker hit area too large. Clicks up to about 8 px beside a default pin counted — roughly 60×60 px for a 31×45 px pin. Only the pin as drawn counts now, and where markers overlap the one drawn under the tap wins.
- Large markers clipped at tile seams. A large selected pin lost its top where it crossed a raster tile boundary.
- Raster overlays hid the map's labels. On Mapbox, MapLibre, MapTiler, Longdo and Mappls they now go below the first label layer. On Google Maps
zIndexwas treated as an array index; it is a stacking value now. - Markers near the antimeridian disappeared. Latitude is clamped to ±85.05112878 and longitude wraps, matching Web Mercator on Android and iOS.
- InfoBubble in the wrong place. With a side or top label, or after
marker.iconwas swapped in place, the bubble appeared where the old icon was. mapStyledid nothing on Google's 2D map. It was silently ignored.
Map SDK updates
Each range is the latest within its declared range. TomTom's @tomtom-org/maps-sdk moves a long way, from 0.51 to 0.64.
| Dependency | 0.2.x | 0.3.0 |
|---|---|---|
maplibre-gl | ^6.6.0 | ^6.16.0 |
mapbox-gl | ^3.29.0 | ^3.33.0 |
@tomtom-org/maps-sdk | ^0.51.5 | ^0.64.0 |
cesium | ^1.144.0 | ^1.146.0 |
@arcgis/core | ^5.1.20 | ^5.1.27 |
ol | ^10.10.0 | ^10.11.0 |
@googlemaps/js-api-loader | ^2.1.1 | ^2.1.3 |
leaflet, azure-maps-control and mappls-web-maps are unchanged. React stays at ^18.0.0 || ^19.0.0 in peerDependencies.
Packages and the map SDK each one uses
react-geojson, react-heatmap, react-kml and react-marker-clustering have the same source as 0.2.x. They still pick up the fixes above through the newer js-sdk-core.
react-icons is not part of this release and stays at 0.2.0. The Japan, United States and weather icon packs are not on npm yet.
react-geojson-layer is deprecated
@mapconductor/react-geojson-layer, renamed to @mapconductor/react-geojson in 0.2.0, is now marked deprecated on npm. Installing it prints a warning pointing at the new name. If you still use it, switch to @mapconductor/react-geojson.
Upgrading
npm install @mapconductor/js-sdk-core@^0.3.0 @mapconductor/js-sdk-react@^0.3.0 \ @mapconductor/react-for-maplibre@^0.3.0
Move the provider and extension packages you use to ^0.3.0 as well. Working samples are in the demo; "Style Adjustments" and "Vector Tile Layer" are the pages for this release's vector styles. Each package lives in its own repository — see github.com/MapConductor.