mapping-component-package-jp 0.0.2
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 +70 -0
- package/dist/index.d.ts +264 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +54 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +48 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/rollup.config.js +48 -0
- package/src/components/FabControl.tsx +63 -0
- package/src/components/GoogleSearchBar.tsx +182 -0
- package/src/components/Icons.tsx +20 -0
- package/src/components/JPMapComponent.tsx +96 -0
- package/src/components/SpeedDialTool.tsx +97 -0
- package/src/components/index.ts +22 -0
- package/src/hooks/useMapManager.ts +48 -0
- package/src/interfaces/AgnifyMapComponentProps.ts +18 -0
- package/src/interfaces/CustomMapOptions.ts +14 -0
- package/src/interfaces/Data/EnterpriseRegion.ts +12 -0
- package/src/interfaces/Data/Farm.ts +10 -0
- package/src/interfaces/Data/Field.ts +19 -0
- package/src/interfaces/Data/LocationData.ts +9 -0
- package/src/interfaces/Data/MapLocationFeature.ts +8 -0
- package/src/interfaces/Data/NDVI.ts +14 -0
- package/src/interfaces/GoogleMapsOptions.ts +39 -0
- package/src/interfaces/Message.ts +13 -0
- package/src/interfaces/Mode.ts +54 -0
- package/src/interfaces/Properties.ts +16 -0
- package/src/js/fieldEncapsulation/iql.field.js +8 -0
- package/src/js/fieldEncapsulation/iql.fieldupload.js +158 -0
- package/src/js/fieldEncapsulation/iql.fieldvalidator.js +574 -0
- package/src/js/mapEncapsulation/circle.functions.js +30 -0
- package/src/js/mapEncapsulation/field.geolocation.js +19 -0
- package/src/js/mapEncapsulation/map.common.js +96 -0
- package/src/js/mapEncapsulation/mapOverlayManager.d.ts +64 -0
- package/src/js/mapEncapsulation/mapOverlayManager.js +2753 -0
- package/src/js/mapEncapsulation/shapes/circle.full.js +789 -0
- package/src/js/mapEncapsulation/shapes/circle.sector.js +1099 -0
- package/src/js/mapEncapsulation/shapes/circle.segment.js +1109 -0
- package/src/js/mapEncapsulation/shapes/polygon.customedit.js +393 -0
- package/src/js/mapEncapsulation/shapes/polyline.customedit.js +478 -0
- package/src/utils/commonUtils.ts +5 -0
- package/src/utils/iconUtils.js +52 -0
- package/src/utils/mapUtils.ts +88 -0
- package/tsconfig.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Getting Started with Create React App
|
|
2
|
+
|
|
3
|
+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
|
4
|
+
|
|
5
|
+
## Available Scripts
|
|
6
|
+
|
|
7
|
+
In the project directory, you can run:
|
|
8
|
+
|
|
9
|
+
### `npm start`
|
|
10
|
+
|
|
11
|
+
Runs the app in the development mode.\
|
|
12
|
+
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
|
|
13
|
+
|
|
14
|
+
The page will reload when you make changes.\
|
|
15
|
+
You may also see any lint errors in the console.
|
|
16
|
+
|
|
17
|
+
### `npm test`
|
|
18
|
+
|
|
19
|
+
Launches the test runner in the interactive watch mode.\
|
|
20
|
+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
21
|
+
|
|
22
|
+
### `npm run build`
|
|
23
|
+
|
|
24
|
+
Builds the app for production to the `build` folder.\
|
|
25
|
+
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
26
|
+
|
|
27
|
+
The build is minified and the filenames include the hashes.\
|
|
28
|
+
Your app is ready to be deployed!
|
|
29
|
+
|
|
30
|
+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
|
31
|
+
|
|
32
|
+
### `npm run eject`
|
|
33
|
+
|
|
34
|
+
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
|
|
35
|
+
|
|
36
|
+
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
|
37
|
+
|
|
38
|
+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
|
|
39
|
+
|
|
40
|
+
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
|
|
41
|
+
|
|
42
|
+
## Learn More
|
|
43
|
+
|
|
44
|
+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
|
45
|
+
|
|
46
|
+
To learn React, check out the [React documentation](https://reactjs.org/).
|
|
47
|
+
|
|
48
|
+
### Code Splitting
|
|
49
|
+
|
|
50
|
+
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
|
|
51
|
+
|
|
52
|
+
### Analyzing the Bundle Size
|
|
53
|
+
|
|
54
|
+
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
|
|
55
|
+
|
|
56
|
+
### Making a Progressive Web App
|
|
57
|
+
|
|
58
|
+
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
|
|
59
|
+
|
|
60
|
+
### Advanced Configuration
|
|
61
|
+
|
|
62
|
+
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
|
|
63
|
+
|
|
64
|
+
### Deployment
|
|
65
|
+
|
|
66
|
+
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
|
|
67
|
+
|
|
68
|
+
### `npm run build` fails to minify
|
|
69
|
+
|
|
70
|
+
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import React$1, { ReactNode } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/system';
|
|
3
|
+
|
|
4
|
+
type jpMapType = {
|
|
5
|
+
isMapInitialized: boolean;
|
|
6
|
+
mapObject: google.maps.Map;
|
|
7
|
+
mapManager: any;
|
|
8
|
+
};
|
|
9
|
+
interface JPMapComponentProps {
|
|
10
|
+
gmAPIkey: string;
|
|
11
|
+
jpMap: (jpMap: jpMapType) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: React$1.NamedExoticComponent<JPMapComponentProps>;
|
|
14
|
+
|
|
15
|
+
interface MapLocationFeature {
|
|
16
|
+
StrokeColor: string;
|
|
17
|
+
StrokeOpacity: number;
|
|
18
|
+
StrokeWeight: number;
|
|
19
|
+
FillColor: string;
|
|
20
|
+
FillOpacity: number;
|
|
21
|
+
ZIndex: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface NDVI {
|
|
25
|
+
Poly?: string;
|
|
26
|
+
tileURL: string;
|
|
27
|
+
validGMTiles: string[];
|
|
28
|
+
eosLocationCropperRefId: string;
|
|
29
|
+
eosViewId: string;
|
|
30
|
+
spinnerURL: string;
|
|
31
|
+
spinnerLat: number;
|
|
32
|
+
spinnerLon: number;
|
|
33
|
+
paletteId: string;
|
|
34
|
+
colorMapTypeId: number;
|
|
35
|
+
isFullView: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface Field {
|
|
39
|
+
Id: string | number;
|
|
40
|
+
Poly: number[][][];
|
|
41
|
+
LocationName: string;
|
|
42
|
+
OrganisationName?: string;
|
|
43
|
+
FarmName?: string;
|
|
44
|
+
Area: number;
|
|
45
|
+
IsIrrigated: boolean;
|
|
46
|
+
CropPlanted?: string;
|
|
47
|
+
HaPlanted?: number;
|
|
48
|
+
CultivarPlanted?: string;
|
|
49
|
+
PlantingDate?: string;
|
|
50
|
+
MapLocationFeature?: MapLocationFeature;
|
|
51
|
+
NDVI?: NDVI;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface Farm {
|
|
55
|
+
farmId: string;
|
|
56
|
+
farmOrganization: string;
|
|
57
|
+
farmName: string;
|
|
58
|
+
minLat: number;
|
|
59
|
+
maxLat: number;
|
|
60
|
+
minLng: number;
|
|
61
|
+
maxLng: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface GoogleMapOptions {
|
|
65
|
+
backgroundColor?: string;
|
|
66
|
+
clickableIcons?: boolean;
|
|
67
|
+
controlSize?: number;
|
|
68
|
+
disableDefaultUI?: boolean;
|
|
69
|
+
disableDoubleClickZoom?: boolean;
|
|
70
|
+
draggable?: boolean;
|
|
71
|
+
draggableCursor?: string;
|
|
72
|
+
draggingCursor?: string;
|
|
73
|
+
fullscreenControl?: boolean;
|
|
74
|
+
fullscreenControlOptions?: google.maps.FullscreenControlOptions;
|
|
75
|
+
gestureHandling?: 'none' | 'greedy' | 'cooperative' | 'auto';
|
|
76
|
+
heading?: number;
|
|
77
|
+
keyboardShortcuts?: boolean;
|
|
78
|
+
mapId?: string;
|
|
79
|
+
mapTypeControl?: boolean;
|
|
80
|
+
mapTypeControlOptions?: google.maps.MapTypeControlOptions;
|
|
81
|
+
mapTypeId?: 'roadmap' | 'satellite' | 'hybrid' | 'terrain';
|
|
82
|
+
maxZoom?: number;
|
|
83
|
+
minZoom?: number;
|
|
84
|
+
noClear?: boolean;
|
|
85
|
+
panControl?: boolean;
|
|
86
|
+
panControlOptions?: google.maps.PanControlOptions;
|
|
87
|
+
restriction?: google.maps.MapRestriction;
|
|
88
|
+
rotateControl?: boolean;
|
|
89
|
+
rotateControlOptions?: google.maps.RotateControlOptions;
|
|
90
|
+
scaleControl?: boolean;
|
|
91
|
+
scaleControlOptions?: google.maps.ScaleControlOptions;
|
|
92
|
+
scrollwheel?: boolean;
|
|
93
|
+
streetView?: google.maps.StreetViewPanorama;
|
|
94
|
+
streetViewControl?: boolean;
|
|
95
|
+
streetViewControlOptions?: google.maps.StreetViewControlOptions;
|
|
96
|
+
styles?: google.maps.MapTypeStyle[];
|
|
97
|
+
tilt?: 0 | 45;
|
|
98
|
+
zoom?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
99
|
+
zoomControl?: boolean;
|
|
100
|
+
zoomControlOptions?: google.maps.ZoomControlOptions;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare enum ModeType {
|
|
104
|
+
DEFAULT = 0,
|
|
105
|
+
DRAW = 1,
|
|
106
|
+
REGIONFARMS = 2,
|
|
107
|
+
NDVI = 3,
|
|
108
|
+
ENTERPRISEREGION = 4,
|
|
109
|
+
EDITFIELD = 5,
|
|
110
|
+
LOCATIONS_ADMINISTRATIVE = 6,
|
|
111
|
+
LOCATIONS_CADASTRAL = 7,
|
|
112
|
+
LOCATIONS_GRAIN_STORAGE = 8,
|
|
113
|
+
SOIL_TERRAIN = 9,
|
|
114
|
+
SOIL_SOIL = 10,
|
|
115
|
+
SOIL_LITHOLOGY = 11,
|
|
116
|
+
WEATHER_GRID = 12,
|
|
117
|
+
WEATHER_UNIVERSAL = 13,
|
|
118
|
+
WEATHER_ALERTS = 14
|
|
119
|
+
}
|
|
120
|
+
interface Mode {
|
|
121
|
+
modeType: ModeType;
|
|
122
|
+
isMoblie: boolean;
|
|
123
|
+
properties: Properties$1[];
|
|
124
|
+
}
|
|
125
|
+
interface Properties$1 {
|
|
126
|
+
modeType: ModeType;
|
|
127
|
+
polygonOptions?: PolygonOptions;
|
|
128
|
+
icon?: Icon$1;
|
|
129
|
+
labelVisable?: boolean;
|
|
130
|
+
data?: any;
|
|
131
|
+
}
|
|
132
|
+
interface PolygonOptions {
|
|
133
|
+
unselected: google.maps.PolygonOptions;
|
|
134
|
+
selected: google.maps.PolygonOptions;
|
|
135
|
+
other: google.maps.PolygonOptions;
|
|
136
|
+
}
|
|
137
|
+
interface Icon$1 {
|
|
138
|
+
icon?: string;
|
|
139
|
+
name?: string;
|
|
140
|
+
text?: string;
|
|
141
|
+
style?: Style;
|
|
142
|
+
}
|
|
143
|
+
interface Style {
|
|
144
|
+
fillColor?: string;
|
|
145
|
+
strokeColor?: string;
|
|
146
|
+
strokeWidth?: number;
|
|
147
|
+
opacity?: number;
|
|
148
|
+
zIndex?: number;
|
|
149
|
+
width?: number;
|
|
150
|
+
height?: number;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
interface Properties {
|
|
154
|
+
style?: React.CSSProperties;
|
|
155
|
+
sx?: SxProps<Theme>;
|
|
156
|
+
text?: string;
|
|
157
|
+
icon?: Icon;
|
|
158
|
+
}
|
|
159
|
+
interface Icon {
|
|
160
|
+
icon?: ReactNode;
|
|
161
|
+
name?: string;
|
|
162
|
+
text?: string;
|
|
163
|
+
style?: React.CSSProperties;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
interface CustomMapOptions extends GoogleMapOptions {
|
|
167
|
+
mode: Mode;
|
|
168
|
+
containerSize?: {
|
|
169
|
+
width?: string;
|
|
170
|
+
height?: string;
|
|
171
|
+
};
|
|
172
|
+
searchBar?: Properties;
|
|
173
|
+
speedDial?: Properties;
|
|
174
|
+
fabControl?: Properties;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
declare enum MessageType {
|
|
178
|
+
INFO = "info",
|
|
179
|
+
WARNING = "warning",
|
|
180
|
+
ERROR = "danger",
|
|
181
|
+
SUCCESS = "success"
|
|
182
|
+
}
|
|
183
|
+
interface Message {
|
|
184
|
+
type: MessageType;
|
|
185
|
+
message: string;
|
|
186
|
+
code?: number;
|
|
187
|
+
data?: any;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface EnterpriseRegion {
|
|
191
|
+
Id: string;
|
|
192
|
+
Poly?: string;
|
|
193
|
+
Coords?: number[][][];
|
|
194
|
+
LocationName: string;
|
|
195
|
+
MapLocationFeature?: MapLocationFeature;
|
|
196
|
+
NDVI?: NDVI;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
declare class MapOverlayManager {
|
|
200
|
+
constructor(mapInstance: google.maps.Map);
|
|
201
|
+
|
|
202
|
+
// Event Handlers
|
|
203
|
+
eventHandlers_set(eH: any): void;
|
|
204
|
+
eventHandlers_get(): any;
|
|
205
|
+
|
|
206
|
+
// Shape Management
|
|
207
|
+
Shape_PolygonCustomEdit_Add(isHole: boolean, config: any, isMobile: boolean, mapWidth: number, mapHeight: number, vmWidth: number, offsetX: number, offsetY: number): string;
|
|
208
|
+
Shape_CircleFull_Add(isHole: boolean, config: any, isMobile: boolean, mapWidth: number, mapHeight: number, vmWidth: number, vmcLat: number, vmcLng: number, offsetX: number, offsetY: number): string;
|
|
209
|
+
Shape_CircleSector_Add(isHole: boolean, config: any, isMobile: boolean, mapWidth: number, mapHeight: number, vmWidth: number, vmcLat: number, vmcLng: number, offsetX: number, offsetY: number): string;
|
|
210
|
+
Shape_CircleSegment_Add(isHole: boolean, config: any, isMobile: boolean, mapWidth: number, mapHeight: number, vmWidth: number, vmcLat: number, vmcLng: number, offsetX: number, offsetY: number): string;
|
|
211
|
+
Shape_Edit(ShapeId: string | number): void;
|
|
212
|
+
Shape_DrawingDone(ShapeId: string | number): void;
|
|
213
|
+
Shape_Delete(ShapeId: string | number, EventHandlers?: any): void;
|
|
214
|
+
Shape_DeleteAll(isMobile?: boolean): void;
|
|
215
|
+
Shape_Convert(ShapeId: string | number): string;
|
|
216
|
+
|
|
217
|
+
// Rendering Methods
|
|
218
|
+
RenderFields(locations: any[], properties: any, editMode?: boolean): void;
|
|
219
|
+
RenderRegionFarms(locationsJson: any, icon: any): void;
|
|
220
|
+
RenderRegions(locations: any[], properties: any): void;
|
|
221
|
+
RenderBackgroundFields(locations: any[], properties: any): void;
|
|
222
|
+
|
|
223
|
+
// Shape Selection and Management
|
|
224
|
+
selectShape(shapeId: string | number, selectedStyle: any, unselectedStyle: any): void;
|
|
225
|
+
isShapeInLocPolygons(shapeId: string | number): boolean;
|
|
226
|
+
addToLocPolygons(shape: any): void;
|
|
227
|
+
panAndZoomToShape(shapeId: string | number): void;
|
|
228
|
+
|
|
229
|
+
// Editing Methods
|
|
230
|
+
PolygonCustomEdit_Edit(ShapeId: string | number, isMobile: boolean): void;
|
|
231
|
+
CircleSector_Edit(ShapeId: string | number, isMobile: boolean): void;
|
|
232
|
+
CircleFull_Edit(ShapeId: string | number, isMobile: boolean): void;
|
|
233
|
+
CircleSegment_Edit(ShapeId: string | number, isMobile: boolean): void;
|
|
234
|
+
|
|
235
|
+
// Field Management
|
|
236
|
+
TriggerField_ChangeEvent(): any;
|
|
237
|
+
DrawField_AttachEvents(eHandlers: any): void;
|
|
238
|
+
clearBackgroundFields(): void;
|
|
239
|
+
checkForBackgroundFieldOverlaps(): boolean;
|
|
240
|
+
|
|
241
|
+
// NDVI Methods
|
|
242
|
+
NDVI_AddOverlay_DEA(
|
|
243
|
+
locationJson: any[],
|
|
244
|
+
ndviTileURL: string,
|
|
245
|
+
validGMTiles: string[],
|
|
246
|
+
eosLocationCropperRefId: string,
|
|
247
|
+
eosViewId: string,
|
|
248
|
+
spinnerURL: string,
|
|
249
|
+
spinnerLat: number,
|
|
250
|
+
spinnerLon: number,
|
|
251
|
+
paletteId: string,
|
|
252
|
+
colorMapTypeId: any,
|
|
253
|
+
isFullView: boolean,
|
|
254
|
+
onComplete?: Function
|
|
255
|
+
): void;
|
|
256
|
+
NDVI_RemoveOverlay(): void;
|
|
257
|
+
NDVI_DrawLocation(locationJson: any[], offsetX: number, offsetY: number, vMapWidth: number, showTooltip: boolean): void;
|
|
258
|
+
|
|
259
|
+
// Cleanup Methods
|
|
260
|
+
destroy(): void;
|
|
261
|
+
map_clear(): void;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export { type CustomMapOptions, type EnterpriseRegion, type Farm, type Field, type Icon, type MapLocationFeature, MapOverlayManager, type Message, MessageType, type Mode, type Icon$1 as ModeIcon, type Properties$1 as ModeProperties, ModeType, type NDVI, type PolygonOptions, type Properties, type Style, _default as default };
|