All notable changes to this project are documented here. The format follows Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

0.4.0 - 2026-12-01

This release completes the camera, takes MapLibre's remaining options as props, and adds the places where an application plugs in its own JavaScript: custom layers, controls and protocols. The one change that can break an application that upgrades is marked Breaking below.

Added

  • window.HoloMap.registry, where an application registers the JavaScript that MapLibre takes as code, under a name, from a script its layout loads. A page can fill it before the runtime loads, as a plain list of callbacks, each called with the register functions. register.protocol(scheme, load) adds a protocol to MapLibre, for every map on the page, and to the copy of MapLibre each page bundle carries. A name registered again replaces the first, with a console warning. The new guide, Registering JavaScript, explains how to load the script with Hologram.
  • HoloMap.Map's transform_request and missing_image_resolver name functions registered with register.function(name, fn). MapLibre calls the first before each request it makes, the style's first, and the second for each image a tile needs that the map lacks, before it reports the image missing. Each function also receives %{map, cid}. Both apply as they change. A name not registered yet warns once and is looked up again on every call, so a function registered later is used from then on. An image a HoloMap.Image declares is left to the component. What the resolver throws or rejects with is reported through on_error; what the transform throws fails that request, which MapLibre reports the same way, the style's first request among them, which MapLibre makes while it builds the map: the browser runtime hands MapLibre the error as a promise that rejects, so that the failure comes once on_error listens.
  • The demo's JavaScript page, which registers a custom WebGL layer, a custom control, a demo:// protocol, a request transform and a missing image resolver from a script its layout loads, and the browser suites' checks of each, the layer read back from the canvas through a diffed style, a style built from scratch and a WebGL context loss.
  • HoloMap.Layer.Custom, a layer drawn by WebGL code of the application's, such as three.js, built by a factory registered with register.layer(name, factory) from the component's options and %{map, cid, id}. It stacks in template order with the other layers, and before_id places it. It stays through every style change: a diff keeps the same object and puts it back in its place, a style built from scratch gets the same object again, and after a WebGL context loss the runtime adds it again, as MapLibre asks. Each onAdd is followed by one onRemove: the runtime calls the ones MapLibre does not, for a style built from scratch and when the map is torn down. An options change calls the object's update(options) and draws again, or builds the object again without one. A style whose own layer has its id takes the id, as for any layer. What the factory, onAdd, update or onRemove throws is reported through on_error, and so is the first error each of render, prerender and renderToTerrainTile throws.
  • HoloMap.Control.Custom, a control built by a factory registered with register.control(name, factory), from the component's options and %{map, cid, id}. It is added and removed with its component, keeps its place among the built-in controls in its corner, and stays through a style change. An options change calls the control's update(options) when it has one, and rebuilds it otherwise. A factory registered after the map booted adds the controls waiting for it. What the factory, onAdd, update or onRemove throws is reported through on_error, and the control's element leaves the page with its component even if onRemove leaves it there.
  • HoloMap.Map's request_rules: a list of rules, each a url_prefix with headers or credentials to add to the requests MapLibre makes whose URL starts with it, the style's first. The first rule that matches applies. Prefixes and URLs are compared resolved against the page, so a relative prefix matches either way, and a prefix that names a host ends there. The rules apply as they change, from MapLibre's next request, and before transform_request, whose function receives the request they made as request in its third argument, to sign it or answer another; what it answers wins, and nothing, or a promise of nothing, keeps the rules' request. A rule MapLibre cannot take raises ArgumentError, with a message that names the key and not its value. The rules are rendered into the page, so the Installation guide and HoloMap.Map say which credentials belong there.
  • A console warning for a source component whose url, tiles or data names a scheme with no protocol registered for it, such as a pmtiles:// source on a page that does not load the script registering PMTiles' protocol. MapLibre reports those requests as failed fetches, which do not say what is missing. The warning comes once for each scheme on each map, and names the source and the scheme, not the URL.
  • PMTiles archives, through PMTiles' own protocol registered with register.protocol. HoloMap does not import the pmtiles package, so an application that does not use PMTiles builds without it: the Installation guide's new section, PMTiles archives, serves the package's browser build with a script tag of its own, and the Registering JavaScript guide shows the registration and an archive that needs a header. There is no protocols prop on HoloMap.Map: MapLibre's protocols belong to the page, and registering one covers every map.
  • The demo's PMTiles and request rules page: vector tiles from a PMTiles archive the demo writes at build time and serves itself, read with range requests, and a request rule whose header reaches the towns' GeoJSON and not the sprite, with a new key applied from MapLibre's next request. The browser suites check each, and the page is in the layers, accessibility and navigation suites.
  • HoloMap.API.fly_to/2, ease_to/2 and jump_to/2 take :roll, :elevation, :around, :min_zoom and :freeze_elevation, and fit_bounds/3 takes :absolute_padding, :roll, :easing, :speed, :curve, :screen_speed, :max_duration, :min_zoom and :freeze_elevation, under MapLibre's names. :around is a coordinate in any shape HoloMap.Spec.lng_lat/1 accepts, and :offset an {x, y} tuple, each sent as the list MapLibre takes. fly_to/2 documents which of the three moves reads each option: MapLibre's flyTo and easeTo ignore :elevation, which only jump_to/2 sets, and only ease_to/2 reads :around.
  • HoloMap.API.camera_for_bounds/3 takes :absolute_padding, and its answer then carries the padding it fitted the box with.
  • HoloMap.API wraps the rest of MapLibre's camera methods: pan_by/3, pan_to/3, zoom_to/3, zoom_in/2, zoom_out/2, rotate_to/3, reset_north/2, reset_north_pitch/2, snap_to_north/2, stop/1, fit_screen_coordinates/5, set_padding/2, set_vertical_field_of_view/2, set_roll/2, set_center_elevation/2 and set_center_clamped_to_ground/2. Each takes coordinates and pixel positions as tuples, and raises ArgumentError for an argument MapLibre does not take and for an option the method does not read, the one its own argument stands for among them. request/4 documents the answers of getRoll, getPadding, getCenterElevation, getVerticalFieldOfView and getCenterClampedToGround.
  • HoloMap.Map's roll and elevation, camera props as center, zoom, bearing and pitch are: MapLibre builds the map with them, and a change jumps the camera to the new value, without reporting the move to the camera events. Set back to nil, they leave the camera as it is.
  • HoloMap.Map's handler props take a map of the handler's settings as well as true and false: drag_rotate takes around, "pointer" to turn the map about the point under the pointer, and movement; drag_pan its glide, linearity, deceleration and max_speed; scroll_zoom around, zoom_rate and wheel_zoom_rate; touch_zoom_rotate rotation, around, zoom_rate and zoom_threshold; keyboard rotation; and the new touch_pitch prop around. rotation: false keeps the keyboard, or two fingers, from turning the map, each on its own. The settings reach MapLibre as it builds the map and apply as they change: a handler is turned off and on again for the settings MapLibre reads as it turns on, and the others go through the handler's setters. Booleans work as before. A setting a handler does not take raises ArgumentError.
  • Typed HoloMap.Map props for MapLibre's other constructor options, rather than options in camelCase: bounds with fit_bounds_options, which take the options of HoloMap.API.fit_bounds/3, rotate_speed, pitch_speed, roll_enabled, reduce_motion, click_tolerance, max_canvas_size, max_tile_cache_zoom_levels, zoom_levels_to_overscale, terrain_skirt_length, cross_source_collisions and refresh_expired_tiles, which MapLibre reads only as it builds the map and which warn once when they change, and zoom_snap, anisotropic_filter_pitch, center_clamped_to_ground and cancel_pending_tile_requests_while_zooming, which apply as they change. The props table says which is which.
  • The demo's camera page steps the camera with the new methods, stops a long flight, opens a side panel with set_padding/2 and fits a box beside it with absolute_padding. The coverage suite reads each step back from MapLibre's camera.
  • The demo's camera page has a turntable map whose drag turns it about the pointer or the centre, and whose keyboard and touch rotation switch off and on each on its own. The components suite drags it with the right button, presses Shift and the arrow keys, and turns it with two fingers in a context with touch.
  • HoloMap.Source.GeoJSON's incremental: a data change reaches MapLibre's updateData as the features that changed, compared by id with the ones the source holds, rather than the whole collection through setData, so MapLibre loads again only the tiles the changes touch. Each feature needs a unique id, its own id or the property promote_id names; data with a feature that has none or shares one, and a source with generate_id, is set whole with setData, with one console warning for the source. Data that is not a FeatureCollection given inline, such as a URL, is set whole. A cluster change in the same render applies first. The data stays the declared one through a style change, a style built from scratch and a lost WebGL context, where the browser runtime sets it again if MapLibre's snapshot left out a diff its worker had not applied.
  • HoloMap.API.update_geojson/3, which hands a GeoJSON source's updateData a diff, :add, :update, :remove and :remove_all, for an application that already knows which features changed, without changing the source's data prop. The source keeps the change through a render that leaves data as it was, a style change, a style built from scratch, a source rebuilt for another prop and a lost WebGL context. The next change to data wins, and the source then holds exactly the new data: an incremental source gets a diff from what it holds, the call's changes included, and any other the whole data. That holds when the call and a later render both wait for a style or a lost WebGL context: the call applies to the data the source held, and the render's data replaces it. A source MapLibre could not apply a diff to, such as one whose data is a URL or whose features lack ids, and a diff that adds a feature without an id change nothing and log a console warning. A diff of the wrong shape raises ArgumentError.
  • HoloMap.Popup's track_pointer, which makes the popup follow the pointer over the map with MapLibre's trackPointer(), in place of lng_lat, which it then does not need. It switches either way in place, and a popup built again for new options goes on following the pointer. Also padding, the pixels MapLibre keeps between the popup and the map's edges as it picks the side the popup opens on, set in place with setPadding, and location_occluded_opacity, the popup's opacity while its coordinate is behind the globe, which builds the popup again, as MapLibre has no setter for it. HoloMap.Marker's popup_options take both. A padding that is not a map of :top, :bottom, :left and :right to numbers raises ArgumentError, and so does a HoloMap.Popup with neither lng_lat nor track_pointer.
  • HoloMap.Marker's opacity_when_covered, the marker's opacity while terrain or the globe covers it, set in place with MapLibre's setOpacity with opacity, each back to MapLibre's default once taken out, and popup_open, which opens and closes the marker's popup from state with togglePopup when the marker is built with it and when it changes. An open it asks for takes keyboard focus as focus_after_open says; a marker or popup built again keeps its popup as it was, without moving focus, unless popup_open changes in the same render. The user's clicks still toggle the popup in between.
  • HoloMap.Control.Logo, MapLibre's logo as a control, with compact, in MapLibre's bottom-left corner unless position says otherwise, and HoloMap.Map's maplibre_logo and logo_position, which have MapLibre add the logo as it builds the map, and are build only. A logo_position that is not a corner raises ArgumentError.
  • HoloMap.Control.Navigation's visualize_roll, and HoloMap.Control.Fullscreen's pseudo and container, the id of the element to make fullscreen in place of the map's container, which the browser runtime looks up as it adds the control. An id no element on the page has is warned about once, and the control makes the map's container fullscreen.
  • HoloMap.Map's debug toggles, show_tile_boundaries, show_collision_boxes, show_overdraw_inspector and show_padding, which the browser runtime assigns to MapLibre's map properties of the same names once the map is built and as they change. show_collision_boxes waits for a style, as a layer does, since MapLibre draws the boxes from the style's tiles and throws turning them on while the WebGL context is lost.
  • HoloMap.Map's settings for the whole page, next to worker_url: worker_count, max_parallel_image_requests, trusted_types_policy and prewarm, which the browser runtime hands MapLibre's setWorkerCount, setMaxParallelImageRequests, setTrustedTypesPolicy and prewarm before it builds the first map, and keeps out of the map's options. The first map to boot with a copy of MapLibre sets them, and a later map that asks for another value of one runs with the page's, with a console warning that names the setting, once for each value; a change on a built map warns as well. trusted_types_policy names the Trusted Types policy the browser runtime creates for MapLibre, which lets it start workers only from the page's own origin, or from a blob: URL it made, and hands an attribution to MapLibre's sanitizer. The runtime creates the policy once per page and hands it to the copy of MapLibre each page bundle carries, so the page's trusted-types directive needs no 'allow-duplicates'; a name the browser refuses is warned about. A count that is not a positive integer, or a policy name the directive could not list, raises ArgumentError. The Installation guide's new Trusted Types section shows a page that enforces them, with the default policy Hologram's code and the components' markup need.
  • The demo's basic page sets the four, and the browser suites check that MapLibre starts the two workers asked for, and that the map loads its style and tiles, with nothing refused, on a page that enforces Trusted Types.
  • HoloMap.API.download_image/2, which saves the map's current view as an image file from the browser, under a :filename, and HoloMap.API.export_image/2, which answers a :reply action with the view as a data: URL, its format and its size in pixels, on the request and reply channel. Both take :format, PNG, JPEG or WebP, and :quality. The browser runtime asks MapLibre for a frame and reads the canvas in the render event that ends it, so no preserveDrawingBuffer is needed. export_image/2 measures the data URL in the browser and answers one longer than :max_bytes, a million bytes unless set, with an :error, sending none of it. The image holds MapLibre's canvas alone, without the attribution, which the Imperative API guide's new section, Exporting the view, says to add where the image is used. A value either function does not take raises ArgumentError.
  • The demo's vector page downloads its view as a PNG, exports it as a JPEG data URL, shown with the tiles' credit, and asks again with a 1 kB cap. The browser suite checks that the PNG has the canvas's size and the live frame's pixels, in Chromium and, when Playwright's Firefox is installed, in Firefox, that the JPEG stays within its cap and holds the frame, and that the capped export is answered with an error.

