Skip to content

Release 1.4.0 - #28

Merged
wf9a5m75 merged 116 commits into
mainfrom
develop
Nov 13, 2026
Merged

wf9a5m75 merged 116 commits into
mainfrom
develop

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

Merge develop into main for the 1.4.0 release.

masashi and others added 30 commits September 1, 2026 11:43
bearing を「値を増やすと地図が時計回りに回る」向きに統一し、ネイティブ SDK との変換をコアの CameraBearing に集約する。
An independent SwiftPM package depending on ios-sdk-core, not a core
change — it implements the core's TileProvider and serves through the
existing LocalTileServer, the same way ios-heatmap does, so backends
that cannot render a vector style see ordinary raster tiles.

The renderer and its XCFramework come from the mapconductor-vectortile
repo via scripts/sync-sdk.sh; only the integration layer lives here.

Verified on the iPhone 17 Pro simulator: provider -> tile server route
-> URL template -> HTTP -> PNG, 5 tests.
RenderMode.gpu / .cpu / .auto, mirroring Android. Asking for .gpu explicitly and
quietly getting the CPU is the failure that hides worst, so that case throws
rather than falling back; .auto falls back silently by design.

gpuRenders and gpuFallbacks are public for the same reason the Android ones
are: a suite once passed green while every single tile fell back.
Reports rather than asserts a ratio: it measures the platform, and pinning a
number would only fail the suite on a faster machine. It exists so the claim
behind the whole-pixel rounding in ios-sdk-core is checkable on Apple hardware
instead of inherited from the Android measurement.
android-sdk reached this from the opposite direction. There, one snapshot
observer read every state to find in-place changes, and that cost the size of
the collection on every commit — 350 ms a frame while dragging 144k markers.
iOS already pushed: each state published its changes and the collector
subscribed. The bill arrives somewhere else.

Subscribing is one `map`, one `eraseToAnyPublisher`, one `receive(on:)` and one
`sink` per state, plus the `AnyCancellable` holding them, and it does not stay
linear:

  states     sync    now
   1,000     47ms    1ms
  10,000    236ms   15ms
  50,000  2,175ms   52ms
 144,183       —   134ms

on the main actor, on a simulator. The last row is Tokyo's street trees, which
is what raised the question. Whatever the old curve was doing between 10k and
50k, it was not going to make that a number anyone would wait for.

Replacing the fingerprint chain with `objectWillChange` was measured first,
since the states are all ObservableObject and that publisher already exists. It
came out worse — 2,898 ms at 50,000. The cost is the subscription machinery,
not the chain fed into it, so the fix is to have none: `didSet` on each
`@Published` property calls a closure the collector installed.

`asFlow()` stays. Several provider controllers subscribe to it directly rather
than through the collector, and they still pay per state — around a second to
subscribe 50,000 on the same machine. That is a separate path and a separate
change.

`overlayChangePublisher()` had exactly one caller, the collector, so the
protocol requirement goes with it and the six one-line conformances become
empty.

The web SDK was measured too and needs nothing: it also pushes, one closure per
state, and 144,183 markers land in 58 ms.
Tokyo's 144,183 street trees, the sample android-sdk has had since the marker
tiling work. A harder shape than the post office set: six times as many, inside
one metropolitan area rather than spread over a country, and each species draws
its own colour, so the renderer cannot collapse two trees of different species
that land on the same pixel.

All three read the same 2.8 MB asset — a magic, three string tables, then a
fixed 20-byte record per tree, little-endian. The source is a 12 MB Shift-JIS
CSV; parsing that on a phone or in a browser would measure CSV parsing rather
than the map. The web decode is 10 ms in node for the whole file.

Species colours come out of the same golden-angle hue rotation on each
platform, with the last index — the bucket holding every species under a
hundred trees — grey rather than competing with a named species for a hue. A
species is the same colour on all three.

The basemap is the stripped-down style the Android sample uses: land, water,
the major roads and the place names, with the finer streets from zoom 13. It is
MapLibre's own design type, so it applies there and the page runs on whatever
basemap the other providers bring.

Verified by rendering, not by compiling. iOS has a screenshot test that opens
the page and waits for the trees, because the failures here — asset missing
from the bundle, style URL unresolved — all look like "the map draws and the
trees do not" and none of them throw. It caught the first cut passing
declutterPx scaled by the content scale, which thinned a retina screen to a
third of the density Android shows.
bearing を「値を増やすと地図が時計回りに回る」向きに統一し、ネイティブ SDK との変換をコアの CameraBearing に集約する。
The module had neither a README nor a licence, unlike ios-heatmap and
the rest.

There is no SwiftUI wrapper here as there is on Android, so the usage
section is the two-route wiring itself — register groundTiles and
labelTiles, hand the label overlay over on onGlyphsLoaded with a fresh
cacheKey, close the provider — taken from the sample app rather than
invented.

