Skip to content

Commit fafa28d

Browse files
committed
Add MyTripToCanada view for animated journey visualization and enhance context menu item checks
Signed-off-by: makbn <[email protected]>
1 parent f7f7f06 commit fafa28d

File tree

3 files changed

+324
-16
lines changed

3 files changed

+324
-16
lines changed

jlmap-vaadin-demo/src/main/java/io/github/makbn/vaadin/demo/Application.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.github.makbn.vaadin.demo;
22

33
import com.vaadin.flow.component.page.AppShellConfigurator;
4+
import com.vaadin.flow.component.page.Push;
45
import com.vaadin.flow.router.PageTitle;
56
import com.vaadin.flow.theme.Theme;
67
import org.springframework.boot.SpringApplication;
@@ -13,6 +14,7 @@
1314
*
1415
* @author Matt Akbarian (@makbn)
1516
*/
17+
@Push
1618
@SpringBootApplication
1719
@PageTitle("JLMap Vaadin Demo")
1820
@Theme(value = "jlmap-vaadin-demo")

jlmap-vaadin-demo/src/main/java/io/github/makbn/vaadin/demo/views/HomeView.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
154154
circle.addContextMenu()
155155
.addItem("Remove", "Remove this circle")
156156
.setOnMenuItemListener(item -> {
157-
if ("remove".equals(item.getId())) {
157+
if ("Remove".equals(item.getId())) {
158158
circle.remove();
159159
Notification.show("Circle removed from map");
160160
}
@@ -184,7 +184,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
184184
circleMarker.addContextMenu()
185185
.addItem("Remove", "Remove this circle marker")
186186
.setOnMenuItemListener(item -> {
187-
if ("remove".equals(item.getId())) {
187+
if ("Remove".equals(item.getId())) {
188188
circleMarker.remove();
189189
Notification.show("Circle marker removed from map");
190190
}
@@ -198,7 +198,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
198198
polyline.addContextMenu()
199199
.addItem("Remove", "Remove this polyline")
200200
.setOnMenuItemListener(item -> {
201-
if ("remove".equals(item.getId())) {
201+
if ("Remove".equals(item.getId())) {
202202
polyline.remove();
203203
Notification.show("Polyline removed from map");
204204
}
@@ -214,7 +214,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
214214
polyline.addContextMenu()
215215
.addItem("Remove", "Remove this custom polyline")
216216
.setOnMenuItemListener(item -> {
217-
if ("remove".equals(item.getId())) {
217+
if ("Remove".equals(item.getId())) {
218218
polyline.remove();
219219
Notification.show("Custom polyline removed from map");
220220
}
@@ -228,7 +228,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
228228
multiPolyline.addContextMenu()
229229
.addItem("Remove", "Remove this multi-polyline")
230230
.setOnMenuItemListener(item -> {
231-
if ("remove".equals(item.getId())) {
231+
if ("Remove".equals(item.getId())) {
232232
multiPolyline.remove();
233233
Notification.show("Multi-polyline removed from map");
234234
}
@@ -263,7 +263,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
263263
polygon.addContextMenu()
264264
.addItem("Remove", "Remove this custom polygon")
265265
.setOnMenuItemListener(item -> {
266-
if ("remove".equals(item.getId())) {
266+
if ("Remove".equals(item.getId())) {
267267
polygon.remove();
268268
Notification.show("Custom polygon removed from map");
269269
}
@@ -277,7 +277,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
277277
donutPolygon.addContextMenu()
278278
.addItem("Remove", "Remove this donut polygon")
279279
.setOnMenuItemListener(item -> {
280-
if ("remove".equals(item.getId())) {
280+
if ("Remove".equals(item.getId())) {
281281
donutPolygon.remove();
282282
Notification.show("Donut polygon removed from map");
283283
}
@@ -290,7 +290,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
290290
demoCircle.addContextMenu()
291291
.addItem("Remove", "Remove demo circle")
292292
.setOnMenuItemListener(item -> {
293-
if ("remove".equals(item.getId())) {
293+
if ("Remove".equals(item.getId())) {
294294
demoCircle.remove();
295295
Notification.show("Demo circle removed from map");
296296
}
@@ -300,7 +300,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
300300
demoCircleMarker.addContextMenu()
301301
.addItem("Remove", "Remove demo circle marker")
302302
.setOnMenuItemListener(item -> {
303-
if ("remove".equals(item.getId())) {
303+
if ("Remove".equals(item.getId())) {
304304
demoCircleMarker.remove();
305305
Notification.show("Demo circle marker removed from map");
306306
}
@@ -311,7 +311,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
311311
demoPolyline.addContextMenu()
312312
.addItem("Remove", "Remove demo polyline")
313313
.setOnMenuItemListener(item -> {
314-
if ("remove".equals(item.getId())) {
314+
if ("Remove".equals(item.getId())) {
315315
demoPolyline.remove();
316316
Notification.show("Demo polyline removed from map");
317317
}
@@ -322,7 +322,7 @@ private void addVectorSection(VerticalLayout menuContent, BiFunction<String, But
322322
demoPolygon.addContextMenu()
323323
.addItem("Remove", "Remove demo polygon")
324324
.setOnMenuItemListener(item -> {
325-
if ("remove".equals(item.getId())) {
325+
if ("Remove".equals(item.getId())) {
326326
demoPolygon.remove();
327327
Notification.show("Demo polygon removed from map");
328328
}
@@ -346,7 +346,7 @@ private void addGeoJsonSection(VerticalLayout menuContent, BiFunction<String, Bu
346346
geoJson.addContextMenu()
347347
.addItem("Remove", "Remove this GeoJSON layer")
348348
.setOnMenuItemListener(item -> {
349-
if ("remove".equals(item.getId())) {
349+
if ("Remove".equals(item.getId())) {
350350
geoJson.remove();
351351
Notification.show("GeoJSON layer removed from map");
352352
}
@@ -362,7 +362,7 @@ private void addGeoJsonSection(VerticalLayout menuContent, BiFunction<String, Bu
362362
usOutlineGeoJson.addContextMenu()
363363
.addItem("Remove", "Remove US outline GeoJSON")
364364
.setOnMenuItemListener(item -> {
365-
if ("remove".equals(item.getId())) {
365+
if ("Remove".equals(item.getId())) {
366366
usOutlineGeoJson.remove();
367367
Notification.show("US outline GeoJSON removed from map");
368368
}
@@ -422,7 +422,7 @@ private void loadStyledGeoJson(Map<String, Object> event) {
422422
geoJson.addContextMenu()
423423
.addItem("Remove", "Remove styled GeoJSON layer")
424424
.setOnMenuItemListener(item -> {
425-
if ("remove".equals(item.getId())) {
425+
if ("Remove".equals(item.getId())) {
426426
geoJson.remove();
427427
Notification.show("Styled GeoJSON layer removed from map");
428428
}
@@ -460,7 +460,7 @@ private void addUiSection(VerticalLayout menuContent, BiFunction<String, Button[
460460
marker.addContextMenu()
461461
.addItem("Remove", "Remove this marker")
462462
.setOnMenuItemListener(item -> {
463-
if ("remove".equals(item.getId())) {
463+
if ("Remove".equals(item.getId())) {
464464
marker.remove();
465465
Notification.show("Marker removed from map");
466466
}
@@ -484,7 +484,7 @@ private void addUiSection(VerticalLayout menuContent, BiFunction<String, Button[
484484
imageOverlay.addContextMenu()
485485
.addItem("Remove", "Remove Eiffel Tower overlay")
486486
.setOnMenuItemListener(item -> {
487-
if ("remove".equals(item.getId())) {
487+
if ("Remove".equals(item.getId())) {
488488
imageOverlay.remove();
489489
Notification.show("Eiffel Tower overlay removed from map");
490490
}

0 commit comments

Comments
 (0)