Changed

  • Breaking: HoloMap.API.fly_to/2, ease_to/2, jump_to/2 and fit_bounds/3 raise ArgumentError for an option they do not know, as the other HoloMap.API functions do, rather than leaving it out: a misspelt option used to do nothing, silently. An :offset that is not an {x, y} pair of numbers raises as well. fit_bounds/3 refuses :center and :zoom, which the fit decides.

  • The browser runtime puts window.HoloMap.map, cids and destroy on window as soon as it loads, rather than once the first map boots. A page that registers JavaScript makes window.HoloMap before the runtime loads, holding registry alone, so code that waits for a map should ask window.HoloMap?.map?.(cid) rather than window.HoloMap && window.HoloMap.map(cid).

Fixed

  • A handler's settings given through HoloMap.Map's options, such as %{"scrollZoom" => %{"around" => "center"}}, reached MapLibre only when the handler turned on, so a change to them while it was on did nothing. A change now turns the handler off and on again with them, as for the handler props.

  • A style that failed to load held the map's work for good. A style change, or HoloMap.API.set_style/3, whose URL answered 404, could not be reached or was not JSON left the definitions rendered meanwhile, HoloMap.API calls and requests waiting until another style loaded, on a map that went on drawing the style it had. MapLibre's error now ends the change: the work runs on the style the map kept. A style built from scratch, or the map's first, leaves the map with no style, so the requests that waited, and every request made until the map is asked for another style, are answered with an :error naming MapLibre's; the definitions and the other calls wait for that style, and a set_style/3 call asks for it at once. The failure reaches on_error, or the browser console. The browser runtime listens for MapLibre's error event only while a style loads, and logs what nothing else hears, as MapLibre does. The style prop keeps the value the page rendered; "Changing the style" in HoloMap.Map says how to ask for a failed style again.

  • A HoloMap.Marker built again while the user had its popup open, by a change to its slot content, color, scale, class_name, anchor, click_tolerance or popup_options, opened the new popup with focus_after_open on, its default, so keyboard focus jumped into the popup on every such change. The browser runtime now opens it with focus left where it is, and leaves focus_after_open as the application set it, so a popup the user opens still takes focus.

  • An open HoloMap.Popup replaced by one built with new options, by a change to anchor, close_button, close_on_click, close_on_move or focus_after_open, took keyboard focus in the same way. The browser runtime now opens the replacement with focus left where it is, and a popup the application's state opens still takes focus.

  • Style changes by URL made in quick succession could end on a style that a later change had replaced. MapLibre's request for a style it aborted sets the request it holds back to none, although by then it holds a newer one, so the change after that aborts nothing, and MapLibre diffs the replaced style whenever it arrives (Map#_diffStyle in 6.19.0 and 6.20.0). The browser runtime now numbers each style change and hands the diff of any but the last the style the map has, so it changes nothing: the map ends on the last style asked for, with the components' sources and layers in place, and the work waiting for that style goes on waiting for it.

