Map component
There are a number of problems with the current Bit map components, which have been resolved in a new component described in this document.
For purposes of comparison, I’m using https://develop.covercrop-selector.org/ for the Current Map and https://vegspec.org/#/Location for the New Map. For both programs, choose a location when reviewing the comparisons below.
Current Map | New Map |
---|---|
"click and drag" shows longitude/latitude order, and that is the order that appears in the lower-left of the screen. When entering coordinates in the search bar, two options appear, with the first option in the wrong order: | "click and drag" shows latitude/longitude order, and that is the order that appears in the lower-left of the map. When entering coordinates in the search bar, only one option appears: Note: Most users are accustomed to seeing latitude/longitude, which is the standard per ISO 6709. Longitude/latitude should not be shown. |
Longitude/latitude in the lower-left of the screen shows the location of the mouse. | Latitude/longitude in the lower-left of the map shows the location of the marker. Latitude/longitude of the mouse appears above the mouse cursor. |
After dragging the marker, the polygon sometimes disappears when switching screens. | Fixed |
The map doesn't remember zoom when switching screens. | Fixed |
There’s no way to tell if the polygon tool has been selected. | The polygon tool is highlighted when active. |
The trash can always appears. | The trash can appears only if a polygon is selected. |
After creating multiple polygons, the area of the last polygon is calculated. | After creating multiple polygons, the area of all the polygons is calculated. Overlapping polygons are merged before calculating the area, so the total is accurate. |
After creating multiple polygons, only the last polygon is remembered when switching screens. | After creating multiple polygons, all polygons are remembered when switching screens. |
Draw a polygon, delete it, click Next, then click Back. | Fixed |
The compass button ("Reset bearing to north") appears even though you can't change the bearing. | The compass button is hidden. |
New Properties:
hasHelp: Adds a ? button that shows a help screen.
hasElevation: Displays the elevation of the marker in the corner of the map.
hasClear: Clicking the X in the Search box will remove all map properties and set the boundaries of the map to CONUS.
hasImport: Adds a SHP button, which allows the user to import a shape file.
hasFreehand: Adds a “freehand” polygon button, which allows the user to draw a polygon by dragging the mouse rather than clicking the corners of the polygon. Useful for center-pivot irrigation fields.
bounds: When present, sets the boundaries of the map.
If set to “conus”, bounds uses these dimensions:const conus = [ [-124.731422, 24.743319], // Southwest coordinates [-66.969849, 49.345786], // Northeast coordinates ];
Note that bounds overrides the zoom setting. However, when the map is manually zoomed, the bounds are cleared.
fitMapToPolygons: When true, the map container will be resized to fit the bounding box of its polygons.