Skip to content

Update maplibre, add release workflow, build for .net 8 - #1

Open
acalcutt wants to merge 64 commits into
tdcosta100:mainfrom
acalcutt:main
Open

Update maplibre, add release workflow, build for .net 8#1
acalcutt wants to merge 64 commits into
tdcosta100:mainfrom
acalcutt:main

Conversation

@acalcutt

@acalcutt acalcutt commented May 1, 2026

Copy link
Copy Markdown

I used Claud AI to update maplibre-native in this and make the changes needed for c++ 20 that is now required. I also add a bump version to PR workflow, and a release workflow that creates a github release with x64 and arm64 dlls

I am testing the current dll in a c# application in https://github.com/acalcutt/VistumblerCS/tree/maplibre-net
image

acalcutt and others added 30 commits April 28, 2026 09:57
- Style.h/cpp: AddGeoJsonSource, SetGeoJsonSourceUrl, SetGeoJsonSourceData,
  HasSource, RemoveSource, AddCircleLayer, HasLayer, RemoveLayer
- Add MaplibreNative.NET.WPF C# class library (MaplibreMapHost, DelegateMapObserver)
  with reflection-based GeoJSON layer helpers (SetWifiGeoJsonLayer,
  SetWifiGeoJsonLayerData, RemoveWifiGeoJsonLayer) and double-click zoom
