Skip to content

Commit

Permalink
Merge pull request #125 from Esri/notify-3
Browse files Browse the repository at this point in the history
Notify 3
  • Loading branch information
jmhauck authored Jan 21, 2023
2 parents dd3bdd0 + 6f432b2 commit 44e2103
Show file tree
Hide file tree
Showing 22 changed files with 343 additions and 142 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

## [0.2.9] - January 20th 2023

## [0.2.8] - January 13th 2023

## [0.2.7] - January 12th 2023
Expand Down Expand Up @@ -43,5 +45,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
[0.2.6]: https://github.com/Esri/solution.js/compare/v0.2.5...v0.2.6 "v0.2.6"
[0.2.7]: https://github.com/Esri/solution.js/compare/v0.2.6...v0.2.7 "v0.2.7"
[0.2.8]: https://github.com/Esri/solution.js/compare/v0.2.7...v0.2.8 "v0.2.8"
[Unreleased]: https://github.com/Esri/solution.js/compare/v0.2.8...HEAD "Unreleased Changes"
[0.2.9]: https://github.com/Esri/solution.js/compare/v0.2.8...v0.2.9 "v0.2.9"
[Unreleased]: https://github.com/Esri/solution.js/compare/v0.2.9...HEAD "Unreleased Changes"

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@esri/solutions-components",
"version": "0.2.8",
"version": "0.2.9",
"description": "Web Components for Esri's Solutions Applications",
"main": "dist/index.cjs.js",
"module": "dist/index.js",
Expand All @@ -15,7 +15,7 @@
"dist/"
],
"scripts": {
"build": "npm run lint:ts && stencil build --docs",
"build": "stencil build --docs",
"build:debug": "stencil build -c stencil.debugconfig.ts",
"start": "stencil build --dev --watch --serve",
"clean:src": "start cmd.exe /c cleanSrc.bat",
Expand Down
44 changes: 42 additions & 2 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export namespace Components {
* esri/geometry/Geometry: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html
*/
"geometries": __esri.Geometry[];
"geometryEngine": any;
/**
* number: The component's maximum selectable value.
*/
Expand Down Expand Up @@ -198,6 +199,8 @@ export namespace Components {
"mapInfos": IMapInfo[];
}
interface MapDrawTools {
"GraphicsLayer": any;
"Sketch": any;
/**
* boolean: sketch is used by multiple components...need a way to know who should respond...
*/
Expand Down Expand Up @@ -251,6 +254,7 @@ export namespace Components {
"selectionMode": SelectionMode;
}
interface MapSearch {
"Search": any;
/**
* Clears the state of the search widget
* @returns Promise that resolves when the operation is complete
Expand All @@ -262,6 +266,11 @@ export namespace Components {
"mapView": __esri.MapView;
}
interface MapSelectTools {
"Graphic": any;
"GraphicsLayer": any;
"Search": any;
"Sketch": any;
"SketchViewModel": any;
/**
* Clear any selection results
* @returns Promise when the results have been cleared
Expand All @@ -270,7 +279,8 @@ export namespace Components {
/**
* esri/geometry: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html
*/
"geometries": Geometry[];
"geometries": __esri.Geometry[];
"geometryEngine": any;
/**
* Get the new selection set
* @returns Promise with the new selection set
Expand Down Expand Up @@ -330,10 +340,16 @@ export namespace Components {
"layerView": __esri.FeatureLayerView;
}
interface PublicNotification {
"Graphic": any;
"GraphicsLayer": any;
"Search": any;
"Sketch": any;
"SketchViewModel": any;
/**
* esri/views/layers/FeatureLayerView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html
*/
"addresseeLayer": __esri.FeatureLayerView;
"geometryEngine": any;
/**
* esri/views/View: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
*/
Expand All @@ -344,6 +360,8 @@ export namespace Components {
"showRefineSelection": boolean;
}
interface RefineSelection {
"GraphicsLayer": any;
"SketchViewModel": any;
/**
* esri/views/layers/FeatureLayerView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html
*/
Expand All @@ -358,6 +376,8 @@ export namespace Components {
"selectionSets": ISelectionSet[];
}
interface RefineSelectionTools {
"GraphicsLayer": any;
"SketchViewModel": any;
/**
* boolean: sketch is used by multiple components...need a way to know who should respond...
*/
Expand Down Expand Up @@ -932,6 +952,7 @@ declare namespace LocalJSX {
* esri/geometry/Geometry: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html
*/
"geometries"?: __esri.Geometry[];
"geometryEngine"?: any;
/**
* Emitted on demand when a buffer is generated.
*/
Expand Down Expand Up @@ -1070,6 +1091,8 @@ declare namespace LocalJSX {
"onExpandMap"?: (event: MapCardCustomEvent<EExpandType>) => void;
}
interface MapDrawTools {
"GraphicsLayer"?: any;
"Sketch"?: any;
/**
* boolean: sketch is used by multiple components...need a way to know who should respond...
*/
Expand Down Expand Up @@ -1126,6 +1149,7 @@ declare namespace LocalJSX {
"selectionMode"?: SelectionMode;
}
interface MapSearch {
"Search"?: any;
/**
* esri/views/View: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
*/
Expand All @@ -1136,10 +1160,16 @@ declare namespace LocalJSX {
"onSearchChange"?: (event: MapSearchCustomEvent<ISearchResult>) => void;
}
interface MapSelectTools {
"Graphic"?: any;
"GraphicsLayer"?: any;
"Search"?: any;
"Sketch"?: any;
"SketchViewModel"?: any;
/**
* esri/geometry: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html
*/
"geometries"?: Geometry[];
"geometries"?: __esri.Geometry[];
"geometryEngine"?: any;
/**
* boolean: When true a new label is not generated for the stored selection set
*/
Expand Down Expand Up @@ -1192,10 +1222,16 @@ declare namespace LocalJSX {
"layerView"?: __esri.FeatureLayerView;
}
interface PublicNotification {
"Graphic"?: any;
"GraphicsLayer"?: any;
"Search"?: any;
"Sketch"?: any;
"SketchViewModel"?: any;
/**
* esri/views/layers/FeatureLayerView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html
*/
"addresseeLayer"?: __esri.FeatureLayerView;
"geometryEngine"?: any;
/**
* esri/views/View: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
*/
Expand All @@ -1206,6 +1242,8 @@ declare namespace LocalJSX {
"showRefineSelection"?: boolean;
}
interface RefineSelection {
"GraphicsLayer"?: any;
"SketchViewModel"?: any;
/**
* esri/views/layers/FeatureLayerView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html
*/
Expand All @@ -1224,6 +1262,8 @@ declare namespace LocalJSX {
"selectionSets"?: ISelectionSet[];
}
interface RefineSelectionTools {
"GraphicsLayer"?: any;
"SketchViewModel"?: any;
/**
* boolean: sketch is used by multiple components...need a way to know who should respond...
*/
Expand Down
5 changes: 3 additions & 2 deletions src/components/buffer-tools/buffer-tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import { Component, Element, Event, EventEmitter, Host, h, Prop, State, VNode, Watch } from "@stencil/core";
import BufferTools_T9n from "../../assets/t9n/buffer-tools/resources.json";
import { getLocaleComponentStrings } from "../../utils/locale";
import * as geometryEngine from "@arcgis/core/geometry/geometryEngine";

@Component({
tag: "buffer-tools",
Expand Down Expand Up @@ -78,6 +77,8 @@ export class BufferTools {
*/
@Prop({ mutable: true }) unit: __esri.LinearUnits = "meters";

@Prop() geometryEngine: any;

//--------------------------------------------------------------------------
//
// State (internal)
Expand Down Expand Up @@ -235,7 +236,7 @@ export class BufferTools {
this._bufferTimeout = setTimeout(() => {
// needs to be wgs 84 or Web Mercator
if (this.geometries?.length > 0 && this.unit && this.distance > 0) {
const buffer = geometryEngine.geodesicBuffer(
const buffer = this.geometryEngine.geodesicBuffer(
this.geometries,
this.distance,
this.unit,
Expand Down
21 changes: 11 additions & 10 deletions src/components/buffer-tools/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@

## Properties

| Property | Attribute | Description | Type | Default |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | ---------- |
| `appearance` | `appearance` | string: The appearance of display. Can be a "slider" or "text" inputs for distance/value | `"slider" \| "text"` | `"text"` |
| `distance` | `distance` | number: The distance used for buffer | `number` | `0` |
| `geometries` | -- | esri/geometry/Geometry: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html | `Geometry[]` | `[]` |
| `sliderMax` | `slider-max` | number: The component's maximum selectable value. | `number` | `100` |
| `sliderMin` | `slider-min` | number: The component's minimum selectable value. | `number` | `0` |
| `sliderTicks` | `slider-ticks` | number: Displays tick marks on the number line at a specified interval. | `number` | `10` |
| `unionResults` | `union-results` | boolean: option to control if buffer results should be unioned | `boolean` | `true` |
| `unit` | `unit` | LinearUnits: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#LinearUnits | `"feet" \| "kilometers" \| "meters" \| "miles" \| "nautical-miles" \| "yards" \| number` | `"meters"` |
| Property | Attribute | Description | Type | Default |
| ---------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | ----------- |
| `appearance` | `appearance` | string: The appearance of display. Can be a "slider" or "text" inputs for distance/value | `"slider" \| "text"` | `"text"` |
| `distance` | `distance` | number: The distance used for buffer | `number` | `0` |
| `geometries` | -- | esri/geometry/Geometry: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html | `Geometry[]` | `[]` |
| `geometryEngine` | `geometry-engine` | | `any` | `undefined` |
| `sliderMax` | `slider-max` | number: The component's maximum selectable value. | `number` | `100` |
| `sliderMin` | `slider-min` | number: The component's minimum selectable value. | `number` | `0` |
| `sliderTicks` | `slider-ticks` | number: Displays tick marks on the number line at a specified interval. | `number` | `10` |
| `unionResults` | `union-results` | boolean: option to control if buffer results should be unioned | `boolean` | `true` |
| `unit` | `unit` | LinearUnits: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#LinearUnits | `"feet" \| "kilometers" \| "meters" \| "miles" \| "nautical-miles" \| "yards" \| number` | `"meters"` |


## Events
Expand Down
16 changes: 9 additions & 7 deletions src/components/map-draw-tools/map-draw-tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { Component, Element, Event, EventEmitter, Host, h, Method, Prop, State,
import state from "../../utils/publicNotificationStore";
import MapDrawTools_T9n from "../../assets/t9n/map-draw-tools/resources.json";
import { getLocaleComponentStrings } from "../../utils/locale";
import GraphicsLayer from "@arcgis/core/layers/GraphicsLayer";
import Sketch from "@arcgis/core/widgets/Sketch";

@Component({
tag: "map-draw-tools",
Expand Down Expand Up @@ -75,6 +73,10 @@ export class MapDrawTools {
*/
@Prop({ mutable: true }) graphics: __esri.Graphic[] = [];

@Prop() GraphicsLayer: any;

@Prop() Sketch: any;

//--------------------------------------------------------------------------
//
// State (internal)
Expand All @@ -101,12 +103,12 @@ export class MapDrawTools {
/**
* esri/layers/GraphicsLayer: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html
*/
protected _sketchGraphicsLayer: GraphicsLayer;
protected _sketchGraphicsLayer: __esri.GraphicsLayer;

/**
* esri/widgets/Sketch: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html
*/
protected _sketchWidget: Sketch;
protected _sketchWidget: __esri.Sketch;

//--------------------------------------------------------------------------
//
Expand Down Expand Up @@ -230,9 +232,9 @@ export class MapDrawTools {
const title = this._translations.sketchLayer;
const sketchIndex = this.mapView.map.layers.findIndex((l) => l.title === title);
if (sketchIndex > -1) {
this._sketchGraphicsLayer = this.mapView.map.layers.getItemAt(sketchIndex) as GraphicsLayer;
this._sketchGraphicsLayer = this.mapView.map.layers.getItemAt(sketchIndex) as __esri.GraphicsLayer;
} else {
this._sketchGraphicsLayer = new GraphicsLayer({ title });
this._sketchGraphicsLayer = new this.GraphicsLayer({ title });
state.managedLayers.push(title);
this.mapView.map.layers.add(this._sketchGraphicsLayer);
}
Expand All @@ -248,7 +250,7 @@ export class MapDrawTools {
* @protected
*/
protected _initDrawTools(): void {
this._sketchWidget = new Sketch({
this._sketchWidget = new this.Sketch({
layer: this._sketchGraphicsLayer,
view: this.mapView,
container: this._sketchElement,
Expand Down
Loading

0 comments on commit 44e2103

Please sign in to comment.