13
13
import com .vaadin .flow .component .orderedlayout .VerticalLayout ;
14
14
import com .vaadin .flow .router .Route ;
15
15
16
- import com .vaadin .flow .router .RouteAlias ;
17
16
import software .xdev .vaadin .maps .leaflet .flow .LMap ;
18
17
import software .xdev .vaadin .maps .leaflet .flow .data .LCenter ;
19
18
import software .xdev .vaadin .maps .leaflet .flow .data .LCircle ;
@@ -35,7 +34,6 @@ public class LeafletView extends VerticalLayout
35
34
* UI-Components
36
35
*/
37
36
private final Button btnLunch = new Button ("Where do XDEV employees go for lunch?" );
38
- private final Button btnCenter = new Button ("Center on Caribbean" );
39
37
private LMap map ;
40
38
41
39
private LMarker markerZob ;
@@ -61,7 +59,9 @@ public LeafletView()
61
59
hlButtonContainer .setSpacing (false );
62
60
hlButtonContainer .add (
63
61
this .btnLunch ,
64
- this .btnCenter ,
62
+ new Button ("Center on Caribbean" , e -> this .map .centerAndZoom (
63
+ new LPoint (14.467727 , -61.69703 ),
64
+ new LPoint (16.33426 , -60.921676 ))),
65
65
new Button ("Open dialog over map" , ev ->
66
66
{
67
67
final Icon icoClose = VaadinIcon .CLOSE .create ();
@@ -73,7 +73,6 @@ public LeafletView()
73
73
74
74
icoClose .addClickListener (iev -> dialog .close ());
75
75
}));
76
- this .btnCenter .addClickListener (e -> map .centerAndZoom (new LPoint (14.467727 , -61.69703 ), new LPoint (16.33426 ,-60.921676 )));
77
76
this .add (this .map , hlButtonContainer );
78
77
this .setSizeFull ();
79
78
}
@@ -106,29 +105,33 @@ private void initMapComponents()
106
105
107
106
final LMarker markerXDev = new LMarker (49.675806677512824 , 12.160990185846394 );
108
107
final LIcon xDevLogo = new LIcon (
109
- // Important replace # with %23!
110
- "data:image/svg+xml;utf8,<svg xmlns=\" http://www.w3.org/2000/svg\" width=\" 1000\" height=\" 200\" viewBox=\" 0 0 18300 4500\" style=\" background-color:rgba(180,180,180,0.7)\" >\n "
111
- + " <defs>\n "
112
- + " <style>\n "
113
- + " .fil0{fill:%23d71e23}\n "
114
- + " </style>\n "
115
- + " </defs>\n "
116
- + " <g>\n "
117
- + " <path class=\" fil0\" d=\" M9763 10965h-920l-17-6-1503-588-1506 588-11 4-13 2-1562 148-1102 105 1064-369 2311-801-1638-633-683-263h1609l16 6 1515 588 1521-588 10-4 9-1 1388-211 1177-178-1131 441-2177 849 1675 647 682 264zM25514 9520l-1909 1442-22 17h-693l-23-19-1765-1440-285-233h907l22 17 1490 1178 1395-1177 23-19h1171zM20426 10961h-4015V9260h4126l-1 127-1 99v126h-112l-3041-3 2 322 3038 3h110l2 124 1 83 2 128h-3146v352l3035-6h112v346z\" transform=\" translate(-5400 -7700)\" />\n "
118
- + " <path class=\" fil0\" d=\" M10994 9275h2026a12150 12150 0 0 1 1368 73c292 35 559 83 798 143h1c290 73 510 158 659 254 165 106 248 229 248 368 0 134-85 254-254 359-151 94-375 180-672 256-292 76-618 132-977 170-359 37-751 56-1174 56h-2102V9275h79zm917 1354h1106c300 0 574-14 822-41 247-27 469-67 665-121h1a2470 2470 0 0 0 277-96c176-79 264-164 264-256 0-60-39-118-117-173-92-66-234-125-425-178-197-55-418-96-665-123-248-27-522-41-822-41h-1106v1029z\" transform=\" translate(-5400 -7700)\" />\n "
119
- + " </g>\n "
120
- + "</svg>" );
108
+ """
109
+ data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="200" viewBox="0 0 18300 4500" style="background-color:rgba(180,180,180,0.7)">
110
+ <defs>
111
+ <style>
112
+ .fil0{fill:%23d71e23}
113
+ </style>
114
+ </defs>
115
+ <g>
116
+ <path class="fil0" d="M9763 10965h-920l-17-6-1503-588-1506 588-11 4-13 2-1562 148-1102 105 1064-369 2311-801-1638-633-683-263h1609l16 6 1515 588 1521-588 10-4 9-1 1388-211 1177-178-1131 441-2177 849 1675 647 682 264zM25514 9520l-1909 1442-22 17h-693l-23-19-1765-1440-285-233h907l22 17 1490 1178 1395-1177 23-19h1171zM20426 10961h-4015V9260h4126l-1 127-1 99v126h-112l-3041-3 2 322 3038 3h110l2 124 1 83 2 128h-3146v352l3035-6h112v346z" transform="translate(-5400 -7700)"/>
117
+ <path class="fil0" d="M10994 9275h2026a12150 12150 0 0 1 1368 73c292 35 559 83 798 143h1c290 73 510 158 659 254 165 106 248 229 248 368 0 134-85 254-254 359-151 94-375 180-672 256-292 76-618 132-977 170-359 37-751 56-1174 56h-2102V9275h79zm917 1354h1106c300 0 574-14 822-41 247-27 469-67 665-121h1a2470 2470 0 0 0 277-96c176-79 264-164 264-256 0-60-39-118-117-173-92-66-234-125-425-178-197-55-418-96-665-123-248-27-522-41-822-41h-1106v1029z" transform="translate(-5400 -7700)"/>
118
+ </g>
119
+ </svg>
120
+ """ );
121
121
122
122
xDevLogo .setIconSize (100 , 20 );
123
123
xDevLogo .setIconAnchor (50 , 0 );
124
- markerXDev .setPopup ("<a href='https://xdev.software/en' target='" + AnchorTarget .BLANK .getValue () + "'>XDEV Software GmbH</a>" );
124
+ markerXDev .setPopup (
125
+ "<a href='https://xdev.software/en' target='" + AnchorTarget .BLANK .getValue () + "'>XDEV Software "
126
+ + "GmbH</a>" );
125
127
markerXDev .setIcon (xDevLogo );
126
128
127
129
final LMarker markerInfo = new LMarker (49.674095 , 12.162257 );
128
- final LDivIcon div = new LDivIcon (
129
- "<p><center><b>Welcome to Weiden in der Oberpfalz!</b></center></p><p>This demo shows you different markers,<br> popups, polygons and other stuff</p>" );
130
130
131
- markerInfo .setDivIcon (div );
131
+ markerInfo .setDivIcon (new LDivIcon ("""
132
+ <p><center><b>Welcome to Weiden in der Oberpfalz!</b></center></p>
133
+ <p>This demo shows you different markers,<br> popups, polygons and other stuff</p>
134
+ """ ));
132
135
133
136
final LPolygon polygonNoc = new LPolygon (
134
137
Arrays .asList (
0 commit comments