acalcutt and others added 22 commits May 1, 2026 00:02
- Add Layer base ref class (Id, SourceId, SourceLayer, Visible, MinZoom, MaxZoom, Type)
- Add concrete layer wrappers: FillLayer, LineLayer, CircleLayer, SymbolLayer,
  RasterLayer, BackgroundLayer, HeatmapLayer, HillshadeLayer, FillExtrusionLayer,
  ColorReliefLayer (PR #3965)
- Add Source base ref class (Id, Type, Attribution, IsVolatile)
- Add concrete source wrappers: GeoJSONSource, VectorSource, RasterSource,
  RasterDEMSource, ImageSource
- Add Style::AddXxxLayer / AddXxxSource factory methods returning typed wrappers
- Add Style::GetLayer, GetLayers, GetSource, GetSources for retrieval
- Update CMakeLists.txt with new cpp files
- Update Console example to demo programmatic style API
- Update README with Programmatic style API section
- New Light ref class with Anchor (Map/Viewport), Color (CSS), Intensity,
  and Position (spherical radial/azimuthal/polar) properties
- New LightAnchor enum and LightPosition value struct
- New StyleImage ref class for sprite image metadata
- New TransitionOptions ref class with DurationMilliseconds, DelayMilliseconds,
  EnablePlacementTransitions
- Style::GetLight() returns non-owning Light wrapper
- Style::GetTransitionOptions() / SetTransitionOptions()
- Style::GetDefaultCamera() returns CameraOptions
- Style::AddImage(id, pixels, pixelRatio[, sdf]) adds sprite image
- Style::GetImage(id) returns StyleImage metadata or null
- Style::HasImage(id) checks existence
- Style::RemoveImage(id) removes sprite
- Light.cpp added to CMakeLists.txt
…cle properties, Layer filter, AddLayer beforeLayerId
- LineLayer: MiterLimit, RoundLimit
- SymbolLayer paint: IconTextFit, IconTextFitPadding (array<float,4>),
  IconTranslate, IconTranslateAnchor, TextTranslate, TextTranslateAnchor
- RasterLayer: Resampling (RasterResamplingType)
- BackgroundLayer: Pattern (sprite image)
- HillshadeLayer: IlluminationAnchor (HillshadeIlluminationAnchorType)
- FillExtrusionLayer: Pattern, Translate, TranslateAnchor
- ColorReliefLayer: ColorRamp (JSON expression string via ColorRampPropertyValue)
- Enums.h: RasterResamplingType, HillshadeIlluminationAnchorType
- Layers.cpp: rapidjson + ValueToJsonString helpers for ColorRamp serialization
…fetch/overscale

- LocationIndicatorLayer (new): BearingImage, ShadowImage, TopImage (layout);
  AccuracyRadius, AccuracyRadiusBorderColor, AccuracyRadiusColor, Bearing,
  BearingImageSize, ImageTiltDisplacement, Location (lat/lng/alt double[3]),
  PerspectiveCompensation, ShadowImageSize, TopImageSize (paint)
- GeoJSONOptions managed ref class: MinZoom, MaxZoom, TileSize, Buffer,
  Tolerance, LineMetrics, Cluster, ClusterRadius, ClusterMaxZoom
- Style::AddGeoJsonSource / AddGeoJsonSourceFromUrl overloads with GeoJSONOptions
- Source::PrefetchZoomDelta / MaxOverscaleFactorForParentTiles (get/set, -1 = clear)
…e.SetImage

- LineLayer.Gradient (ColorRampPropertyValue JSON string): maps line progress
  (0-1) to a color; requires lineMetrics=true on the GeoJSON source
- HeatmapLayer.Color (ColorRampPropertyValue JSON string): maps heatmap density
  (0-1) to a color (replaces the default rainbow ramp)
- ImageSource.SetImage(PremultipliedImage^): update pixel data at runtime for
  animated image overlays
- .editorconfig: 4-space indent, CRLF, UTF-8 for *.cpp and *.h;
  dependencies/** explicitly excluded
- format.ps1: runnable script that converts leading tabs->4-spaces and
  strips trailing whitespace in src/ and include/ only;
  usage: powershell -ExecutionPolicy Bypass -File format.ps1 [-DryRun]
- Applied to 40 files: tabs->spaces (Projection.cpp/h and others),
  trailing whitespace cleanup throughout
Build fixes:
- StyleImage.h, TransitionOptions.h: move property init from ctor init
  list to body (C3137: auto-properties cannot be initialized in init list)
- Style.cpp WrapLayer: replace Layer::as<T>() with dynamic_cast<T*>()
  (Layer does not have an as<T>() method in this version of maplibre-native)
- Style.cpp AddVector/Raster/RasterDEMSource: qualify variant<> as
  mbgl::variant<> (bare 'variant' not in scope outside mbgl namespace)
- Layer.cpp, Layers.cpp, Source.cpp, Sources.cpp: remove #include 'pch.h'
  (pch.h does not exist; causes C1083 on clean builds)

Documentation:
- Add docs/ with DocFX config (docfx.json, index.md, toc.yml)
- Add .github/workflows/docs.yml: builds and deploys to GitHub Pages on
  push to main
- Add XML doc comments to previously undocumented public headers:
  Size.h, Value.h, Vector.h (Vec3/Vec4/Mat4/MatrixExtensions), GeoJSON.h
- Update .gitignore to exclude docs/_site/, docs/api/, docs/obj/
…al_as

- NativePointerHolder.h: fix delegating ctor (NativePointer -> NativePointerHolder)
- Layer.cpp: mbgl::style::conversion::JSDocument -> mbgl::JSDocument;
  replace marshal_as error throw with gcnew System::String(msg.c_str())
- Layers.cpp: same JSDocument fix in LineLayer::Gradient, HeatmapLayer::Color,
  ColorReliefLayer::ColorRamp setters; replace marshal_as error throws
- Layers.cpp: fix LocationIndicatorLayer image setters - split ternary into
  named local variable before marshal_as call
- Layers.cpp: fix AccuracyRadius*Color getters - remove undefined ColorToString
  wrapper, pass string literal default to GetColor instead of mbgl::Color
…ypes

- Layer.cpp + Layers.cpp: pass const JSValue& reference to Convertible instead
  of JSDocument* — ConversionTraits is specialized for const JSValue*, not
  JSDocument* (even though JSDocument inherits JSValue)
- Layers.cpp: add #include <type_traits> and GetColorAgnostic<> template helper
  for version-agnostic color extraction from PropertyValue<Color> or
  PropertyValue<vector<Color>>
- Layers.cpp SymbolLayer::IconPadding: use generic lambda + if constexpr to
  handle both PropertyValue<float> (older) and PropertyValue<mbgl::Padding>
  (newer) maplibre-native builds
- Layers.cpp HillshadeLayer::IlluminationDirection: generic lambda handles both
  PropertyValue<float> and PropertyValue<vector<float>>
- Layers.cpp HillshadeLayer::ShadowColor/HighlightColor: use GetColorAgnostic
  for getter; generic lambda for setter handles both Color and vector<Color>
C++/CLI error C3923 fires when a generic lambda (which creates a local
template struct) appears inside a managed class member function. The fix
is to lift each lambda into a free template function in the anonymous
namespace and call that from the managed member function.

Affected properties:
- SymbolLayer::IconPadding (get + set)
- HillshadeLayer::IlluminationDirection (get + set)
- HillshadeLayer::ShadowColor (set)
- HillshadeLayer::HighlightColor (set)
…ollow/bearing)

DelegateMapObserver:
- Add optional onStyleLoaded callback parameter so MaplibreMapHost can
  react to style loads/reloads without subclassing MapObserver.

MaplibreMapHost:
- FollowLocation (bool): re-centres map on GPS fix; first fix -> CenterOn
  (zoom 14), subsequent fixes -> PanTo (zoom-preserving).
- ShowBearing (bool): when false, forces bearing=0 so indicator points north.
- PanTo(lat,lon): zoom-preserving JumpTo helper.
- UpdateLocationIndicator(lat,lon,bearing,accuracyMeters): creates and
  updates a LocationIndicatorLayer (blue accuracy circle) via reflection.
- ClearLocationIndicator(): removes the layer.
- OnMapStyleLoaded(): replays pending position after style reload.
* Release v2.0.0

* Update CHANGELOG.md for version 2.0.0

Expanded the changelog to include new features, improvements, and bug fixes for version 2.0.0.

* workflow update

* Update README.md

* Update CHANGELOG.md

* Update workflows for .net 6

* Update windows-ci.yml

* remove master branch from workflows

---------

Co-authored-by: acalcutt <3792408+acalcutt@users.noreply.github.com>
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
@memsom

memsom commented May 2, 2026

Copy link
Copy Markdown

I used Claud AI to update maplibre-native in this and make the changes needed for c++ 20 that is now required. I also add a bump version to PR workflow, and a release workflow that creates a github release with x64 and arm64 dlls

This so very interesting. Have you considered adding Android support also?

@acalcutt

acalcutt commented May 2, 2026

Copy link
Copy Markdown
Author

How would that differ from the existing maplibre-native android support that already exists? what would be needed for that?

@acalcutt

acalcutt commented May 2, 2026

Copy link
Copy Markdown
Author

That would be similar to this request right? maplibre/maplibre-native#3146

@memsom

memsom commented May 3, 2026

Copy link
Copy Markdown

That would be similar to this request right? maplibre/maplibre-native#3146

Yeah. It would be about using MapLibre native in MAUI. There isn't a solution for that yet.

@acalcutt

acalcutt commented May 4, 2026

Copy link
Copy Markdown
Author

@memsom I spent some time with AI to see what we could make for a .net MAUI the last few days and what it made so far is in https://github.com/acalcutt/maplibre-maui . it is untested right now, but it is compiling at has a release that should work on windows, android, macos, and ios. Now it needs some testing, so if you try it and see any issues let me know.

I started with https://github.com/bjtrounson/maplibre-maui , but i took the design decision to try and make a unified C abi based off the code here instead of wrapping the existing platforms.

acalcutt and others added 3 commits May 7, 2026 22:10
Co-authored-by: acalcutt <3792408+acalcutt@users.noreply.github.com>
Removed empty sections for bug fixes in CHANGELOG.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants