File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2410,7 +2410,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
2410
2410
*
2411
2411
*/
2412
2412
updateSource ( id : string , options : UpdateSourceOptions , nativeMap ?) {
2413
- return new Promise ( ( resolve , reject ) => {
2413
+ return new Promise < void > ( ( resolve , reject ) => {
2414
2414
try {
2415
2415
const theMap : com . mapbox . mapboxsdk . maps . MapboxMap = nativeMap || this . _mapboxMapInstance ;
2416
2416
if ( ! theMap ) {
@@ -2427,6 +2427,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
2427
2427
case 'geojson' :
2428
2428
const geoJsonString = JSON . stringify ( options . data ) ;
2429
2429
( source as com . mapbox . mapboxsdk . style . sources . GeoJsonSource ) . setGeoJson ( geoJsonString ) ;
2430
+ resolve ( ) ;
2430
2431
break ;
2431
2432
default :
2432
2433
reject ( 'Invalid source type: ' + options [ 'type' ] ) ;
Original file line number Diff line number Diff line change @@ -2663,7 +2663,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
2663
2663
*
2664
2664
*/
2665
2665
updateSource ( id : string , options : UpdateSourceOptions , nativeMap ?) {
2666
- return new Promise ( ( resolve , reject ) => {
2666
+ return new Promise < void > ( ( resolve , reject ) => {
2667
2667
try {
2668
2668
const theMap : MGLMapView = nativeMap || this . _mapboxViewInstance ;
2669
2669
if ( ! theMap ) {
@@ -2682,6 +2682,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
2682
2682
const nsData : NSData = content . dataUsingEncoding ( NSUTF8StringEncoding ) ;
2683
2683
const geoJsonShape = MGLShape . shapeWithDataEncodingError ( nsData , NSUTF8StringEncoding ) ;
2684
2684
( source as MGLShapeSource ) . shape = geoJsonShape ;
2685
+ resolve ( ) ;
2685
2686
break ;
2686
2687
default :
2687
2688
reject ( 'Invalid source type: ' + options [ 'type' ] ) ;
You can’t perform that action at this time.
0 commit comments