GIS tracking supervision system electronic fence

The electronic fence of this system is a geographical electronic fence, which is used for tracking and monitoring of materials. It associates materials with related electronic fences. When materials move in real time, it queries whether the materials exceed the electronic fence. If it exceeds the electronic fence, the client page prompts The supply is beyond the electronic fence.

(1) Electronic fence display.

① Display:

Create an electronic fence geofencingLayer layer group and add it to the map. Click the "Fence" drop-down button in the toolbar and select the "Show" option in the pop-up drop-down list to obtain all the electronic fence data. Add it to the geofencingLayer layer group as a geometric feature layer and display it on the map, as shown in the figureInsert image description here

②Hide:

Select the "Hide" option in the "Fence" drop-down list. The geofencingLayer layer group calls the clearLayers() function to clear the geofence data in the layer group. Call the geofencingLayer.clearLayers() function to remove all geofences in the map. .
The code for displaying and hiding the electronic fence in this system is as follows: Insert image description here
Code description: Obtain the electronic fence data through the GetGeofencing interface of Ajax, and add the electronic fence data to the map through the addGeofencingToMap() function. The code is as follows: Code Insert image description here
description: Use the addGeofencingToMap() function, Add the electronic fence data to the featureGroup layer group, display it on the map and zoom to the range where all electronic fences can be viewed.

(2) Electronic fence modification.

Select the "Edit Fence" option from the "Fence" drop-down list on the toolbar, and the tools required for fence editing will pop up. The functions of editing a geo-fence include adding a new geo-fence, modifying a geo-fence, and deleting a geo-fence.

① Added electronic fence.

Click the "Add" button to draw the electronic fence on the map (refer to program code 7-3). After the drawing is completed, the corresponding dialog box pops up. Enter the name of the electronic fence. Click the "Confirm" button and submit the data through Ajax request. Go to the background service, which adds a new electronic fence record in the database, and loads the successfully added electronic fence elements on the map.

② Modify the electronic fence.

Click the "Modify" button, drag the geometric vertex or center of the electronic fence on the map to modify the electronic fence elements (refer to program code 7-6). After the modification is completed, a corresponding dialog box will pop up. You can modify the electronic fence name. Click " After clicking the "Confirm" button, the data is submitted to the background service through an Ajax request. The background service updates the electronic fence data in the database, and the map is loaded and updated to complete the electronic fence elements.
③ Delete the electronic fence. Click the "Delete" button, click the electronic fence element on the map (refer to program code 7-8), a corresponding dialog box will pop up asking whether you want to delete the electronic fence, click the "Confirm" button and request the electronic fence ID through Ajax Submit it to the background service, which deletes the electronic fence record in the database. After the deletion is successful, the map removes the electronic fence element.

toolbox

(1) Measurement.

Click the "Tools" drop-down button in the toolbar, select the "Measure" option in the pop-up drop-down list, open the "Measure" dialog box, activate the "Length" button to measure the distance between polylines on the map, activate "Area" button to measure the area of ​​the polygon area on the map, and activate the "Clear" button to delete the measurement result layer and data.

① Measuring distance:

Click the Length button to activate the Measure Distance tool. Draw polylines. The polylines are not allowed to intersect during the drawing process. Double-click on the map to complete the drawing. The drawing result is displayed in the center of the polyline.

② Measurement area:

Click the Area button to activate the Measure Area tool. To draw a polygon, double-click on the map to complete the drawing. The drawing result is displayed in the center of the polygon.
Insert image description here
Code description: Use the leaflet.draw.js plug-in (the plug-in download address is https://github.com/Leaflet/Leaflet.draw) to draw polylines (L.Draw.Polyline), polygons (L.Draw.Polygon), and single Click the "Length" button and "Area" button to activate the drawn polylines and polygons, use the mouse to draw geometric figures on the map, and then add the geometric figures to the measureLayers layer group. Click the "Clear" button to clear the added geometry in the measureLayers layer group.

(2) Heat map.

The heat map displays the quantity of materials in different warehouses and their geographical areas in a special highlighted form, as shown in Figure 7-24. The heat map can visually check the accumulation of materials, and provide a reference for the integration and dispatch of materials in the region. Insert image description here
Click the "Tools" drop-down button in the toolbar, select the "Heat Map" option in the pop-up drop-down list, activate the heat map function, add a heat map layer to the map, and select the "Heat Map" option again to close the heat map layer. The heat map implementation code of this system is as follows:Insert image description here

Guess you like

Origin blog.csdn.net/leva345/article/details/132956682
Recommended