Records why tileSize is limited to 512 and 1024 (MapKit's grid is built
from 256 and anything else draws a blank map; 768 was tried) and that
raising it does not make labels larger relative to the map.
CI here was api-surface and deploy only. Nothing ran the tests, so a
change that kept every signature and broke what was behind it went
through green.

Not `swift test`: it does not build. ios-sdk-core depends on
TilePng.xcframework, which carries ios-arm64 and ios-arm64-simulator
only, so building for macOS fails on the missing slice. Nobody noticed
because nothing was running it. The job targets a simulator instead.

The simulator is chosen at runtime rather than named. Pinning "iPhone 16"
means a runner image change fails the build for a reason that has nothing
to do with the code.

Xcode is pinned, from api/TOOLCHAIN. The api baseline records what the
Swift compiler emits, so a different Xcode produces thousands of lines of
diff with the sources untouched; failing with "wrong toolchain" beats
failing with a 3,000-line diff.

Also picks up the Web Mercator conformance test, which holds this
platform to the same answers as android-sdk and react-sdk.
SPM test targets cannot run tool-hosted on a device:

    Cannot test target "MapConductorCoreTests" on "iPad":
    Tool-hosted testing is unavailable on device destinations.

So the numbers behind "iOS is slower than Android" were coming from a
simulator running on an M-series Mac, which lies in the direction that
matters. The Benchmarks target is hosted by the sample app and runs the
same fixtures on the hardware.

What it found: 144,183 markers at zoom 9 took 281 ms on an iPad Pro 11
and 109 ms on a Pixel 5a. The core fix this pins brings it to 64 ms.

The street tree icons drop from 14 to 10, and the parameter is `sizePt`
rather than `sizePx` because that is what it always was — a
`UIGraphicsImageRenderer` makes device-scale pixels from a point size, so
passing points is what makes the icon density-independent. android-sdk
was the odd one out, building its bitmap at raw pixels, and has been
brought here rather than the other way round.
Carries the in-flight vectortile work alongside the marker fixes:
renderTile(request:isCancelled:) so an abandoned map stops paying for
doomed tiles, a disk cache keyed by style/generation, bundled glyphs
and the split ground/labels layer tests.
Benchmarks (a test-host target, because SPM tests cannot run on device)
measure what the simulator lies about: tile cost per zoom, GPU vs CPU
tile parity (DeviceSeamReproBench is the regression net for the Metal
rasterizer's misdraw), seam screenshots, phase breakdowns.

FrameGapProbe logs dropped display-link frames per second and
MainThreadHangSampler walks the main thread's frame-pointer chain when
it stalls over 300ms -- xctrace cannot attach to this device, so the
app carries its own profiler. Debug builds only.

The street tree page reads MAPCONDUCTOR_SAMPLE_INIT_CAMERA for
deterministic repro at a reported spot, and MAPCONDUCTOR_SAMPLE_TILE_DEBUG
bakes a gray tile grid with x/y/z labels into marker tiles so a seam
report can name the exact tile pair.
The probe wraps another provider, and its job is to observe, not to
decide. Swallowing the throw would turn a failed tile into an empty
one -- which is exactly the confusion the core change removes.
Draw many polylines as tiles, with the Boston roads sample
ios-sdk-core: taps find tiled circles through the tile index (1.2 s -> 0.1 ms at 723,800 circles); in-place tile edits flush off the main thread. ios-for-openmobilemaps: onPostProcess reads only natively drawn circles (a tap after panning: 24.5 s -> 1.3 s on iPad Pro). GL providers import the driver SPI for nativeEntities().
Add bulk Circles and nationwide raster demo
The blue P marker now has zIndex 1, so it is drawn in front of the red T
at the same point on every provider (equal zIndex no longer falls back
to add order). Also drop the comment's claim that scale moves the pin
tip off the anchor; it does not.
…merges

ios-for-arcgis 26aa83f..e0a9636
ios-for-googlemaps 30698ff..ef2142a
ios-for-here 4c6b14e..0979679
ios-for-longdo 83752ad..c0ea8f8
ios-for-mapbox 4b4ef30..0f97ccd
ios-for-mapkit e6644b1..789cacd
ios-for-maplibre 035b28a..3aa5e6c
ios-for-mappls fa9db93..c75eec9
ios-for-maptiler 7c8c19a..b044764
ios-for-openmobilemaps 6e71314..3ede5aa
ios-sdk-core 695ee1a..84560b8
Includes MapCameraPosition.fov / paddings and the ArcGIS and Leaflet tilt fixes.
Includes MapCameraPosition.fov / paddings and the ArcGIS and Leaflet tilt fixes.
Resolve the sample app against MapLibre Native iOS 7.0.0
Move all submodules to their current develop
T-Mobile / Sprint (pink) and Verizon (red) were too close to tell apart on the map.
Draw Verizon in orange in the antenna sample
Points ios-sdk-core at its add-progress branch.
Add progress callbacks for Markers/Circles/Polylines/Polygons
Point ios-sdk-core at the marker tap fix
@wf9a5m75
wf9a5m75 merged commit 59b5f0e into main Nov 13, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant