本文整理匯總了Java中org.vaadin.addon.leaflet.LMarker類的典型用法代碼示例。如果您正苦於以下問題:Java LMarker類的具體用法?Java LMarker怎麽用?Java LMarker使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LMarker類屬於org.vaadin.addon.leaflet包,在下文中一共展示了LMarker類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: enter
import org.vaadin.addon.leaflet.LMarker; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
worldMap.removeAllComponents();
LOpenStreetMapLayer osm = new LOpenStreetMapLayer();
osm.setDetectRetina(true);
worldMap.addComponent(osm);
for (final Customer customer : service.findAll()) {
if(customer.getLocation() != null) {
LMarker marker = new LMarker(customer.getLocation());
marker.addClickListener(new LeafletClickListener() {
@Override
public void onClick(LeafletClickEvent event) {
Notification.show(
"Customer: " + customer.getFirstName() + " " + customer.
getLastName());
}
});
worldMap.addComponent(marker);
}
}
worldMap.zoomToContent();
}