0.3.0 - 2026-11-30

This release lets the map answer questions and report more of what happens on it, and turns MapLibre's style state into props. The one change that can break an application that upgrades is marked Breaking below.

Added

  • A request and reply channel: HoloMap.API can ask the map something, and the answer arrives as the params of the action named with :reply, which takes the shapes an event prop takes. The params hold :result, the answer as plain data, or :error, %{message: message}, when MapLibre throws or reports an error while it answers, a promise it returns rejects, or there is no map to answer: one that did not boot within five seconds, that MapLibre could not build, or that HoloMap.Runtime.destroy/1 tore down. Coordinates arrive as [lng, lat], pixel positions as [x, y], bounds as [[west, south], [east, north]], and features as layer events carry them. Requests queue with the other calls, in order, and wait for the map to boot and for a style to load. HoloMap.Runtime.call/3 still discards what the method returns.
  • HoloMap.API.query_rendered_features/2 and query_source_features/3 find features and send them to the reply action. An answer carries at most 100 features, or the number given with :limit, says with truncated: true when it left some out, and leaves geometry out with geometry: false.
  • HoloMap.API.project/3, unproject/3, query_terrain_elevation/3, camera_for_bounds/3 and get_feature_state/3, and HoloMap.API.request/4, which asks any method of the map, or with :source of one of its sources, by name, such as getCenter, getStyle or areTilesLoaded. Its documentation lists what each getter answers. Each checks its options and raises ArgumentError for one it does not take. The Imperative API guide's new section, Asking the map, explains the pattern and the bound on answers.
  • Every layer component takes expand_cluster_on_click: a click on a cluster of a clustered GeoJSON source eases the camera to the cluster's point, at the zoom where it breaks apart, as MapLibre's getClusterExpansionZoom gives it, all in the browser, with no action. A click on a feature that is not a cluster does nothing more. The layer's on_click still hears the click and is dispatched first. The move uses easeTo's defaults and is reported to the map's move events as a user's move is. A source that is not clustered leaves the camera where it is, with a console warning. HoloMap.Layer's new section, Expanding clusters, has the details.
  • HoloMap.API.expand_cluster/4 makes the same move from an action, with the options of ease_to/2 other than :zoom, such as :center and :duration. get_cluster_leaves/4 reads the points a cluster holds and get_cluster_children/4 what it breaks into at the next zoom, and both send them to the reply action as features, as queries do, each with the source asked as its source. get_cluster_leaves/4 pages through the points: :limit, 100 unless given, is the most the answer holds, and is MapLibre's own limit, :offset how many it skips, and truncated: true says the cluster holds more after them. request/4 gives the two source methods the same bounded answer, and answers them with an :error for a source that is not clustered. The Imperative API guide's new section, Clusters, shows both.
  • HoloMap.Map takes global_state, a map of the values a style's global-state expressions read, sent as MapLibre's global state with each name as written. The map is built with it, so the first render draws with it. A change sets each name that changed with setGlobalStateProperty, and MapLibre restyles the layers that read it without their paint, layout or filter being sent again. A name taken out, or set to nil, goes back to the default the style declares for it. Every new style is handed the global state, whether MapLibre diffs it or builds it from scratch, so the values hold through a style change. The Getting started guide's new section, Many layers from one value, shows the pattern.
  • HoloMap.Map takes projection: "mercator", "globe", "vertical-perspective" or an expression that picks one by zoom. It wins over the style's own projection. It is put in place once the first style has loaded and as it changes, with setProjection and no style reload, and a style change keeps it, whether MapLibre diffs the new style or builds it from scratch. Set back to nil, the style's own projection returns. HoloMap.Control.Globe switches it until the prop or the style changes. MapLibre keeps an expression's projection when asked for "globe" after it; the browser runtime puts mercator in between, unreported, so the prop switches to a real globe.
  • on_projection_transition on HoloMap.Map reports each projection MapLibre puts in place, including the first, a change to the prop and a click on HoloMap.Control.Globe, with the camera and projection, the projection's type as the prop takes it. A style the prop replaces the projection of reports only the prop's, so writing the payload back into state never echoes.
  • HoloMap.Control.Geolocate reports its events: on_geolocate with the browser's position, as coords (longitude, latitude, accuracy, altitude, altitude_accuracy, heading, speed) and timestamp, on_error with the error's code and message, on_out_of_max_bounds with the position outside the map's max_bounds, and on_track_start, on_track_end, on_user_location_focus and on_user_location_lost_focus with no payload. HoloMap.Control.Fullscreen reports on_enter and on_exit. A change to a control's handlers alone keeps the control, still following the user if it was, and a control rebuilt for another prop has its listeners moved to it. MapLibre GL JS 6.20.0 fires the geolocate control's events without the position's or the error's fields, which browsers keep on the prototype; the browser runtime reads them from what the control was handed, so the payloads are the same on 6.19.0 and 6.20.0.
  • HoloMap.Control.Geolocate takes zoom_to_user_accuracy: false keeps the zoom when the camera moves to the user.
  • HoloMap.API.trigger_geolocate/1 asks for the user's position from an action, as a click on the map's geolocate button does; the answer arrives through the control's events. A map with no geolocate control logs a console warning, and one with several triggers the first declared, with a warning.
  • Every event prop takes a rate limit in its handler map: %{action: :moved, throttle: 100} dispatches the first event at once and then at most one every 100 ms, always ending with the last, and %{action: :rested, debounce: 250} dispatches the last event once none has come for 250 ms. 0 dispatches every event. A handler with both, or with a value that is not a non-negative integer, raises ArgumentError. The Events guide's new section, Throttling and debouncing, has the details.
  • HoloMap.Map reports 39 more MapLibre events. Loading: on_data, on_data_loading, on_data_abort, on_source_data, on_source_data_loading, on_source_data_abort and on_style_data, with data_type, and for a source source_id, is_source_loaded and source_data_type, so an application can show a loading state per source. Robustness: on_style_image_missing with the image's id, on_webgl_context_lost, on_webgl_context_restored, on_resize, on_cooperative_gesture_prevented with gesture_type, and on_terrain with the terrain put in place or nil. Gestures: on_drag_start, on_drag_end, on_zoom_start, on_rotate_start, on_pitch_start, on_roll_start, on_roll_end, on_box_zoom_start, on_box_zoom_end, on_box_zoom_cancel, on_wheel, on_mouse_down, on_mouse_up, on_mouse_over, on_mouse_out, and on_touch_start, on_touch_move, on_touch_end and on_touch_cancel with lng_lat and point. Every frame: on_move, on_zoom, on_rotate, on_pitch, on_roll, on_drag and on_render, throttled to 100 ms unless the handler names a limit of its own. Each carries the camera, as the other map events do, and a camera move the runtime makes for a camera prop reports none of them.
  • Layers report on_mouse_over, on_mouse_out and on_touch_cancel.
  • HoloMap.Sprite adds an icon sprite next to the style's own, with MapLibre's addSprite, and a symbol layer names its icons "<id>:<icon>". A URL relative to the page is resolved against it, since MapLibre takes only an absolute one. A new url replaces the sprite, and the component's removal takes it off. A sprite whose id the style's sprite uses is the style's, with a console warning, as a source or a layer is. A style change keeps the sprite: a diff carries it into the new style, after the new style's own, a style built from scratch has it added again, and the style MapLibre builds again after a WebGL context loss holds it.
  • HoloMap.Map takes glyphs, a glyph server URL, and font_faces, font files by the font name a layer's text_font names, for scripts a glyph server cannot draw, as a URL or a list of %{url: url, unicode_range: ranges}. Each replaces the style's own once the first style has loaded, and as it changes, with setGlyphs and setFontFaces, and holds through every style change and a WebGL context loss. Set to nil, the style's own return. HoloMap.Map's new section, Glyphs and font faces, has the details.
  • HoloMap.Light sets the light that shades fill-extrusion layers, with anchor, color, intensity and position, over the style's own light with MapLibre's setLight, and updates it as its props change. Taken out of the template, it returns the map to the style's light, or to MapLibre's default. MapLibre leaves the style's own light in the stylesheet, which a diff and the copy a WebGL context loss rebuilds from carry, so the browser runtime sets the light again once every new style has loaded.
  • HoloMap.Layer.Background, a colour or pattern over the whole map, which draws no source and so takes no source, source_layer, filter or event props, and HoloMap.Layer.ColorRelief, elevation drawn as colour from a HoloMap.Source.RasterDEM, MapLibre GL JS 5.6.0 and later.
  • HoloMap.Source.Vector takes encoding, "mvt" or "mlt" for MapLibre Tiles, and sparse, experimental in MapLibre, which draws a tile the server answers with a 404 from a lower zoom.

