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 theregisterfunctions.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'stransform_requestandmissing_image_resolvername functions registered withregister.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 aHoloMap.Imagedeclares is left to the component. What the resolver throws or rejects with is reported throughon_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 onceon_errorlistens.- 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 withregister.layer(name, factory)from the component'soptionsand%{map, cid, id}. It stacks in template order with the other layers, andbefore_idplaces 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. EachonAddis followed by oneonRemove: the runtime calls the ones MapLibre does not, for a style built from scratch and when the map is torn down. Anoptionschange calls the object'supdate(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,updateoronRemovethrows is reported throughon_error, and so is the first error each ofrender,prerenderandrenderToTerrainTilethrows.HoloMap.Control.Custom, a control built by a factory registered withregister.control(name, factory), from the component'soptionsand%{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. Anoptionschange calls the control'supdate(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,updateoronRemovethrows is reported throughon_error, and the control's element leaves the page with its component even ifonRemoveleaves it there.HoloMap.Map'srequest_rules: a list of rules, each aurl_prefixwithheadersorcredentialsto 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 beforetransform_request, whose function receives the request they made asrequestin 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 raisesArgumentError, with a message that names the key and not its value. The rules are rendered into the page, so the Installation guide andHoloMap.Mapsay which credentials belong there.- A console warning for a source component whose
url,tilesordatanames a scheme with no protocol registered for it, such as apmtiles://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.HoloMapdoes not import thepmtilespackage, 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 noprotocolsprop onHoloMap.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/2andjump_to/2take:roll,:elevation,:around,:min_zoomand:freeze_elevation, andfit_bounds/3takes:absolute_padding,:roll,:easing,:speed,:curve,:screen_speed,:max_duration,:min_zoomand:freeze_elevation, under MapLibre's names.:aroundis a coordinate in any shapeHoloMap.Spec.lng_lat/1accepts, and:offsetan{x, y}tuple, each sent as the list MapLibre takes.fly_to/2documents which of the three moves reads each option: MapLibre'sflyToandeaseToignore:elevation, which onlyjump_to/2sets, and onlyease_to/2reads:around.HoloMap.API.camera_for_bounds/3takes:absolute_padding, and its answer then carries the padding it fitted the box with.HoloMap.APIwraps 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/2andset_center_clamped_to_ground/2. Each takes coordinates and pixel positions as tuples, and raisesArgumentErrorfor 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/4documents the answers ofgetRoll,getPadding,getCenterElevation,getVerticalFieldOfViewandgetCenterClampedToGround.HoloMap.Map'srollandelevation, camera props ascenter,zoom,bearingandpitchare: 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 tonil, they leave the camera as it is.HoloMap.Map's handler props take a map of the handler's settings as well astrueandfalse:drag_rotatetakesaround,"pointer"to turn the map about the point under the pointer, andmovement;drag_panits glide,linearity,decelerationandmax_speed;scroll_zoomaround,zoom_rateandwheel_zoom_rate;touch_zoom_rotaterotation,around,zoom_rateandzoom_threshold;keyboardrotation; and the newtouch_pitchproparound.rotation: falsekeeps 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 raisesArgumentError.- Typed
HoloMap.Mapprops for MapLibre's other constructor options, rather thanoptionsin camelCase:boundswithfit_bounds_options, which take the options ofHoloMap.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_collisionsandrefresh_expired_tiles, which MapLibre reads only as it builds the map and which warn once when they change, andzoom_snap,anisotropic_filter_pitch,center_clamped_to_groundandcancel_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/2and fits a box beside it withabsolute_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'sincremental: adatachange reaches MapLibre'supdateDataas the features that changed, compared by id with the ones the source holds, rather than the whole collection throughsetData, so MapLibre loads again only the tiles the changes touch. Each feature needs a unique id, its ownidor the propertypromote_idnames; data with a feature that has none or shares one, and a source withgenerate_id, is set whole withsetData, with one console warning for the source. Data that is not aFeatureCollectiongiven 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'supdateDataa diff,:add,:update,:removeand:remove_all, for an application that already knows which features changed, without changing the source'sdataprop. The source keeps the change through a render that leavesdataas it was, a style change, a style built from scratch, a source rebuilt for another prop and a lost WebGL context. The next change todatawins, and the source then holds exactly the newdata: anincrementalsource 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'sdatareplaces 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 raisesArgumentError.HoloMap.Popup'strack_pointer, which makes the popup follow the pointer over the map with MapLibre'strackPointer(), in place oflng_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. Alsopadding, the pixels MapLibre keeps between the popup and the map's edges as it picks the side the popup opens on, set in place withsetPadding, andlocation_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'spopup_optionstake both. Apaddingthat is not a map of:top,:bottom,:leftand:rightto numbers raisesArgumentError, and so does aHoloMap.Popupwith neitherlng_latnortrack_pointer.HoloMap.Marker'sopacity_when_covered, the marker's opacity while terrain or the globe covers it, set in place with MapLibre'ssetOpacitywithopacity, each back to MapLibre's default once taken out, andpopup_open, which opens and closes the marker's popup from state withtogglePopupwhen the marker is built with it and when it changes. An open it asks for takes keyboard focus asfocus_after_opensays; a marker or popup built again keeps its popup as it was, without moving focus, unlesspopup_openchanges in the same render. The user's clicks still toggle the popup in between.HoloMap.Control.Logo, MapLibre's logo as a control, withcompact, in MapLibre's bottom-left corner unlesspositionsays otherwise, andHoloMap.Map'smaplibre_logoandlogo_position, which have MapLibre add the logo as it builds the map, and are build only. Alogo_positionthat is not a corner raisesArgumentError.HoloMap.Control.Navigation'svisualize_roll, andHoloMap.Control.Fullscreen'spseudoandcontainer, 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_inspectorandshow_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_boxeswaits 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 toworker_url:worker_count,max_parallel_image_requests,trusted_types_policyandprewarm, which the browser runtime hands MapLibre'ssetWorkerCount,setMaxParallelImageRequests,setTrustedTypesPolicyandprewarmbefore 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_policynames the Trusted Types policy the browser runtime creates for MapLibre, which lets it start workers only from the page's own origin, or from ablob: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'strusted-typesdirective 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, raisesArgumentError. The Installation guide's new Trusted Types section shows a page that enforces them, with thedefaultpolicy 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, andHoloMap.API.export_image/2, which answers a:replyaction with the view as adata: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 therenderevent that ends it, so nopreserveDrawingBufferis needed.export_image/2measures 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 raisesArgumentError.- 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/2andfit_bounds/3raiseArgumentErrorfor an option they do not know, as the otherHoloMap.APIfunctions do, rather than leaving it out: a misspelt option used to do nothing, silently. An:offsetthat is not an{x, y}pair of numbers raises as well.fit_bounds/3refuses:centerand:zoom, which the fit decides.The browser runtime puts
window.HoloMap.map,cidsanddestroyonwindowas soon as it loads, rather than once the first map boots. A page that registers JavaScript makeswindow.HoloMapbefore the runtime loads, holdingregistryalone, so code that waits for a map should askwindow.HoloMap?.map?.(cid)rather thanwindow.HoloMap && window.HoloMap.map(cid).
Fixed
A handler's settings given through
HoloMap.Map'soptions, 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
stylechange, orHoloMap.API.set_style/3, whose URL answered 404, could not be reached or was not JSON left the definitions rendered meanwhile,HoloMap.APIcalls 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:errornaming MapLibre's; the definitions and the other calls wait for that style, and aset_style/3call asks for it at once. The failure reacheson_error, or the browser console. The browser runtime listens for MapLibre'serrorevent only while a style loads, and logs what nothing else hears, as MapLibre does. Thestyleprop keeps the value the page rendered; "Changing the style" inHoloMap.Mapsays how to ask for a failed style again.A
HoloMap.Markerbuilt again while the user had its popup open, by a change to its slot content,color,scale,class_name,anchor,click_toleranceorpopup_options, opened the new popup withfocus_after_openon, 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 leavesfocus_after_openas the application set it, so a popup the user opens still takes focus.An open
HoloMap.Popupreplaced by one built with new options, by a change toanchor,close_button,close_on_click,close_on_moveorfocus_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#_diffStylein 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.APIcan 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 thatHoloMap.Runtime.destroy/1tore 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/3still discards what the method returns. HoloMap.API.query_rendered_features/2andquery_source_features/3find features and send them to the reply action. An answer carries at most 100 features, or the number given with:limit, says withtruncated: truewhen it left some out, and leaves geometry out withgeometry: false.HoloMap.API.project/3,unproject/3,query_terrain_elevation/3,camera_for_bounds/3andget_feature_state/3, andHoloMap.API.request/4, which asks any method of the map, or with:sourceof one of its sources, by name, such asgetCenter,getStyleorareTilesLoaded. Its documentation lists what each getter answers. Each checks its options and raisesArgumentErrorfor 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'sgetClusterExpansionZoomgives it, all in the browser, with no action. A click on a feature that is not a cluster does nothing more. The layer'son_clickstill hears the click and is dispatched first. The move useseaseTo'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/4makes the same move from an action, with the options ofease_to/2other than:zoom, such as:centerand:duration.get_cluster_leaves/4reads the points a cluster holds andget_cluster_children/4what 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 itssource.get_cluster_leaves/4pages through the points::limit, 100 unless given, is the most the answer holds, and is MapLibre's ownlimit,:offsethow many it skips, andtruncated: truesays the cluster holds more after them.request/4gives the two source methods the same bounded answer, and answers them with an:errorfor a source that is not clustered. The Imperative API guide's new section, Clusters, shows both.HoloMap.Maptakesglobal_state, a map of the values a style'sglobal-stateexpressions 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 withsetGlobalStateProperty, and MapLibre restyles the layers that read it without their paint, layout or filter being sent again. A name taken out, or set tonil, 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.Maptakesprojection:"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, withsetProjectionand no style reload, and a style change keeps it, whether MapLibre diffs the new style or builds it from scratch. Set back tonil, the style's own projection returns.HoloMap.Control.Globeswitches 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_transitiononHoloMap.Mapreports each projection MapLibre puts in place, including the first, a change to the prop and a click onHoloMap.Control.Globe, with the camera andprojection, 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.Geolocatereports its events:on_geolocatewith the browser's position, ascoords(longitude,latitude,accuracy,altitude,altitude_accuracy,heading,speed) andtimestamp,on_errorwith the error'scodeandmessage,on_out_of_max_boundswith the position outside the map'smax_bounds, andon_track_start,on_track_end,on_user_location_focusandon_user_location_lost_focuswith no payload.HoloMap.Control.Fullscreenreportson_enterandon_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.Geolocatetakeszoom_to_user_accuracy:falsekeeps the zoom when the camera moves to the user.HoloMap.API.trigger_geolocate/1asks 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.0dispatches every event. A handler with both, or with a value that is not a non-negative integer, raisesArgumentError. The Events guide's new section, Throttling and debouncing, has the details. HoloMap.Mapreports 39 more MapLibre events. Loading:on_data,on_data_loading,on_data_abort,on_source_data,on_source_data_loading,on_source_data_abortandon_style_data, withdata_type, and for a sourcesource_id,is_source_loadedandsource_data_type, so an application can show a loading state per source. Robustness:on_style_image_missingwith the image'sid,on_webgl_context_lost,on_webgl_context_restored,on_resize,on_cooperative_gesture_preventedwithgesture_type, andon_terrainwith theterrainput in place ornil. 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, andon_touch_start,on_touch_move,on_touch_endandon_touch_cancelwithlng_latandpoint. Every frame:on_move,on_zoom,on_rotate,on_pitch,on_roll,on_dragandon_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_outandon_touch_cancel. HoloMap.Spriteadds an icon sprite next to the style's own, with MapLibre'saddSprite, 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 newurlreplaces the sprite, and the component's removal takes it off. A sprite whoseidthe 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.Maptakesglyphs, a glyph server URL, andfont_faces, font files by the font name a layer'stext_fontnames, 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, withsetGlyphsandsetFontFaces, and holds through every style change and a WebGL context loss. Set tonil, the style's own return.HoloMap.Map's new section, Glyphs and font faces, has the details.HoloMap.Lightsets the light that shades fill-extrusion layers, withanchor,color,intensityandposition, over the style's own light with MapLibre'ssetLight, 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 nosource,source_layer,filteror event props, andHoloMap.Layer.ColorRelief, elevation drawn as colour from aHoloMap.Source.RasterDEM, MapLibre GL JS 5.6.0 and later.HoloMap.Source.Vectortakesencoding,"mvt"or"mlt"for MapLibre Tiles, andsparse, 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
tilesorurl, or to a GeoJSON source'scluster,cluster_radiusorcluster_max_zoom, now applies in place, with MapLibre'ssetTiles,setUrlandsetClusterOptions, 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 whatHoloMap.APIset on them, the terrain stays on its source, and MapLibre requests the tiles again or builds the clusters again. A change todatawith the cluster options goes throughsetClusterOptions, thensetData. Takingtiles,url,cluster_radiusorcluster_max_zoomaway, 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
collectResourceTimingthroughHoloMap.Map'soptions, a change to a GeoJSON source'sdatarebuilt the source and its layers instead of going throughsetData: MapLibre writes the flag into the source specaddSourceis 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_stateandprojectionhold, where MapLibre would hand the style the global state the map was built with. Changes,HoloMap.APIcalls, an image that arrives and astylechange 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
FunctionClauseErrorthere: 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 withon_source_datahit it every time. - An atom named after a browser global among the arguments of a
HoloMap.APIcall orHoloMap.Runtime.call/3reached MapLibre as that global: Hologram's interop reads an atom such as:top,:nameor:statusaswindow.top,window.nameorwindow.status, soset_feature_state(cid, feature, %{mode: :top})setmodeto theWindowobject.call/3now sends the method and its arguments as one JSON string, encoded withHoloMap.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, andnilasnull. - Breaking: as a result,
HoloMap.Runtime.call/3no longer accepts a term JSON cannot carry. A struct (aHologram.JS.NativeValueamong them), a function or a pid among the arguments now raisesArgumentErrorbefore 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/3takesdiff: 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/2lets MapLibre diff the new style, as thestyleprop does. An unknown option, or a:diffthat is not a boolean, raisesArgumentError.HoloMap.PopuptakestextandHoloMap.Markertakespopup_text: a popup's content as plain text, which MapLibre'ssetTextputs 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.textwins overhtmland slot content, andpopup_textoverpopup_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'ssetHTMLas the markup Hologram rendered, in which a value Hologram rendered as text stays escaped.
Changed
- Breaking:
HoloMapis now written against MapLibre GL JS 6.19.0, and the Installation guide installsmaplibre-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/0returns"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 withnpm 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 copiesmaplibre-gl-shared.mjseither: 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 servesmaplibre-gl-shared.mjsnext to the worker. - Breaking:
HoloMap.Map's defaultworker_urlnow carries the version of the MapLibre the page loaded as avquery parameter,/assets/maplibre-gl-worker.mjs?v=6.19.0on 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'sgetVersion().Plug.Staticignores 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. Aworker_urlthe application sets is used as it is, with nothing added. - The
HoloMap.Mapand Installation guide text on a worker that fails to load now matches MapLibre 6.11.0 and later, which reports it through the map'serrorevent.on_errorreceives it with the message "Worker failed to load. Check that the worker URL is correct.", and a map withouton_errorleaves MapLibre to log it to the console. The earlier text said nothing reports it. - Breaking:
HoloMapnow 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'shtmlandHoloMap.Marker'spopup_htmlare 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 ashtml="<b>hi</b>"arrives with its character references decoded, and a literal with an inserted value such ashtml="<b>{@name}</b>"arrives as the text and the value joined, unescaped. A value passed as an expression, such ashtml={@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
ArgumentErrororKeyError, so code that rescues either for one getsHologram.PropErrororHologram.CompileErrorinstead. When the Hologram compiler runs, in a production build or withHOLOGRAM_START=1in development and test, a template call site that misses a required prop, such asHoloMap.Control.Terrain'ssourceorHoloMap.Image'surl, or gives a prop a literal value it does not accept, such asposition="middle"on a control, fails the build withHologram.CompileError. Hologram's renderer raisesHologram.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'sfly_to/2,ease_to/2andjump_to/2take:easingas one of:linear,:ease_in,:ease_outand:ease_in_out, the curves of CSS's timing keywords, or{:cubic_bezier, x1, y1, x2, y2}, and raiseArgumentErrorfor 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 firedmovestart, threw an uncaughtTypeErrorin its first frame, and stayed in progress, with nomoveendand 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:easingmust 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.Staticand a gzip step for the Hologram bundles. Hologram 0.12 writes them to its own build directory, removespriv/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'sPlug.Staticonly:list. Refusing sourcemaps outside development still needs a plug placed beforeplug Hologram.Routerin the endpoint. - A change to
HoloMap.Map'sstyle, or aHoloMap.API.set_stylecall, 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 atransformStylethat 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 theirbefore_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 whoseidthe 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 setscenterAltitude, 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-specanddata-hm-eventsof every definition on the map whenever any of them changed, so a marker dragged with its position written back on everydragevent, asHoloMap.Markerdocuments, 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. AHoloMap.Mapevent handler whoseparamshold a whole-number float, such as1.0, no longer has its listener bound again on every render.
Deprecated
HoloMap.Control.Geolocate'sshow_user_headingnever drew a heading arrow: MapLibre GL JS 6 has noshowUserHeadingoption, 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'santialiashad no effect: it reached MapLibre as a top-level option, which MapLibre has not read since 5.0.0 moved it intocanvasContextAttributes. It is now sent there, as%{"antialias" => true}, merged with anycanvasContextAttributesgiven throughoptions, whose keys win.- A
HoloMap.Maplimit set back tonil,max_bounds,min_zoom,max_zoom,min_pitchormax_pitch, stayed in force: a prop set tonilleaves 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 givennull, and the camera is as free as on a map built without it. Like setting a limit, lifting one reports no move. HoloMap.Map'srender_world_copiesandpixel_ratiowere read only when the map was built. A change now goes through MapLibre'ssetRenderWorldCopiesandsetPixelRatio, andnilreturns 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 toon_move_startoron_move_end.HoloMap.Map'sinteractive,cooperative_gesturesand the seven interaction handler props,drag_rotate,drag_pan,scroll_zoom,double_click_zoom,box_zoom,keyboardandtouch_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 forinteractive, so the runtime makes the choices its constructor makes:interactive={false}turns off every handler that option covers,touchPitchincluded, 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 notfalse. It leavescooperative_gesturesalone, as MapLibre does.- A change to a
HoloMap.Mapprop that MapLibre reads only while it builds the map, such ashash,fade_duration,antialiasorlocale, 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 ofoptionsthat 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'smax_boundsthat left the camera outside the new bounds reachedon_move_start,on_move_endandon_zoom_endas if the user had moved the map: since 6.18.0, MapLibre'ssetMaxBoundsfires the events of the move that brings the camera back, with nothing to tell them from a user's. A change tomin_zoom,max_zoom,min_pitchormax_pitchthat moved the camera did the same,on_pitch_endincluded. Like a change tocenterorzoom, 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 reachesHoloMap.Map'son_erroronce, with MapLibre's message and no camera keys, since there is no camera to read them from, or the console when there is noon_error. Camera limits MapLibre refuses when it builds the map, such as amin_zoomabovemax_zoom, are reported the same way. The map is not built again on that container, and the other maps on the page are unaffected. Anon_errorhandler that readscenteror another camera key from every payload has to allow for its absence. - A
HoloMap.APIcall 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_urlthan 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 noworker_urlasks for the default. - A render that changed both ends of a
HoloMap.Mapzoom 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, somin_zoomandmax_zoomgoing from 2 and 4 to 8 and 12, ormin_zoomraised pastmax_zoomwhilemax_zoomwas set back tonil, 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'son_click,on_drag_start,on_dragandon_drag_endstopped firing once a change to the slot content,color,scaleorclass_namereplaced the MapLibre marker. The listeners are now bound to the new marker and taken off the old one.HoloMap.Popup'son_opennever fired: MapLibre emitsopenwhile 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.MarkerandHoloMap.Popupprops were read only when the MapLibre object was built, so changing them from state did nothing. A marker'sopacity,pitch_alignment,rotation_alignment,subpixel_positioning,popup_htmlandpopup_options, and a popup'smax_width,offset,class_nameandsubpixel_positioning, now go through MapLibre's setters. Options MapLibre has no setter for replace the object: a marker'sanchorandclick_tolerance, and a popup'sanchor,close_button,close_on_click,close_on_moveandfocus_after_open. A popup replaced this way reports neitheron_closenoron_open, and a marker's popup that was open stays open when its options change. HoloMap.Marker'spopup_optionsreached MapLibre with its keys untouched, so the documentedHoloMap.Popupvocabulary (close_button,max_widthand the rest) was ignored. Those keys are now converted, with the same boolean coercionHoloMap.Popupapplies; string keys still pass through unchanged. An option set tonilis left out whatever its key, as everywhere else.- Clicking a
HoloMap.Markerthat hason_clickneither opened itspopup_htmlpopup nor closed popups withclose_on_click. The runtime stopped the DOM click so the map'son_clickwould not also fire, but MapLibre makes the map's own click from that same DOM event, and handles marker popups andclose_on_clickfrom it. The click is now marked instead of stopped: MapLibre sees it, while the map's and layers'on_clickstill 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'son_clickis dispatched once the click has finished propagating, after theon_closeof any popup it closed, so a popup whoseon_closeclears the selection no longer undoes the selection made by clicking another marker. - A source, a layer and a
HoloMap.Imagethat shared anid, 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 calledterrainorskynext toHoloMap.TerrainorHoloMap.Sky. Definitions are now told apart by kind as well asid, and MapLibre still receives theidunchanged. 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,sourceorsource_layerchanged, or re-added by a structural source change went on top of every other layer; a changedbefore_idwas ignored; and abefore_idnaming a layer declared further down, or not rendered yet, was dropped for good. Each layer is now placed where the template puts it, abefore_idchange moves the layer, and abefore_idtakes 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
stylemap was set again on every change to anyHoloMap.Mapprop, such aszoom, 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 orHoloMap.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 andHoloMap.APIcalls 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 sameid, 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.RasterDEMafter a change to the source'stiles,url,encodingor 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, whetherHoloMap.Terrainor the terrain control turned it on. Removing the source turns terrain off with a warning until the source is rendered again.HoloMap.Terraindeclared 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.APIcall made before its map had booted was dropped with a console warning. Hologram runs the actions scheduled frominitin the order of the components' cids, so the documented pattern of moving the camera from a page'sinitaction 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'son_errorreceived the camera but not the error. Its payload now also has anerrormap with themessage, plus the HTTPstatusandurlof a failed request and thesource_idof a source's error when MapLibre reports them. Only plain values cross into Elixir.HoloMap.Imageapplied whichever image load finished last: a slow response for an earlierurlreplaced 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'spopup_htmlpopup that the user had opened closed whenever a change to the slot content,color,scale,class_name,anchororclick_tolerancereplaced 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
offsetfrom aHoloMap.Markerdrawn 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_namewith a leading, trailing or repeated space kept aHoloMap.MarkerorHoloMap.Popupoff the map, and apopup_optionsone 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.Popuprewrote its content, even a change tolng_latalone, so a popup following a moving feature lost its scroll position and text selection on every move and, withfocus_after_open, took keyboard focus back. The content is now rewritten only whenhtmlor the slot content changes what the popup shows. - A layer's
on_clickwas dispatched before theon_closeof aclose_on_clickpopup 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 whoseon_closeclears the selection therefore undid the selection made by clicking another feature. A layer'son_clickis now dispatched once the click has finished, as a marker's is. - Changing a
HoloMap.Image'surlto an image of another size left the old image in place and logged an error, because MapLibre'supdateImageaccepts 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'sidoff the map and put the component's back, and abefore_idmoved 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.APIcall for a map torn down withHoloMap.Runtime.destroy/1waited 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_openandon_closefire, and the MapLibre GL JS release that introduced the globe control (5.0.0, not 6). HoloMap.Map'son_clickwas dispatched before theon_closeof aclose_on_clickpopup that the same click closed, because the map's listener is added when the map boots, before any popup. A popup whoseon_closeclears state could therefore undo what the map'son_clickhad 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
idthe 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 whoseidthe style uses also kept its event listeners, so itson_clickand other events reported the style's layer of thatid. Its listeners now come off while the style holds theid, 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-jsin 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 Hologramcid, which is also the DOM container id and the handle for everyHoloMap.APIcall.- Sources:
HoloMap.Source.GeoJSON,.Vector,.Raster,.RasterDEM,.Image. - Layers:
HoloMap.Layer.Fill,.Line,.Circle,.Symbol,.Raster,.Heatmap,.Hillshade,.FillExtrusion, plus a genericHoloMap.Layerfor a type decided at runtime. - Overlays:
HoloMap.MarkerandHoloMap.Popup, both accepting slot content. HoloMap.Image, which registers an image so a symbol layer'sicon_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 emitsstyleimagemissingand draws nothing.- Controls:
HoloMap.Control.Navigation,.Scale,.Geolocate,.Fullscreen,.Attribution,.Globeand.Terrain. - 3D:
HoloMap.TerrainandHoloMap.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
MutationObserverin 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.JSONexists becauseJasoncannot be compiled to JavaScript by Hologram, and specifications have to be encoded during client-side re-renders.HoloMap.Mapsets MapLibre's worker URL explicitly. MapLibre resolves its worker againstimport.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, notload. 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 thanisConnected, 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.Popupnow reportson_close(andon_open), a changed declaration re-asserts a popup MapLibre had closed, andaddPopupremoves any existing instance first so no path can stack two on one coordinate.HoloMap.Skycleared itself withsetSky(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