Package eu.webtoolkit.jwt
Class WLeafletMap.WidgetMarker
java.lang.Object
eu.webtoolkit.jwt.WLeafletMap.Marker
eu.webtoolkit.jwt.WLeafletMap.WidgetMarker
- Enclosing class:
- WLeafletMap
public static class WLeafletMap.WidgetMarker extends WLeafletMap.Marker
A marker rendered with a widget.
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.
-
Constructor Summary
Constructors Constructor Description WidgetMarker(WLeafletMap.Coordinate pos, WWidget widget)
Create a newWLeafletMap.WidgetMarker
at the given position with the given widget. -
Method Summary
Modifier and Type Method Description protected void
createMarkerJS(java.lang.StringBuilder ss, java.lang.StringBuilder postJS)
WWidget
getWidget()
Get the widget.protected boolean
needsUpdate()
void
setAnchorPoint(double x, double y)
Set the anchor point of the marker.protected void
setMap(WLeafletMap map)
protected void
unrender()
protected void
update(java.lang.StringBuilder js)
Methods inherited from class eu.webtoolkit.jwt.WLeafletMap.Marker
getMap, getPosition, move
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WidgetMarker
Create a newWLeafletMap.WidgetMarker
at 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
- Overrides:
setMap
in classWLeafletMap.Marker
-
createMarkerJS
protected void createMarkerJS(java.lang.StringBuilder ss, java.lang.StringBuilder postJS)- Specified by:
createMarkerJS
in classWLeafletMap.Marker
-
unrender
protected void unrender()- Overrides:
unrender
in classWLeafletMap.Marker
-
needsUpdate
protected boolean needsUpdate()- Overrides:
needsUpdate
in classWLeafletMap.Marker
-
update
protected void update(java.lang.StringBuilder js)- Overrides:
update
in classWLeafletMap.Marker
-