Changed

  • A change to a vector, raster or raster-dem source's tiles or url, or to a GeoJSON source's cluster, cluster_radius or cluster_max_zoom, now applies in place, with MapLibre's setTiles, setUrl and setClusterOptions, where it took the source's layers off the map, built the source again and put the layers back. The layers stay as they are, and keep what HoloMap.API set on them, the terrain stays on its source, and MapLibre requests the tiles again or builds the clusters again. A change to data with the cluster options goes through setClusterOptions, then setData. Taking tiles, url, cluster_radius or cluster_max_zoom away, and any other source change, still rebuilds the source. After a WebGL context loss, the browser runtime sets cluster options changed in place again on the source MapLibre builds again, which its snapshot holds with the options the source was added with. The Architecture guide's Update costs table and the Limitations guide list the new costs.

Fixed

  • On a map built with collectResourceTiming through HoloMap.Map's options, a change to a GeoJSON source's data rebuilt the source and its layers instead of going through setData: MapLibre writes the flag into the source spec addSource is given, and the browser runtime compared the next spec with that one, which then differed. MapLibre is now handed a copy.
  • After the browser took a map's WebGL context away and gave it back, prop changes no longer reached the components' sources and layers. MapLibre builds the style it had again from a snapshot that holds them, and the browser runtime took it for a new style that used their ids: it logged a "the new style already defines" warning for each and left them to the style. The rebuilt style now counts as the map's own: the components' sources, layers, images, terrain and sky stay theirs, an id the style held before stays the style's without a second warning, and the declared global_state and projection hold, where MapLibre would hand the style the global state the map was built with. Changes, HoloMap.API calls, an image that arrives and a style change made while the context is lost wait for the rebuilt style, where they reached a map with no style and were dropped, or made MapLibre build an empty one. HoloMap.Map's new section, Losing the WebGL context, has the details.
  • An event a map fired while Hologram navigated away could run its action on the next page, raising FunctionClauseError there: the morph patches the map's container into an element of the next page, which stays in the document under another id, and the browser runtime dispatched until it disposed of the map, a moment later. It now dispatches nothing from a map whose container no longer has the map's id. A navigation away from a page with on_source_data hit it every time.
  • An atom named after a browser global among the arguments of a HoloMap.API call or HoloMap.Runtime.call/3 reached MapLibre as that global: Hologram's interop reads an atom such as :top, :name or :status as window.top, window.name or window.status, so set_feature_state(cid, feature, %{mode: :top}) set mode to the Window object. call/3 now sends the method and its arguments as one JSON string, encoded with HoloMap.JSON, as requests do, and every atom arrives as its name. A tuple still arrives as a list, a keyword list as a list of [key, value] pairs, and nil as null.
  • Breaking: as a result, HoloMap.Runtime.call/3 no longer accepts a term JSON cannot carry. A struct (a Hologram.JS.NativeValue among them), a function or a pid among the arguments now raises ArgumentError before anything is sent, where the interop handed it over to MapLibre.

