Class WLeafletMap.WidgetMarker
- Enclosing class:
- WLeafletMap
This can be used to place arbitrary widgets on the map.
The widgets will stay the same size regardless of the zoom level of the map.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData -
Constructor Summary
ConstructorsConstructorDescriptionWidgetMarker(WLeafletMap.Coordinate pos, WWidget widget) Create a newWLeafletMap.WidgetMarkerat the given position with the given widget. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateItemJS(StringBuilder ss, StringBuilder postJS, long id) Writes the JS code to create this item to the stream.Get the widget.protected booleanReturn whether this item needs to be updated.voidsetAnchorPoint(double x, double y) Set the anchor point of the marker.protected voidsetMap(WLeafletMap map) Set the map this item belongs to.protected voidunrender()Unrender the item.protected voidupdate(StringBuilder js) Writes the JS to update this item to the stream.Methods inherited from class eu.webtoolkit.jwt.WLeafletMap.Marker
addPopup, addTooltip, getPopup, getRemovePopup, getRemoveTooltip, getTooltipMethods inherited from class eu.webtoolkit.jwt.WLeafletMap.AbstractMapItem
clicked, doubleClicked, getMap, getPosition, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, moveMethods inherited from class eu.webtoolkit.jwt.WObject
getId, getObjectName, remove, setFormData, setObjectName, tr
-
Constructor Details
-
WidgetMarker
Create a newWLeafletMap.WidgetMarkerat the given position with the given widget.
-
-
Method Details
-
getWidget
Get the widget. -
setAnchorPoint
public void setAnchorPoint(double x, double y) Set the anchor point of the marker.This determines the "tip" of the marker (relative to its top left corner). The marker will be aligned so that this point is at the marker's geographical location.
If x is negative, the anchor point is in the horizontal center of the widget. If y is negative, the anchor point is in the vertical center of the widget.
By default the anchor point is in the middle (horizontal and vertical center).
-
setMap
Description copied from class:WLeafletMap.AbstractMapItemSet the map this item belongs to.This is called to set the map the item belongs to. You can override this function if you need to do something when the item is added to a map.
You should not call this function directly.
- Overrides:
setMapin classWLeafletMap.Marker- See Also:
-
createItemJS
Description copied from class:WLeafletMap.AbstractMapItemWrites the JS code to create this item to the stream.This method should write in
ssthe JS code that creates the item. ThepostJSstream can be used to write JS code that should be executed after the item has been created.- Specified by:
createItemJSin classWLeafletMap.AbstractMapItem
-
unrender
protected void unrender()Description copied from class:WLeafletMap.AbstractMapItemUnrender the item.This is called when the map needs to be recreated. You can override this function in case you need to do some cleanup before the map is recreated.
By default, this does nothing.
- Overrides:
unrenderin classWLeafletMap.AbstractMapItem- See Also:
-
needsUpdate
protected boolean needsUpdate()Description copied from class:WLeafletMap.AbstractMapItemReturn whether this item needs to be updated.This is called when the map is rendered. If this returns true,
update()will be used to update the item.- Overrides:
needsUpdatein classWLeafletMap.AbstractMapItem
-
update
Description copied from class:WLeafletMap.AbstractMapItemWrites the JS to update this item to the stream.This is called when the map is rendered if
needsUpdate()returns true.- Overrides:
updatein classWLeafletMap.AbstractMapItem
-