@abi-software/flatmap-viewer 2.4.2-b.4 → 2.4.2-b.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.rst CHANGED
@@ -38,7 +38,7 @@ The map server endpoint is specified as ``MAP_ENDPOINT`` in ``src/main.js``. It
38
38
  Package Installation
39
39
  ====================
40
40
 
41
- * ``npm install @abi-software/flatmap-viewer@2.4.2-b.4``
41
+ * ``npm install @abi-software/flatmap-viewer@2.4.2-b.5``
42
42
 
43
43
  Documentation
44
44
  -------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmap-viewer",
3
- "version": "2.4.2-b.4",
3
+ "version": "2.4.2-b.5",
4
4
  "description": "Flatmap viewer using Maplibre GL",
5
5
  "repository": "https://github.com/AnatomicMaps/flatmap-viewer.git",
6
6
  "main": "src/main.js",
@@ -956,6 +956,7 @@ class FlatMap
956
956
  * @param {string} anatomicalId The anatomical identifier of the feature on which
957
957
  * to place the marker.
958
958
  * @arg {Object} options Configurable options for the marker.
959
+ * @arg {string} options.className Space-separated CSS class names to add to marker element.
959
960
  * @arg {string} options.colour Colour of the default marker. Defaults to ``'#005974'``
960
961
  * (dark blue).
961
962
  * @arg {string} options.element The DOM element to use as a marker. The default is
@@ -1233,9 +1233,12 @@ export class UserInteractions
1233
1233
  markerIcon.innerHTML = markerHTML.getElement().innerHTML;
1234
1234
  markerElement.id = `marker-${markerId}`;
1235
1235
  markerElement.appendChild(markerIcon);
1236
-
1236
+ const markerOptions = {element: markerElement};
1237
+ if ('className' in options) {
1238
+ markerOptions.className = options.className;
1239
+ }
1237
1240
  const markerPosition = this.__markerPosition(featureId, annotation);
1238
- const marker = new maplibregl.Marker({element: markerElement})
1241
+ const marker = new maplibregl.Marker(markerOptions)
1239
1242
  .setLngLat(markerPosition)
1240
1243
  .addTo(this._map);
1241
1244
  markerElement.addEventListener('mouseenter',
package/src/main.js CHANGED
@@ -93,7 +93,7 @@ export async function standaloneViewer(map_endpoint=null, options={})
93
93
  }
94
94
  }, mapOptions)
95
95
  .then(map => {
96
- map.addMarker('UBERON:0000948'); // Heart
96
+ map.addMarker('UBERON:0000948', {className: 'heart-marker'}); // Heart
97
97
  map.addMarker('UBERON:0002048'); // Lung
98
98
  map.addMarker('UBERON:0000945'); // Stomach
99
99
  map.addMarker('UBERON:0001155'); // Colon