Works better after upload complete

This commit is contained in:
Edward Betts 2021-07-19 22:11:01 +02:00
parent 19a9010aa7
commit 96379c871b

View file

@ -21,7 +21,7 @@
Found {{ this.item_count.toLocaleString('en-US') }} Wikidata items.<br/> Zoom in to see them. Found {{ this.item_count.toLocaleString('en-US') }} Wikidata items.<br/> Zoom in to see them.
</div> </div>
<div id="edit-count" class="p-2" v-if="upload_state === undefined && edits.length"> <div id="edit-count" class="p-2" v-if="!upload_state && edits.length">
<span>edits: {{ edits.length }}</span> <span>edits: {{ edits.length }}</span>
<button class="btn btn-primary btn-sm ms-2" @click="close_item(); view_edits=true"> <button class="btn btn-primary btn-sm ms-2" @click="close_item(); view_edits=true">
<i class="fa fa-upload"></i> save <i class="fa fa-upload"></i> save
@ -865,6 +865,14 @@ export default {
osm['wikidata'] = item.qid; osm['wikidata'] = item.qid;
item.osm[identifier] = osm; item.osm[identifier] = osm;
this.add_osm_to_map(item, osm); this.add_osm_to_map(item, osm);
item.lines ||= [];
item.wikidata.markers.forEach((marker_data) => {
var path = [osm.centroid, marker_data];
var polyline = L.polyline(path, { color: "green" });
polyline.addTo(item.group);
item.lines.push(polyline);
});
} }
}); });
@ -1103,9 +1111,10 @@ export default {
history.replaceState(state, '', this.build_map_path()); history.replaceState(state, '', this.build_map_path());
}, },
open_item(qid) { open_item(qid) {
close_edit_list();
var item = this.items[qid]; var item = this.items[qid];
if (this.current_item == item) return; // already open if (this.current_item == item) return; // already open
this.view_edits = false;
this.current_osm = undefined; this.current_osm = undefined;
this.current_item = item; this.current_item = item;
@ -1413,8 +1422,8 @@ export default {
Object.values(item.osm).forEach((osm) => { Object.values(item.osm).forEach((osm) => {
var path = [osm.centroid, marker_data]; var path = [osm.centroid, marker_data];
var polyline = L.polyline(path, { color: "green" }); var polyline = L.polyline(path, { color: "green" });
polyline.addTo(item.group) polyline.addTo(item.group);
this.items[qid].lines.push(polyline); item.lines.push(polyline);
}); });
}); });
} }