This code can most certainly not work because things like the below will always fail in JS:
var mrkr = WPViews.view_addon_markers['carte-des-incidents']['marker-[wpv-post-id]'];
This will make a mathematical operation instead of actually setting a object property (I refer to the ['marker-[wpv-post-id]'], this will try to subtract the value of wpv-post-id from the string marker).
So I fiddled around with this and fixed it but still run into the issue which is as well pretty much logical to happen:
Markers are created dynamically, asynchronously. This makes it literally impossible to access the WPViews.view_addon_markers.map_name.marker_id (where map_name and marker_id are the actual values you would be sueding in the setup, so replace on usage).
Impossible to access because while a console.log will show the marker data, this only happens once you click the ">" in the console log to expand that object. But on code execution, that object is not yet populated. This is the reason when you try to access it will throw an error and say it is undefined, because at the point of js_event_wpv_addon_maps_init_map_completed, only the map instance is created, not all markers, since those might be paginated, etc.
So I am pretty much stuck with "not possible and certainly not working". However it would be very nice if we could use dynamic SVG exactly as @romanb-3 attempted here years ago (I believe I partially helped meanwhile recreate the exact project where this was/is used :P, however with WP Grid Builder instead of Toolset)
@christian-c, if you can still see/read this, do you have any further insight how we can make this work? Because as per above points I elaborate I doubt this ever worked, specially with the 'marker-[wpv-post-id]' which will try to make a operation instead of a string (this can be solved easily) but also buy the issue mentioned that markers are not available at this point, and hence also cannot be dynamically altered.
We would need a hook to use asynchronously when the marker is generated, which might be before or after paginate and search or even zoom in/out.
Would love to bring this to work with Toolset, right now however it seems a thing of impossible result
I currently achieve similar, but not the same results using a custom field to store the type of marker and then load that as an URL in the Map Marker Icon Settings, however this is much more limited than actually being able to create the SVG directly inside the View Loop, since it requires you to store the SVG somewhere and after that it cannot be edited anymore on the fly, so you end up needing many SVGs... and conditions or field values to listen to.
Even better would be if the Map Marker Icon setting would accept SVG instead of URL only. But that probably needs a ground up change in the Core Code of Maps...
Thanks if you have any input to share further!