Skip to content

v0.4.0

Choose a tag to compare

@sheehanmunim sheehanmunim released this 07 Oct 02:08
· 100 commits to main since this release

Added

  • Terrain height. MapKit does not expose it, so munim-maps reads the free public Terrarium elevation tiles on AWS (zoom 14, bilinear, cached in memory and on disk, one request per tile at a time):
    • altitudeReference: 'sea' on models and paths: altitude is metres above sea level, such as a phone's GPS altitude, and the ground height there is taken off natively. The model shows once its tile has loaded; moving models load the tiles along their keyframes ahead of time.
    • followTerrain on MapModelLayer and MunimMapView (followsTerrain in Swift): on satellite imagery with realistic elevation, where MapKit draws real 3D terrain, models, paths and zones stay on the mountains instead of at the height of the ground at the map's centre. Models above sea level always follow the terrain.
    • groundElevation(coordinates): the height of the ground above sea level, from JavaScript, and MunimTerrain.shared.groundElevations(for:) in Swift.
  • MapModelLayer is tested over expo-maps' AppleMaps.View (SwiftUI Map) on device: it finds the MKMapView inside, and the self-test measures it within 1.6 points at three zoom levels.
  • Example: Yosemite in 3D with heights above sea level (munimmapsexample://terrain), models over expo-maps (munimmapsexample://expomaps), and terrain and expo-maps checks in the self-test.
  • MapKit parity on MunimMapView:
    • userTrackingMode="followWithHeading" is handed to MapKit, which owns the following (heading beam included, nothing recentres from JavaScript); onUserTrackingModeChange reports when MapKit drops it after a pan or zoom, or the tracking button changes it. Camera moves from code end tracking the same way. Location access is requested when needed. The old 'follow-with-heading' spelling still works.
    • Controls: compassVisibility and scaleVisibility (adaptive, visible, hidden), showsUserTrackingButton, pitchButtonVisibility (iOS 17+), and standalone MapCompass, MapScale and MapUserTrackingButton that drive the map with the same mapScope.
    • selectionAccessory: Apple's place card for tapped places (MKSelectionAccessory, iOS 18+), and mapItemForFeature(id) for the full place behind onMapFeaturePress.
    • Markers: displayPriority, collisionMode, titleVisibility / subtitleVisibility, SF Symbol glyphs (glyphSymbol, selectedGlyphSymbol), glyphColor, animatesWhenAdded, callout buttons and pictures (calloutLeft, calloutRight, onCalloutAccessoryPress) and calloutDetail.
    • clusterStyles (balloon colour, {count} glyph and title) and onClusterPress with the member ids.
    • <MarkerView>: React Native views as markers, drawn into a real MapKit marker (tracksViewChanges for live content).
    • Overlays: gradient polylines (strokeColors, strokeColorLocations), lineJoin, strokeStart / strokeEnd (updated in place, to animate a route), level (aboveRoads, aboveLabels) on every overlay, and onOverlayPress with tappable hit-testing for polylines, polygons and circles (overlayAtPoint(point) on the ref).
    • pointsOfInterest accepts short category names such as 'cafe'.
  • <LookAroundView>: Apple's Look Around embedded in your layout (coordinate or mapItemId, showsRoadLabels, pointsOfInterest, navigationEnabled, badgePosition, onSceneChange, onFullScreenChange).
  • MapKit services, no map needed: searchPlaces, createSearchCompleter (autocomplete, resolved to places), pointsOfInterest, directions and eta (transport types, alternates, dates, avoiding tolls and highways, steps), geocode and reverseGeocode (iOS 26 MKGeocodingRequest / MKReverseGeocodingRequest, CLGeocoder before), mapItem(id), openInMaps, mapSnapshot, hasLookAround, lookAroundSnapshot, formatDistance, and routePolyline to draw a route.
  • Example: a MapKit screen with all of it (munimmapsexample://parity, /follow, /callout) and 16 more self-test checks (services, overlay hit-testing, MarkerView, user tracking).

Fixed

  • The self-test's render check looked at one pixel in the middle of each model, which fell between the beams of the lattice Starbase tower at "close, pitched 70, heading 315" (on both MunimMapView and react-native-maps). It now looks for the model's pixels anywhere in its projected bounding box; alignment there was always within 1.7 points.
  • Updating markers no longer re-configures unchanged ones, which closed an open callout.

Changed

  • The vehicle catalogue is rebuilt to the jets' level of detail. Bodies are skinned through measured cross-sections, wings and tails are airfoil sections, and windows, seams, lights, stripes and markings are laid onto the skin, so they follow its curves instead of sitting on it as flat boxes:
    • Cars: beltline creases, flush glass split by the pillars, door seams and handles, lamps, grilles and bumpers on the body, arch-cut wheel openings and dished alloy wheels; the convertible has an open cabin.
    • Vans, trucks and buses: fitted windscreens and windows, sliding and swing doors, arch flares, DOT tape and roll-up doors; a long-hood semi tractor with a chrome grille and air cleaners, a crew-cab pumper, a 40 ft city bus and a conventional school bus.
    • Motorcycles: twin-spar, cradle and perimeter frames, swingarms, forks through triple clamps, round-profile tyres on cast or laced wheels with discs, an inline-four, a finned V-twin and a single, exhausts and lofted bodywork; a step-through scooter.
    • Boats: deep-V hulls with chines; a bowrider with an outboard, a 33 ft sloop, a 35 m superyacht and a personal watercraft.
    • Aircraft: airliners with winglets, nacelles, window rows and gear (plane-widebody is now its own twin-aisle, not a scaled narrow-body), a business jet with a T-tail, a Cessna 172-style high wing and a Bell 407-style helicopter.
    • Rail: a two-section tram and a high-speed train with a sculpted nose, bogies and pantographs.
    • Rockets: the Space Shuttle orbiter (double delta, tiles, OMS pods, main engines) now faces the front of the stack; Falcon 9 and Saturn V gain engines, legs, grid fins, fins and paint patterns.
  • Vehicle models share vertices across their markings and drop body sections that add no shape, so the jets are about 40% lighter; the whole catalogue is 15 MB.