0.2.0 - 2026-11-30

This release moves to Hologram 0.12 and MapLibre GL JS 6.19. The changes that can break an application that upgrades are marked Breaking below.

Added

  • HoloMap.API.set_style/3 takes diff: false, which asks MapLibre to build the new style from scratch, as every style change did before this release: the map starts from an empty style, and the runtime declares the components' sources, layers, images, terrain and sky again once it has loaded. set_style/2 lets MapLibre diff the new style, as the style prop does. An unknown option, or a :diff that is not a boolean, raises ArgumentError.
  • HoloMap.Popup takes text and HoloMap.Marker takes popup_text: a popup's content as plain text, which MapLibre's setText puts in a text node, so a value the application does not control, such as a place name or a review, shows as it is and is never read as markup. text wins over html and slot content, and popup_text over popup_html. A popup or marker given both shows the text and logs a console warning, since showing the html instead would silently drop the choice of text. A change updates the popup in place. The Limitations guide's new section on untrusted content in popups compares the three kinds of content, and says that slot content reaches MapLibre's setHTML as the markup Hologram rendered, in which a value Hologram rendered as text stays escaped.

Changed

  • Breaking: HoloMap is now written against MapLibre GL JS 6.19.0, and the Installation guide installs maplibre-gl@^6.19.0. The browser suites run on 6.19.0 and 6.20.0, and the demo locks 6.20.0, the release that requirement resolves to today. HoloMap.maplibre_version/0 returns "6.19.0", the lowest release the requirement accepts. An application that locks an earlier 6.x release should move to 6.19.0 or later with npm install --prefix assets maplibre-gl@^6.19.0.
  • Breaking: MapLibre GL JS 6.19.0 ships no maplibre-gl-shared.mjs.map, so a copy step that lists it, as the demo's did, fails. The Installation guide no longer copies maplibre-gl-shared.mjs either: since MapLibre 6.13.0 the worker is self-contained and that file is empty, kept by MapLibre only until its next major version. Remove both from the copy step. An application pinned below 6.13.0 still serves maplibre-gl-shared.mjs next to the worker.
  • Breaking: HoloMap.Map's default worker_url now carries the version of the MapLibre the page loaded as a v query parameter, /assets/maplibre-gl-worker.mjs?v=6.19.0 on 6.19.0, as MapLibre's own default has since 6.13.0, so a browser or proxy can no longer keep serving the worker of an earlier release after an upgrade. The browser runtime reads the version from MapLibre's getVersion(). Plug.Static ignores the query and needs no change; anything that matches the worker's full URL, such as a rewrite rule or a CDN cache key, must allow the query. worker_url={nil} now selects this default, where it used to leave MapLibre's own resolution in place, which fails once Hologram bundles MapLibre. A worker_url the application sets is used as it is, with nothing added.
  • The HoloMap.Map and Installation guide text on a worker that fails to load now matches MapLibre 6.11.0 and later, which reports it through the map's error event. on_error receives it with the message "Worker failed to load. Check that the worker URL is correct.", and a map without on_error leaves MapLibre to log it to the console. The earlier text said nothing reports it.
  • Breaking: HoloMap now requires Hologram ~> 0.12.11, that is 0.12.11 or a later 0.12 release, and is tested on 0.12.11. Hologram 0.11 is no longer supported. The previous requirement, ~> 0.11, accepted every release up to 1.0, including minor releases nothing had tested.
  • Breaking: a template that relied on Hologram escaping a literal attribute now renders it as markup. HoloMap.Popup's html and HoloMap.Marker's popup_html are inserted as markup however they are written. Hologram 0.11 escaped both the text of a literal attribute and any value inserted into it. Hologram 0.12 escapes neither: a plain literal such as html="<b>hi</b>" arrives with its character references decoded, and a literal with an inserted value such as html="<b>{@name}</b>" arrives as the text and the value joined, unescaped. A value passed as an expression, such as html={@html}, arrives as it is, as before, so an escaped string passed that way stays escaped. An application must escape any value it does not control before it interpolates it. The Limitations guide shows how.
  • Breaking: a bad or missing prop no longer raises ArgumentError or KeyError, so code that rescues either for one gets Hologram.PropError or Hologram.CompileError instead. When the Hologram compiler runs, in a production build or with HOLOGRAM_START=1 in development and test, a template call site that misses a required prop, such as HoloMap.Control.Terrain's source or HoloMap.Image's url, or gives a prop a literal value it does not accept, such as position="middle" on a control, fails the build with Hologram.CompileError. Hologram's renderer raises Hologram.PropError, naming the component and the prop, for what the compiler cannot check: a spread, a dynamic tag, a value computed as the template renders, a component rendered programmatically, and every render in development and test without the compiler.
  • Breaking: HoloMap.API's fly_to/2, ease_to/2 and jump_to/2 take :easing as one of :linear, :ease_in, :ease_out and :ease_in_out, the curves of CSS's timing keywords, or {:cubic_bezier, x1, y1, x2, y2}, and raise ArgumentError for any other value. MapLibre takes the easing as a function, which JSON cannot carry, and the option used to reach it as the string or number it was given, which MapLibre called inside an animation frame. On MapLibre 6.20.0 the move fired movestart, threw an uncaught TypeError in its first frame, and stayed in progress, with no moveend and the camera where it was, until another move interrupted it. The browser runtime now builds the function from the name or the control points. A call that passed anything else as :easing must pass one of these values or leave the option out, which keeps MapLibre's own easing.
  • The Installation guide no longer asks for a Plug.Static and a gzip step for the Hologram bundles. Hologram 0.12 writes them to its own build directory, removes priv/static/hologram, and serves them compressed and cached from its own router, so an application that followed the earlier guide can drop both. An application set up with Hologram 0.11's own installation guide can also remove "hologram" from its endpoint's Plug.Static only: list. Refusing sourcemaps outside development still needs a plug placed before plug Hologram.Router in the endpoint.
  • A change to HoloMap.Map's style, or a HoloMap.API.set_style call, no longer rebuilds the whole style. The runtime asked MapLibre for a new style every time, so the map went blank and the sprite and glyphs were requested again, even when both styles shared them. It now lets MapLibre diff the new style against the map, with a transformStyle that carries the sources and layers the components declared into the new style, so only the basemap changes. The components' layers keep their template order and their before_id, and go back to their props, as before. Images, terrain, sky and the feature state of the components' sources stay as they were; feature state used to be cleared. A source or layer whose id the new style uses is still left to it, with a warning. A new style that fails MapLibre's validation now leaves the map on the style it had, where the map used to go blank. A change MapLibre cannot diff, such as a style that sets centerAltitude, and a change made before the first style has loaded build the new style from scratch, as every change did before, and the runtime declares everything again once it has loaded.
  • A render no longer parses every component's specification again. The browser runtime parsed the data-hm-spec and data-hm-events of every definition on the map whenever any of them changed, so a marker dragged with its position written back on every drag event, as HoloMap.Marker documents, parsed the GeoJSON of every source on the map on every event. It now parses only the attributes that changed, and nothing when only a marker's or a popup's slot changed. A HoloMap.Map event handler whose params hold a whole-number float, such as 1.0, no longer has its listener bound again on every render.

