_updateSource(map, update) {
    const newSource = update.source.toJS();
    if (newSource.type === 'geojson') {
      const oldSource = map.getSource(update.id);
      if (oldSource.type === 'geojson') {
        // update data if no other GeoJSONSource options were changed
        const oldOpts = oldSource.workerOptions;
        if (
          (newSource.maxzoom === undefined ||
            newSource.maxzoom === oldOpts.geojsonVtOptions.maxZoom) &&
          (newSource.buffer === undefined ||
            newSource.buffer === oldOpts.geojsonVtOptions.buffer) &&
          (newSource.tolerance === undefined ||
            newSource.tolerance === oldOpts.geojsonVtOptions.tolerance) &&
          (newSource.cluster === undefined ||
            newSource.cluster === oldOpts.cluster) &&
          (newSource.clusterRadius === undefined ||
            newSource.clusterRadius === oldOpts.superclusterOptions.radius) &&
          (newSource.clusterMaxZoom === undefined ||
            newSource.clusterMaxZoom === oldOpts.superclusterOptions.maxZoom)
        ) {
          oldSource.setData(newSource.data);
          return;
        }
      }
    }

    map.removeSource(update.id);
    map.addSource(update.id, newSource);
  }
// Update a source in the map style
Update a source in the map style
Update a source in the map style
_updateSource(map, update) {
    const newSource = update.source.toJS();
    if (newSource.type === 'geojson') {
      const oldSource = map.getSource(update.id);
      if (oldSource.type === 'geojson') {
        const oldOpts = oldSource.workerOptions;
        if (
          (newSource.maxzoom === undefined ||
            newSource.maxzoom === oldOpts.geojsonVtOptions.maxZoom) &&
          (newSource.buffer === undefined ||
            newSource.buffer === oldOpts.geojsonVtOptions.buffer) &&
          (newSource.tolerance === undefined ||
            newSource.tolerance === oldOpts.geojsonVtOptions.tolerance) &&
          (newSource.cluster === undefined ||
            newSource.cluster === oldOpts.cluster) &&
          (newSource.clusterRadius === undefined ||
            newSource.clusterRadius === oldOpts.superclusterOptions.radius) &&
          (newSource.clusterMaxZoom === undefined ||
            newSource.clusterMaxZoom === oldOpts.superclusterOptions.maxZoom)
        ) {
          oldSource.setData(newSource.data);
          return;
        }
      }
    }
    map.removeSource(update.id);
    map.addSource(update.id, newSource);
  }
_updateSource ( map , update ) { const newSource = update . source . toJS ( ) ; if ( newSource . type === 'geojson' ) { const oldSource = map . getSource ( update . id ) ; if ( oldSource . type === 'geojson' ) { const oldOpts = oldSource . workerOptions ; if ( ( newSource . maxzoom === undefined || newSource . maxzoom === oldOpts . geojsonVtOptions . maxZoom ) && ( newSource . buffer === undefined || newSource . buffer === oldOpts . geojsonVtOptions . buffer ) && ( newSource . tolerance === undefined || newSource . tolerance === oldOpts . geojsonVtOptions . tolerance ) && ( newSource . cluster === undefined || newSource . cluster === oldOpts . cluster ) && ( newSource . clusterRadius === undefined || newSource . clusterRadius === oldOpts . superclusterOptions . radius ) && ( newSource . clusterMaxZoom === undefined || newSource . clusterMaxZoom === oldOpts . superclusterOptions . maxZoom ) ) { oldSource . setData ( newSource . data ) ; return ; } } } map . removeSource ( update . id ) ; map . addSource ( update . id , newSource ) ; }
Update a source in the map style
Update a source in the map style
// update data if no other GeoJSONSource options were changed