Skip to content

Commit 5e67894

Browse files
committed
added image example to HomeView
Signed-off-by: makbn <[email protected]>
1 parent 89c0a7e commit 5e67894

File tree

1 file changed

+17
-1
lines changed
  • jlmap-vaadin-demo/src/main/java/io/github/makbn/vaadin/demo/views

1 file changed

+17
-1
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,23 @@ private void addUiSection(VerticalLayout menuContent, BiFunction<String, Button[
253253
}));
254254

255255
addMarker.setClassName(MENU_ITEM_CLASS);
256-
menuContent.add(section.apply("UI Layer", new Button[]{addMarker}));
256+
257+
// --- Add Eiffel Tower Overlay Button ---
258+
Button addEiffelOverlay = new Button("Add Eiffel Tower Overlay", e -> {
259+
// Eiffel Tower location in Paris
260+
double swLat = 47.857, swLng = 3.293; // Southwest corner
261+
double neLat = 49.860, neLng = 1.298; // Northeast corner
262+
JLBounds bounds = JLBounds.builder()
263+
.southWest(new JLLatLng(swLat, swLng))
264+
.northEast(new JLLatLng(neLat, neLng))
265+
.build();
266+
String imageUrl = "https://img.favpng.com/1/24/8/eiffel-tower-eiffel-tower-illustrated-landmark-L5szYqrZ_t.jpg";
267+
mapView.getUiLayer().addImage(bounds, imageUrl, JLOptions.DEFAULT);
268+
Notification.show("Eiffel Tower overlay added!");
269+
});
270+
addEiffelOverlay.setClassName(MENU_ITEM_CLASS);
271+
272+
menuContent.add(section.apply("UI Layer", new Button[]{addMarker, addEiffelOverlay}));
257273
}
258274

259275
private void addCpntrolSection(VerticalLayout menuContent, BiFunction<String, Button[], VerticalLayout> section) {

0 commit comments

Comments
 (0)