yio-map 0.15.1 → 0.16.0

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.md CHANGED
@@ -44,8 +44,8 @@ See [CHANGELOG.md](CHANGELOG.md) for breaking changes between versions.
44
44
  | `center` | `[lon, lat]` | Initial map center in EPSG:4326 |
45
45
  | `zoom` | `number` | Initial zoom level (1 -- 22) |
46
46
  | `enableSearch` | `boolean` | Show address search input |
47
- | `enablePinning` | `boolean` | Allow placing markers on the map |
48
- | `enableSelect` | `boolean` | Enable feature selection on click/hover |
47
+ | `enablePinning` | `boolean` | Allow placing markers on the map: every click moves the marker to the clicked point, also when it selects features. With `enableSelect`, a click on a selectable feature shows the marker in blue instead of red |
48
+ | `enableSelect` | `boolean` | Enable feature selection on click/hover; only content features with an `id` property are selectable |
49
49
  | `editCreate` | `string` | Source layer name to draw new features on |
50
50
  | `editModify` | `number[]` | Feature IDs enabled for editing |
51
51
  | `geojsonSources` | `object\|string` | GeoJSON data or URL to overlay, by source id of the content map. A source without a layer in the content map is ignored with a console warning (once per content map). |
@@ -58,7 +58,7 @@ See [CHANGELOG.md](CHANGELOG.md) for breaking changes between versions.
58
58
  |---|---|---|
59
59
  | `change` | `{ changedProperties }` | Map state changed (center, zoom, features) |
60
60
  | `click` | PointerEvent | Click on the map (with `enableSelect`) |
61
- | `pin` | `{ coordinate: [lon, lat] }` | Marker placed (with `enablePinning`) |
61
+ | `pin` | `{ coordinate: [lon, lat], selectable: boolean }` | Marker placed (with `enablePinning`); `selectable` is `true` when the click hit a selectable feature (with `enableSelect`), always `false` for `setPin()` |
62
62
 
63
63
  ## Development
64
64
 
@@ -1 +1 @@
1
- {"version":3,"file":"YioMap.d.ts","sourceRoot":"","sources":["../src/YioMap.js"],"names":[],"mappings":"AAsBA;IACE,yCAmCE;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAeE;IAEF,sBAAsB;IACtB,kBAD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CAAC,MAAM,CAAC,QAIvB;IAmBD,+CAEC;;CACF;2BAviBgD,KAAK;uBAU/B,mBAAmB"}
@@ -1,5 +1,8 @@
1
1
  export const defaultStyles: Style[];
2
+ /** The pin on a plain point */
2
3
  export const pinStyle: Style;
4
+ /** The pin on a selectable feature (with `enableSelect`) */
5
+ export const pinSelectableStyle: Style;
3
6
  export namespace emptyGeojson {
4
7
  let type: string;
5
8
  let features: any[];
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.js"],"names":[],"mappings":"AASA,oCAUE;AAQF,6BAMG;;;;;sBAjC+C,aAAa"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.js"],"names":[],"mappings":"AASA,oCAUE;AA2BF,+BAA+B;AAC/B,6BAAkD;AAClD,4DAA4D;AAC5D,uCAAuE;;;;;sBAjDrB,aAAa"}
@@ -8,9 +8,13 @@ export default class UserPinInteraction extends Interaction {
8
8
  */
9
9
  constructor(options: Options);
10
10
  setMap(map: any): void;
11
+ /**
12
+ * Show the pin as a plain point, e.g. when the selection is switched off. The pin stays where it is.
13
+ */
14
+ resetSelectable(): void;
11
15
  setActive(active: any): void;
12
16
  /**
13
- * Set the pin to a specific location.
17
+ * Set the pin to a specific location, as a plain point.
14
18
  * @param {Array<number>} coordinate - coordinate in EPSG:3857
15
19
  */
16
20
  setPin(coordinate: Array<number>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"UserPinInteraction.d.ts","sourceRoot":"","sources":["../../src/controls/UserPinInteraction.js"],"names":[],"mappings":"AAQA;;;GAGG;AAEH;IAQE;;OAEG;IACH,qBAFW,OAAO,EAMjB;IAED,uBASC;IAqCD,6BAKC;IAED;;;OAGG;IACH,mBAFW,KAAK,CAAC,MAAM,CAAC,QAIvB;;CAaF;;YA5Fa,OAAO,cAAc,EAAE,MAAM;;wBAVnB,+BAA+B"}
1
+ {"version":3,"file":"UserPinInteraction.d.ts","sourceRoot":"","sources":["../../src/controls/UserPinInteraction.js"],"names":[],"mappings":"AASA;;;GAGG;AAEH;IAQE;;OAEG;IACH,qBAFW,OAAO,EAMjB;IAED,uBASC;IAyCD;;OAEG;IACH,wBAIC;IAED,6BAKC;IAED;;;OAGG;IACH,mBAFW,KAAK,CAAC,MAAM,CAAC,QAIvB;;CAaF;;YAzGa,OAAO,cAAc,EAAE,MAAM;;wBAXnB,+BAA+B"}
@@ -1 +1 @@
1
- {"version":3,"file":"UserSelectInteraction.d.ts","sourceRoot":"","sources":["../../src/controls/UserSelectInteraction.js"],"names":[],"mappings":"AAKA;;;GAGG;AAEH;IAQE;;OAEG;IACH,qBAFW,OAAO,EAWjB;IAED,uBASC;IAiED,6BAQC;;CACF;;YA5Ga,OAAO,cAAc,EAAE,MAAM;;wBAPnB,+BAA+B"}
1
+ {"version":3,"file":"UserSelectInteraction.d.ts","sourceRoot":"","sources":["../../src/controls/UserSelectInteraction.js"],"names":[],"mappings":"AAMA;;;GAGG;AAEH;IAQE;;OAEG;IACH,qBAFW,OAAO,EAWjB;IAED,uBASC;IA4DD,6BAQC;;CACF;;YAvGa,OAAO,cAAc,EAAE,MAAM;;wBARnB,+BAA+B"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The selectable features of the content map at a pixel: those with an `id` property.
3
+ * They are reported in `userSelect`; other content features (e.g. a fill without `id`) are not selectable.
4
+ * @param {import('ol/Map.js').default} map
5
+ * @param {import('ol/layer/Group.js').default} contentLayer
6
+ * @param {import('ol/pixel.js').Pixel} pixel
7
+ * @returns {Array<import('ol/Feature.js').FeatureLike>}
8
+ */
9
+ export function getSelectableFeaturesAtPixel(map: import("ol/Map.js").default, contentLayer: import("ol/layer/Group.js").default, pixel: import("ol/pixel.js").Pixel): Array<import("ol/Feature.js").FeatureLike>;
10
+ //# sourceMappingURL=selectableFeatures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectableFeatures.d.ts","sourceRoot":"","sources":["../../src/controls/selectableFeatures.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,kDALW,OAAO,WAAW,EAAE,OAAO,gBAC3B,OAAO,mBAAmB,EAAE,OAAO,SACnC,OAAO,aAAa,EAAE,KAAK,GACzB,KAAK,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC,CAQtD"}