Deprecated

  • HoloMap.Control.Geolocate's show_user_heading never drew a heading arrow: MapLibre GL JS 6 has no showUserHeading option, and it ignored the key. The prop is still accepted but no longer sent to MapLibre, and the browser runtime logs a console warning, once per map, while it is set. A later release removes it.

Fixed

  • HoloMap.Map's antialias had no effect: it reached MapLibre as a top-level option, which MapLibre has not read since 5.0.0 moved it into canvasContextAttributes. It is now sent there, as %{"antialias" => true}, merged with any canvasContextAttributes given through options, whose keys win.
  • A HoloMap.Map limit set back to nil, max_bounds, min_zoom, max_zoom, min_pitch or max_pitch, stayed in force: a prop set to nil leaves its key out of the map's specification, like one never set, and the browser runtime skipped a key that was gone. It now lifts the limit, as MapLibre's setters do when given null, and the camera is as free as on a map built without it. Like setting a limit, lifting one reports no move.
  • HoloMap.Map's render_world_copies and pixel_ratio were read only when the map was built. A change now goes through MapLibre's setRenderWorldCopies and setPixelRatio, and nil returns to MapLibre's defaults, world copies drawn and the device's pixel ratio. A new pixel ratio resizes the canvas, which MapLibre announces as a move, and that move is not reported to on_move_start or on_move_end.
  • HoloMap.Map's interactive, cooperative_gestures and the seven interaction handler props, drag_rotate, drag_pan, scroll_zoom, double_click_zoom, box_zoom, keyboard and touch_zoom_rotate, were read only when the map was built, so a "lock the map" toggle bound to one did nothing. They now turn MapLibre's handlers on and off as they change. MapLibre has no setter for interactive, so the runtime makes the choices its constructor makes: interactive={false} turns off every handler that option covers, touchPitch included, and takes away the grab cursor and the canvas's place in the tab order; turned back on, it turns on each handler whose own prop is not false. It leaves cooperative_gestures alone, as MapLibre does.
  • A change to a HoloMap.Map prop that MapLibre reads only while it builds the map, such as hash, fade_duration, antialias or locale, was dropped without a word, and nothing said which props those are. The props table now marks each prop build only or applies, and a change to a build only prop, or to a key of options that is not the name of an option that applies, logs a console warning naming the MapLibre option, once for each option on each map.
  • A change to HoloMap.Map's max_bounds that left the camera outside the new bounds reached on_move_start, on_move_end and on_zoom_end as if the user had moved the map: since 6.18.0, MapLibre's setMaxBounds fires the events of the move that brings the camera back, with nothing to tell them from a user's. A change to min_zoom, max_zoom, min_pitch or max_pitch that moved the camera did the same, on_pitch_end included. Like a change to center or zoom, these moves are no longer reported, and the next move the user makes reports where the camera ended up.
  • On a browser that cannot create a WebGL2 context, a map failed with an uncaught GPUInitializationError, which MapLibre's constructor has thrown since 6.7.0, and the application never heard why the map was blank. The runtime also went on listing the map as live. The failure now reaches HoloMap.Map's on_error once, with MapLibre's message and no camera keys, since there is no camera to read them from, or the console when there is no on_error. Camera limits MapLibre refuses when it builds the map, such as a min_zoom above max_zoom, are reported the same way. The map is not built again on that container, and the other maps on the page are unaffected. An on_error handler that reads center or another camera key from every payload has to allow for its absence.
  • A HoloMap.API call for a map MapLibre could not build was queued as if the map were about to boot, and dropped five seconds later with a warning that no map had booted. It is now dropped at once, with a console warning that names MapLibre's error, and so are the calls queued for the map before it failed.
  • A map that asked for another worker_url than the first map on the page ran on the first map's worker without a word, since MapLibre keeps one worker URL per page. The browser runtime now warns, once for each other URL, naming the map and both URLs. A map that sets no worker_url asks for the default.
  • A render that changed both ends of a HoloMap.Map zoom or pitch range could leave the map with a range the application did not ask for. The runtime set the minimum first, and MapLibre refuses a minimum above the maximum in force, so min_zoom and max_zoom going from 2 and 4 to 8 and 12, or min_zoom raised past max_zoom while max_zoom was set back to nil, applied the new maximum and kept the old minimum, with the refusal logged to the console. A range that moves up past its old maximum now takes its new maximum first, so any valid pair of limits applies whatever the previous pair was.

