Skip to content

Commit

Permalink
Merge commit '227e46a596b9b3ec5afb975092e63288396f3f80'
Browse files Browse the repository at this point in the history
* commit '227e46a596b9b3ec5afb975092e63288396f3f80':
  Update package.json
  Update package.json
  ~>5.9.0 is the equivalent for ~>5.8 dep we've used before
  Make errors during remove source a warning rather than a hard error
  Update LICENSE.md
  Update install.md for ios: Mapbox Maps SDK (rnmapbox#1106)
  Prevent emitting log events without listeners
  increase node version 10.XX.1 => 14.15.0 (rnmapbox#1100)
  Remove flow dependency (rnmapbox#1101)
  Update all development npm dependencies (2020-11-06) (rnmapbox#1098)
  Update all development npm dependencies (2020-10-05) (rnmapbox#1056)
  • Loading branch information
jaysquared committed Dec 9, 2020
2 parents ec74703 + 227e46a commit 16535f0
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
v10.18.1
v14.15.0

5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ matrix:
- language: android
jdk: oraclejdk8
before_install:
- nvm install 10.22.1
- echo yes | sdkmanager "platforms;android-28"
- nvm install $(cat .nvmrc)
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.21.1
- export PATH=$HOME/.yarn/bin:$PATH
android:
Expand All @@ -26,7 +26,6 @@ matrix:
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
- os: osx
osx_image: xcode12.2
node_js: 10.22.1
cache:
bundler: true
yarn: true
Expand All @@ -39,7 +38,7 @@ matrix:
- brew cleanup
podfile: example/ios/Podfile
before_install:
- nvm use 10.22.1
- nvm install $(cat .nvmrc)
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.21.1
- export PATH=$HOME/.yarn/bin:$PATH
install:
Expand Down
24 changes: 3 additions & 21 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
react-native-mapbox-gl copyright (c) 2017, Mapbox.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Mapbox GL uses portions of the Mapbox Maps SDK for iOS, which was derived from the Route-Me open source project, including the Alpstein fork of it.

The Route-Me license appears below.

Copyright (c) 2008-2013, Route-Me Contributors All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.facebook.react.common.MapBuilder;
import com.mapbox.geojson.Feature;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.log.Logger;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.Style;
import com.mapbox.mapboxsdk.style.sources.Source;
Expand All @@ -28,6 +29,7 @@

public abstract class RCTSource<T extends Source> extends AbstractMapFeature {
public static final String DEFAULT_ID = "composite";
public static final String LOG_TAG = "RCTSource";

public static final double DEFAULT_HITBOX_WIDTH = 44.0;
public static final double DEFAULT_HITBOX_HEIGHT = 44.0;
Expand Down Expand Up @@ -155,7 +157,11 @@ public void removeFromMap(RCTMGLMapView mapView) {
mQueuedLayers.clear();
}
if (mMap != null && mSource != null && mMap.getStyle() != null) {
mMap.getStyle().removeSource(mSource);
try {
mMap.getStyle().removeSource(mSource);
} catch (Throwable ex) {
Logger.w(LOG_TAG, String.format("RCTSource.removeFromMap: %s - %s", mSource, ex.getMessage()), ex);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions example/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
v14.15.0

18 changes: 18 additions & 0 deletions ios/RCTMGL/RCTMGLLogging.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

@import Mapbox;

@interface RCTMGLLogging()
@property (nonatomic) BOOL hasListeners;
@end

@implementation RCTMGLLogging

+ (id)allocWithZone:(NSZone *)zone {
Expand Down Expand Up @@ -37,8 +41,22 @@ + (BOOL)requiresMainQueueSetup
return @[@"LogEvent"];
}

- (void)startObserving
{
[super startObserving];
self.hasListeners = true;
}

- (void)stopObserving
{
[super stopObserving];
self.hasListeners = false;
}

- (void)sendLogWithLevel:(MGLLoggingLevel)loggingLevel filePath:(NSString*)filePath line:(NSUInteger)line message:(NSString*)message
{
if (!self.hasListeners) return;

NSString* level = @"n/a";
switch (loggingLevel) {
case MGLLoggingLevelInfo:
Expand Down
16 changes: 16 additions & 0 deletions ios/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,20 @@ Mapbox normally [requires](https://github.com/mapbox/mapbox-gl-native-ios/issues

```

## Mapbox Maps SDK

It is possible to set a custom version of the Mapbox SDK:

### New version - since `8.1rc5`

Add the following to you `ios/Podfile`:

```ruby
$ReactNativeMapboxGLIOSVersion = '~> 6.1'
```

Check the current version of the SDK [here](https://docs.mapbox.com/ios/maps/overview/).

### Mapbox Maps SDK > `v6.0.0`

If you are using version `v6.0.0` of the SDK or later, you will need to authorize your download of the Maps SDK with a secret access token with the `DOWNLOADS:READ` scope. This [guide](https://docs.mapbox.com/ios/maps/overview/#install-the-sdk) explains how to configure the secret token under section `Configure your secret token`.
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@react-native-mapbox-gl/maps",
"description": "A Mapbox GL react native module for creating custom maps",
"version": "8.1.0-rc.9",
"version": "8.1.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -47,19 +47,17 @@
"@babel/core": "7.5.0",
"@babel/plugin-proposal-class-properties": "7.10.4",
"@babel/plugin-transform-exponentiation-operator": "7.10.4",
"@babel/plugin-transform-flow-strip-types": "7.10.4",
"@babel/plugin-transform-runtime": "7.11.5",
"@babel/runtime": "7.11.2",
"babel-core": "6.26.3",
"babel-eslint": "^10.0.1",
"documentation": "13.0.2",
"documentation": "13.1.0",
"ejs": "^3.1.3",
"ejs-lint": "^1.1.0",
"eslint": "^7.3.0",
"@react-native-community/eslint-config": "^2.0.0",
"eslint-plugin-fp": "^2.3.0",
"eslint-plugin-import": "2.22.0",
"flow-bin": "^0.134.0",
"eslint-plugin-import": "2.22.1",
"husky": "4.3.0",
"jest": "25.5.4",
"@sinonjs/fake-timers": "^6.0.0",
Expand All @@ -70,7 +68,7 @@
"react": "16.8.6",
"react-docgen": "^5.0.0-beta.1",
"react-native": "0.59.10",
"typescript": "4.0.3",
"typescript": "4.0.5",
"react-native-testing-library": "^6.0.0",
"react-test-renderer": "16.8.3",
"prettier": "^2.0.4"
Expand Down
2 changes: 1 addition & 1 deletion react-native-mapbox-gl.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

default_ios_mapbox_version = '~> 5.8.0'
default_ios_mapbox_version = '~> 5.9.0'
rnmbgl_ios_version = $ReactNativeMapboxGLIOSVersion || ENV["REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION"] || default_ios_mapbox_version
if ENV.has_key?("REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION")
puts "REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION env is deprecated please use `$ReactNativeMapboxGLIOSVersion = \"#{rnmbgl_ios_version}\"`"
Expand Down

0 comments on commit 16535f0

Please sign in to comment.