new alk.interaction.WayPointRouteModify(opt_options)
This constructor creates an Interaction object that
provides a Route Modify object for the
alk.layer.RoutingLayer
that only creates and deletes WayPoints.
The given stops, or stops labeled alk.val.StopType.WayPoint
,
alk.val.StopType.Origin
or alk.val.StopType.Destination
are not protected so they may be deleted. Any points created on the
route will be created as WayPoints, which may increase or decrease the
numbering or lettering of the WayPoints accordingly..
Option | Type | Description |
---|---|---|
routingLayer |
alk.layer.RoutingLayer |
This option specifies the |
condition |
ol.EventsConditionType | undefined |
This option is an OpenLayers option passed on to the A function that takes an |
deleteCondition |
ol.EventsConditionType | undefined |
This option is an OpenLayers option passed on to the QA function that takes an Specific to |
pixelTolerance |
number | undefined |
This option is an OpenLayers option passed on to the Pixel tolerance for considering the pointer close enough to a segment or vertex for editing. Specific to |
style |
ol.style.Style | Array.<ol.style.Style> | ol.StyleFunction | undefined |
This option is an OpenLayers option passed on to the Style used for the features being modified. By default the default
edit style is used (see |
wrapX |
boolean | undefined |
This option is an OpenLayers option passed on to the Wrap the world horizontally on the sketch overlay. Default is false. |
Fires:
-
change:routingLayer
- This event fires when the routing layer is updated.
Extends
Members
-
routingLayer{alk.layer.RoutingLayer}
-
-
routingLayerStyle{alk.style.RoutingLayerStyle}
-
This attribute contains the RoutingLayerStyle that was either assigned or created for this RoutingLayer.
Methods
-
getCreationStopType(){alk.val.StopType} inherited
-
This function returns the stop type of a stop that is added by this modifier.
-
getModifiableStopTypes(){Array.<alk.val.StopType>} inherited
-
This function returns an array of the stop types that may be modified. This particular implementation only allows
alk.val.StopType.ViaPoint
. -
getModifiedSegments(){Array.<ol.Feature>} inherited
-
This function returns the segment features deemed to be modified since the modify event began.
-
getModifiedStops(){Array.<ol.Feature>} inherited
-
This function returns the stop features deemed to be modified since the modify event began.
-
handleEvent(mapBrowserEvent){boolean} inherited
-
This override handles an exception from the event handler usually on 'pointerup' where it seems it is a delayed event or race condition on removal of a feature, because the exception caught is it OID is not found. We log the exception and continue without incident. TODO: More research needed on why OID is not found or why feature went away, or why event happened at all.
Name Type Description mapBrowserEvent
ol.MapBrowserPointerEvent -
processEvent(event){alkx.RouteServiceOptions|null} inherited
-
This method is invoked by the modify end handler to process the event. If it returns routeServiceOptions, it sends them to the associated
alk.layer.RoutingLayer
for a new Route, otherwise nothing is done. This method gives the ability to override this method in sub-classes.Name Type Description event
ol.interaction.Modify.Event -
processStyle(optStyle){ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction} inherited
-
This function assigns or creates the RoutingLayerStyle from 'style' option. If we don't understand the value, we just let it go, figuring that the caller knows what they are doing.
Name Type Description optStyle
alk.style.RoutingLayerStyle | alk.style.StrokeQueue | Array.<ol.style.Stroke> | ol.style.Stroke | ol.style.Style | Array.<ol.style.Style> | ol.StyleFunction | string | undefined -
setRoutingLayer(layer) inherited
-
This method sets the routing layer.
Name Type Description layer
alk.layer.RoutingLayer The routing layer
Fires:
-
change:routingLayer
- This event fires when the routing layer is updated.
-
-
shouldModify(coords, index, stopType){boolean}
-
This function decides whether a stop will be modifiable by this Route Modify, depending on coordinates, index, and stopType.
This implementation allows all WayPoints and ViaPoints, regardless.
Name Type Description coords
Array.<number> index
number stopType
alk.val.StopType | undefined