0.1.1 - 2026-11-26

Fixed

  • HoloMap.Marker's on_click, on_drag_start, on_drag and on_drag_end stopped firing once a change to the slot content, color, scale or class_name replaced the MapLibre marker. The listeners are now bound to the new marker and taken off the old one.
  • HoloMap.Popup's on_open never fired: MapLibre emits open while the popup is being added, and the listener was attached afterwards. It now fires when the popup first renders and when a changed declaration reopens a popup MapLibre had closed.
  • Most HoloMap.Marker and HoloMap.Popup props were read only when the MapLibre object was built, so changing them from state did nothing. A marker's opacity, pitch_alignment, rotation_alignment, subpixel_positioning, popup_html and popup_options, and a popup's max_width, offset, class_name and subpixel_positioning, now go through MapLibre's setters. Options MapLibre has no setter for replace the object: a marker's anchor and click_tolerance, and a popup's anchor, close_button, close_on_click, close_on_move and focus_after_open. A popup replaced this way reports neither on_close nor on_open, and a marker's popup that was open stays open when its options change.
  • HoloMap.Marker's popup_options reached MapLibre with its keys untouched, so the documented HoloMap.Popup vocabulary (close_button, max_width and the rest) was ignored. Those keys are now converted, with the same boolean coercion HoloMap.Popup applies; string keys still pass through unchanged. An option set to nil is left out whatever its key, as everywhere else.
  • Clicking a HoloMap.Marker that has on_click neither opened its popup_html popup nor closed popups with close_on_click. The runtime stopped the DOM click so the map's on_click would not also fire, but MapLibre makes the map's own click from that same DOM event, and handles marker popups and close_on_click from it. The click is now marked instead of stopped: MapLibre sees it, while the map's and layers' on_click still ignore a click on a marker that reports its own. The DOM click now bubbles past the map like any other click on it. The marker's on_click is dispatched once the click has finished propagating, after the on_close of any popup it closed, so a popup whose on_close clears the selection no longer undoes the selection made by clicking another marker.
  • A source, a layer and a HoloMap.Image that shared an id, as a source and the layer drawing it often do, replaced one another on every render, leaving the map without the source or the layer. The same happened to a layer called terrain or sky next to HoloMap.Terrain or HoloMap.Sky. Definitions are now told apart by kind as well as id, and MapLibre still receives the id unchanged. This also fixes a definition that changed from a source or layer to a marker, popup or control before the style had loaded: its new object lost its events, and removing the definition left it on the map.
  • A layer whose source did not exist yet was handed to MapLibre anyway, which refused it with a "source not found" error, and nothing added it later: a layer written above its source, a layer rendered while its source was not, and the layers of a source that was removed and rendered again all stayed missing. Such a layer now waits for its source and is added, in declared order, as soon as the source is.
  • Layers and controls kept their declared order only on first load. A layer rendered conditionally, re-added because its type, source or source_layer changed, or re-added by a structural source change went on top of every other layer; a changed before_id was ignored; and a before_id naming a layer declared further down, or not rendered yet, was dropped for good. Each layer is now placed where the template puts it, a before_id change moves the layer, and a before_id takes effect once the layer it names is on the map. A control rendered conditionally, or replaced by a prop change, went to the far end of its corner; it now goes back to its declared place, and the controls around it are left as they are.
  • An inline style map was set again on every change to any HoloMap.Map prop, such as zoom, and MapLibre's diff then took every source and layer off the map and back on. It is now compared by value. A style change, from the prop or HoloMap.API.set_style/2, now always builds the new style from scratch instead of diffing it, so it always ends in the re-declaration of the map's sources, layers, images, terrain and sky; work and HoloMap.API calls issued while the new style loads wait for it instead of reaching the old style or failing with "Style is not done loading". When the new style already defines a source of the same id, the layers drawing from it are no longer added to the style's source, where a vector source refused each one with an error; the warning now names them. A style change also no longer warns that the new style defines each of the map's own layers.
  • Terrain stayed bound to its HoloMap.Source.RasterDEM after a change to the source's tiles, url, encoding or other structural keys rebuilt it, and after the source was removed, so it went on drawing from a source that was no longer on the map. It now comes off before the source and goes back on the rebuilt one, whether HoloMap.Terrain or the terrain control turned it on. Removing the source turns terrain off with a warning until the source is rendered again. HoloMap.Terrain declared above its source, or rendered while the source was not, made MapLibre throw "cannot load terrain" and was never applied; it now waits for its source, as layers do.
  • A HoloMap.API call made before its map had booted was dropped with a console warning. Hologram runs the actions scheduled from init in the order of the components' cids, so the documented pattern of moving the camera from a page's init action lost the call whenever the map's cid sorts after "page". Such calls are now queued and run in order once the map's style has loaded; calls for a map that has not booted within five seconds are dropped with a warning.
  • HoloMap.Map's on_error received the camera but not the error. Its payload now also has an error map with the message, plus the HTTP status and url of a failed request and the source_id of a source's error when MapLibre reports them. Only plain values cross into Elixir.
  • HoloMap.Image applied whichever image load finished last: a slow response for an earlier url replaced the image of a later one, and a response for an image removed while it loaded registered it again, with no component left to remove it. A load is now applied only if it is the latest one for an image that is still declared.
  • Booting a map retried every animation frame for as long as its container was missing, for the rest of the page's life if the page moved on first, and built the map with no options, so with no style ever, when the map definition still named another map during a navigation. Boot now waits a frame at a time for both the container and a definition that names the map, and gives up with a warning after 60 frames.
  • A HoloMap.Marker's popup_html popup that the user had opened closed whenever a change to the slot content, color, scale, class_name, anchor or click_tolerance replaced the MapLibre marker, so a marker whose content follows state closed its own popup on every change. It is now opened again on the new marker; a popup the user had not opened stays closed.
  • Removing offset from a HoloMap.Marker drawn as MapLibre's default pin set its offset to [0, 0], which moved the tip of the pin off its coordinate. It now goes back to MapLibre's own offset for the pin, [0, -14]; a marker with slot content still goes back to [0, 0].
  • A class_name with a leading, trailing or repeated space kept a HoloMap.Marker or HoloMap.Popup off the map, and a popup_options one kept the marker's popup from opening: MapLibre splits it on single spaces and the browser refuses the empty class name between two of them. The names now reach MapLibre separated by single spaces.
  • Every change to an open HoloMap.Popup rewrote its content, even a change to lng_lat alone, so a popup following a moving feature lost its scroll position and text selection on every move and, with focus_after_open, took keyboard focus back. The content is now rewritten only when html or the slot content changes what the popup shows.
  • A layer's on_click was dispatched before the on_close of a close_on_click popup that the same click closed, whenever the popup had opened after the layer was added, which is the usual case for a popup showing a selected feature. A popup whose on_close clears the selection therefore undid the selection made by clicking another feature. A layer's on_click is now dispatched once the click has finished, as a marker's is.
  • Changing a HoloMap.Image's url to an image of another size left the old image in place and logged an error, because MapLibre's updateImage accepts only an image of the same size. Such an image is now registered again, with the same options; one of the same size is still updated in place.
  • When a new style already defined a source or layer with a component's id, the runtime left that id to the style with a warning, but went on treating it as its own: removing the component removed the style's source, a data or structural change to it rewrote or replaced the style's source, a prop change to a layer component changed the style's layer, a structural change to a source took the style's layer of a layer component's id off the map and put the component's back, and a before_id moved the style's layer. Until the style changes again, such a component now leaves the style's source or layer alone.
  • Since calls made before a map boots are queued, a HoloMap.API call for a map torn down with HoloMap.Runtime.destroy/1 waited five seconds before it was dropped with a warning. It is now dropped at once, with a warning naming the destroyed map. Calls are queued again once the map boots again, or once a page has moved its container away, so a page that renders the map again still hands it the calls made before its boot.
  • Module docs and guides that contradicted the runtime are corrected, among them how long an imperative change lasts, when a popup's on_open and on_close fire, and the MapLibre GL JS release that introduced the globe control (5.0.0, not 6).
  • HoloMap.Map's on_click was dispatched before the on_close of a close_on_click popup that the same click closed, because the map's listener is added when the map boots, before any popup. A popup whose on_close clears state could therefore undo what the map's on_click had just set. It is now dispatched once the click has finished, as a layer's and a marker's are.
  • A source or layer component whose id the style already used when the component was added, on the first style or rendered later, was skipped without a warning and then treated as the map's own: a change to it rewrote the style's source or layer, and removing it removed them. It now warns once and leaves the style's source or layer alone, as after a style change, and the layers of such a source stay off the map instead of drawing the style's data. A layer component whose id the style uses also kept its event listeners, so its on_click and other events reported the style's layer of that id. Its listeners now come off while the style holds the id, and go back on once a style change leaves it free.

