Hi James,
You’re right that GeoImage is raster-only — and as you’ve likely noticed, that path renders on the server side: the SDK draws your features into raster map tiles and sends the tiles to the browser.
It helps to separate two independent choices — where the icon is drawn and the icon format — which gives four combinations:
Server-side (PointStyle + GeoImage on a LayerOverlay):
- PNG —
this is what you do today.
- SVG —
no built-in SVG input; you’d rasterize the SVG once yourself (e.g. with Svg.Skia).
Client-side (MarkerOverlay + PointMarkerStyle, rendered in the browser):
- PNG —
built-in.
- SVG —
built-in; just point VirtualPath at an .svg and OpenLayers renders it as vector.
Recommendation: if your icons are a manageable number of point markers you want to interact with (click / hover / popup) — the typical “custom map icons” case — use the client-side MarkerOverlay. You get true native SVG (crisp at every zoom, no conversion) plus per-marker events, at the cost of pushing each point to the browser. Stay on the server-side path when you have very large datasets, need server-side data-driven styling/labels, or the data must remain on the server — there, rasterize the SVG once at your target size.
Client-side, VirtualPath takes either format, so PNG↔SVG is a one-line swap:
// put the file under wwwroot, e.g. wwwroot/images/pin.svg (or pin.png)
var style = new PointMarkerStyle("images/pin.svg", 0.5, 1.0, 1.0);
// args: path, offsetX, offsetY, scale
razor
<MarkerOverlaySetting>
<SimpleMarkerOverlay MarkerSource="@markers">
<MarkersSetting>
@{
var m = context as MyMarkerModel;
<Marker Id="@m.Id" Position="@m.Position" Style="@m.Style" />
}
</MarkersSetting>
</SimpleMarkerOverlay>
</MarkerOverlaySetting>
Let us know if you have any questions — or if you’d rather stay on the server-side PointStyle path, and I can share a small helper that rasterizes the SVG once at your target size.
Thanks,
Ben