/** * Send a {@link io.mapsquare.osmcontributor.core.events.PoiForEditionLoadedEvent} containing the * suggestions for the PoiTypeTags and a new Poi to complete. * * @param event Event containing the position, level and PoiType of the Poi to create. */ private void loadPoiForCreation(PleaseLoadPoiForCreationEvent event) { Poi poi = new Poi(); Set<Double> level = new HashSet<>(); level.add(event.getLevel()); poi.setLevel(level); poi.setLatitude(event.getLat()); poi.setLongitude(event.getLng()); poi.setType(poiTypeDao.queryForId(event.getPoiType())); Map<String, String> defaultTags = new HashMap<>(); for (PoiTypeTag poiTypeTag : poi.getType().getTags()) { if (poiTypeTag.getValue() != null) { // default tags should be set in the corresponding POI defaultTags.put(poiTypeTag.getKey(), poiTypeTag.getValue()); } } poi.applyChanges(defaultTags); bus.post(new PoiForEditionLoadedEvent(poi, suggestionsForTagsValue(poi.getType().getTags()))); }