1313import com .vaadin .flow .component .orderedlayout .VerticalLayout ;
1414import com .vaadin .flow .router .Route ;
1515
16- import com .vaadin .flow .router .RouteAlias ;
1716import software .xdev .vaadin .maps .leaflet .flow .LMap ;
1817import software .xdev .vaadin .maps .leaflet .flow .data .LCenter ;
1918import software .xdev .vaadin .maps .leaflet .flow .data .LCircle ;
@@ -35,7 +34,6 @@ public class LeafletView extends VerticalLayout
3534 * UI-Components
3635 */
3736 private final Button btnLunch = new Button ("Where do XDEV employees go for lunch?" );
38- private final Button btnCenter = new Button ("Center on Caribbean" );
3937 private LMap map ;
4038
4139 private LMarker markerZob ;
@@ -61,7 +59,9 @@ public LeafletView()
6159 hlButtonContainer .setSpacing (false );
6260 hlButtonContainer .add (
6361 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 ))),
6565 new Button ("Open dialog over map" , ev ->
6666 {
6767 final Icon icoClose = VaadinIcon .CLOSE .create ();
@@ -73,7 +73,6 @@ public LeafletView()
7373
7474 icoClose .addClickListener (iev -> dialog .close ());
7575 }));
76- this .btnCenter .addClickListener (e -> map .centerAndZoom (new LPoint (14.467727 , -61.69703 ), new LPoint (16.33426 ,-60.921676 )));
7776 this .add (this .map , hlButtonContainer );
7877 this .setSizeFull ();
7978 }
@@ -106,29 +105,33 @@ private void initMapComponents()
106105
107106 final LMarker markerXDev = new LMarker (49.675806677512824 , 12.160990185846394 );
108107 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+ """ );
121121
122122 xDevLogo .setIconSize (100 , 20 );
123123 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>" );
125127 markerXDev .setIcon (xDevLogo );
126128
127129 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>" );
130130
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+ """ ));
132135
133136 final LPolygon polygonNoc = new LPolygon (
134137 Arrays .asList (
0 commit comments