Template:Digitalisierung - Module - Basepoint handling
From MapbenderWiki
(Redirected from Digitalisierung - Module - Basepoint handling)
basepoint handling
A basepoint is a vertex of a geometry array that is currently displayed.
variables
- basepointObj: the basepoint itself (a div tag with css class 'bp', see digitze.css).
- basepointMemberIndex: the index of the member in the geometry array that contains the vertex representing the basepoint.
- basepointGeometryIndex: the index of the geography in the geometry array that contains the vertex representing the basepoint.
- basepointPointIndex: the index of the point in the geometry array that contains the vertex representing the basepoint.
- basepointDragActive: true if the basepoint is currently being moved (begins when the mouse button is pressed over a basepoint, ends when it is released)
functions
- handleBasepoint(obj, i, j, k): this function checks what to do with a basepoint that is currently under the mouse pointer. Depending on what action is intended, other methods (the following) are invoked.
- convertLinepointToBasepoint(obj, i, j, k): this function is invoked when the mouse is over a linepoint. When the mouse is clicked, the method insert basepoint is called.
- insertBasepoint(): adds a new vertex with the coordinates of the mouse position into the geometry array.
- deleteBasepoint(): deletes all points in the geometry array that have the same coordinates as the basepoint.
- selectBasepoint(): when a basepoint move is intended, this function is invoked when the mouse button is pressed. It stores the start coordinates in a global variable and sets basepointDragActive to true, so other functions know that a basepoint is currently being dragged.
- dragBasepoint(): when a basepoint is being dragged and the mouse button is down, this function will track the mouse position. Instead of the basepoint, a transparent object the size of the mapframe is being displayed.
- releaseBasepoint(): when a basepoint is being dragged and the mouse button is released, this function is invoked and the geometry will be updated.
