mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:27:08 +00:00
Make map API calls silent.
Otherwise we get spurious 404s and such.
This commit is contained in:
@@ -429,7 +429,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
async fitProjectBounds () {
|
async fitProjectBounds () {
|
||||||
const res = await this.api([`/project/${this.$route.params.project}/gis`]);
|
const res = await this.api([`/project/${this.$route.params.project}/gis`], {}, null, {silent:true});
|
||||||
const bbox = new L.GeoJSON(res);
|
const bbox = new L.GeoJSON(res);
|
||||||
map.fitBounds(bbox.getBounds());
|
map.fitBounds(bbox.getBounds());
|
||||||
},
|
},
|
||||||
@@ -437,7 +437,7 @@ export default {
|
|||||||
getEvents (ffn = i => true) {
|
getEvents (ffn = i => true) {
|
||||||
return async (success, error) => {
|
return async (success, error) => {
|
||||||
const url = `/project/${this.$route.params.project}/event`;
|
const url = `/project/${this.$route.params.project}/event`;
|
||||||
const data = await this.api([url, {headers: {"Accept": "application/geo+json"}}]);
|
const data = await this.api([url, {headers: {"Accept": "application/geo+json"}}, {}, null, {silent:true}]);
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
||||||
const colour = (feature) => {
|
const colour = (feature) => {
|
||||||
@@ -501,7 +501,7 @@ export default {
|
|||||||
|
|
||||||
// Firing all refresh events asynchronously, which is OK provided
|
// Firing all refresh events asynchronously, which is OK provided
|
||||||
// we don't have hundreds of layers to be refreshed.
|
// we don't have hundreds of layers to be refreshed.
|
||||||
this.api([url, init])
|
this.api([url, init, null, {silent:true}])
|
||||||
.then( (layer) => {
|
.then( (layer) => {
|
||||||
if (!layer) {
|
if (!layer) {
|
||||||
return;
|
return;
|
||||||
@@ -681,7 +681,7 @@ export default {
|
|||||||
async getLabelDefinitions () {
|
async getLabelDefinitions () {
|
||||||
const url = `/project/${this.$route.params.project}/label`;
|
const url = `/project/${this.$route.params.project}/label`;
|
||||||
|
|
||||||
this.labels = await this.api([url]) || [];
|
this.labels = await this.api([url, {}, null, {silent:true}]) || [];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
@@ -808,7 +808,7 @@ export default {
|
|||||||
|
|
||||||
async fetchUserLayers () {
|
async fetchUserLayers () {
|
||||||
const url = `/project/${this.$route.params.project}/gis/layer`;
|
const url = `/project/${this.$route.params.project}/gis/layer`;
|
||||||
const userLayers = await this.api([url]) || [];
|
const userLayers = await this.api([url, {}, null, {silent:true}]) || [];
|
||||||
|
|
||||||
this.removeUserLayers();
|
this.removeUserLayers();
|
||||||
this.addUserLayers(userLayers);
|
this.addUserLayers(userLayers);
|
||||||
|
|||||||
Reference in New Issue
Block a user