Security

  • Locked dependencies with published advisories were refreshed: Phoenix 1.8.17, Plug 1.20.4 and Plug.Crypto 2.2.1 in the library's lockfile, and the same plus Bandit 1.15.0 and source-map-js in the demo's. No version requirement changed, so applications resolve their own versions as before.

0.1.0 - 2026-08-23

Added

  • HoloMap.Map, the map container. Stateful, keyed by its Hologram cid, which is also the DOM container id and the handle for every HoloMap.API call.
  • Sources: HoloMap.Source.GeoJSON, .Vector, .Raster, .RasterDEM, .Image.
  • Layers: HoloMap.Layer.Fill, .Line, .Circle, .Symbol, .Raster, .Heatmap, .Hillshade, .FillExtrusion, plus a generic HoloMap.Layer for a type decided at runtime.
  • Overlays: HoloMap.Marker and HoloMap.Popup, both accepting slot content.
  • HoloMap.Image, which registers an image so a symbol layer's icon_image, or a fill or line layer's pattern, can name it. Without it, only icons the style's own sprite carries are reachable, and naming anything else fails silently: MapLibre emits styleimagemissing and draws nothing.
  • Controls: HoloMap.Control.Navigation, .Scale, .Geolocate, .Fullscreen, .Attribution, .Globe and .Terrain.
  • 3D: HoloMap.Terrain and HoloMap.Sky.
  • HoloMap.API: fly_to/2, ease_to/2, jump_to/2, fit_bounds/3, resize/1, set_style/2, set_filter/3, set_paint_property/4, set_layout_property/4, set_feature_state/3, remove_feature_state/3.
  • MapLibre events surfaced as Hologram actions, with payloads documented per component and in the Events guide.
  • window.HoloMap.map/1, so MapLibre plugins can reach the raw instance.
  • A Phoenix + Hologram demo application exercising every component across eleven pages, and Playwright suites driving a real MapLibre instance: component behaviour, full source/layer coverage, and navigation.

Notes on the design

  • Components do not call MapLibre. Each renders one hidden element carrying its specification as JSON, and a MutationObserver in the browser reconciles those elements against the live map. This is what supplies the mount, update and unmount hooks Hologram 0.11 does not have. See the Architecture guide.
  • HoloMap.JSON exists because Jason cannot be compiled to JavaScript by Hologram, and specifications have to be encoded during client-side re-renders.
  • HoloMap.Map sets MapLibre's worker URL explicitly. MapLibre resolves its worker against import.meta.url, which points at Hologram's page bundle once bundled; the resulting import failure happens inside a worker and surfaces as a map that renders its background and never draws a tile.
  • Style-scoped work waits for style.load, not load. The latter also waits for a first complete render, which never arrives if a tile request hangs.
  • Definitions are matched to their map by data-hm-map, and disposal is decided by the container's id rather than isConnected, because Hologram morphs the old page's DOM into the new one on navigation rather than replacing it.

Behaviour worth knowing

  • A popup MapLibre closed on its own (the close button, a click on the map, a camera move) left the reconciler believing it was still open. Clicking the same feature again changed no state, re-rendered nothing, and the popup never returned. HoloMap.Popup now reports on_close (and on_open), a changed declaration re-asserts a popup MapLibre had closed, and addPopup removes any existing instance first so no path can stack two on one coordinate.

  • HoloMap.Sky cleared itself with setSky(null), which MapLibre validates and rejects with "sky: object expected, null found". The sky was cleared anyway, but a console error was logged every time the component was removed.

  • The documented shape of layer event payloads was wrong. Hologram converts JavaScript object keys to atoms recursively, so a feature's properties arrive as %{parcel_id: id}, not %{"parcel_id" => id}. Matching with string keys silently fails rather than raising, which is why it survived until every component was exercised in a browser.

Requirements

  • Elixir 1.19+, OTP 28.1+, Hologram 0.11+
  • MapLibre GL JS 6.x, installed and served by the host application