@rnmapbox/maps 10.0.0-beta.60 → 10.0.0-beta.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/rctmgl/build.gradle +1 -1
- package/android/rctmgl/src/main/java-mapboxgl/common/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java +0 -55
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.kt +2 -1
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java +0 -55
- package/index.d.ts +7 -0
- package/ios/RCTMGL/RCTMGLStyle.h +0 -5
- package/ios/RCTMGL/RCTMGLStyle.m +0 -35
- package/ios/RCTMGL-v10/MGLModule.swift +1 -0
- package/ios/RCTMGL-v10/RCTMGLAtmosphere.swift +3 -2
- package/ios/RCTMGL-v10/RCTMGLCircleLayer.swift +3 -3
- package/ios/RCTMGL-v10/RCTMGLEvent.swift +1 -0
- package/ios/RCTMGL-v10/RCTMGLFillExtrustionLayer.swift +4 -4
- package/ios/RCTMGL-v10/RCTMGLFillLayer.swift +4 -3
- package/ios/RCTMGL-v10/RCTMGLHeatmapLayer.swift +5 -4
- package/ios/RCTMGL-v10/RCTMGLLocationModule.swift +4 -2
- package/ios/RCTMGL-v10/RCTMGLMapView.swift +27 -2
- package/ios/RCTMGL-v10/RCTMGLRasterLayer.swift +3 -2
- package/ios/RCTMGL-v10/RCTMGLStyle.swift +0 -35
- package/ios/RCTMGL-v10/RCTMGLSymbolLayer.swift +1 -1
- package/ios/RCTMGL-v10/RCTMGLTerrain.swift +3 -2
- package/ios/RCTMGL.xcodeproj/project.pbxproj +1 -0
- package/javascript/components/UserLocation.js +2 -2
- package/javascript/index.js +3 -0
- package/javascript/modules/location/locationManager.js +13 -1
- package/javascript/utils/MapboxStyles.d.ts +27 -31
- package/javascript/utils/{filterUtils.tsx → filterUtils.ts} +0 -0
- package/javascript/utils/getAnnotationsLayerID.ts +16 -0
- package/javascript/utils/styleMap.ts +0 -45
- package/lib/commonjs/components/UserLocation.js +1 -1
- package/lib/commonjs/components/UserLocation.js.map +1 -1
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/location/locationManager.js +8 -1
- package/lib/commonjs/modules/location/locationManager.js.map +1 -1
- package/lib/commonjs/utils/filterUtils.js.map +1 -1
- package/lib/commonjs/utils/getAnnotationsLayerID.js +21 -0
- package/lib/commonjs/utils/getAnnotationsLayerID.js.map +1 -0
- package/lib/commonjs/utils/styleMap.js +1 -41
- package/lib/commonjs/utils/styleMap.js.map +1 -1
- package/lib/commonjs/web/UnimplementedComponent.js.map +1 -1
- package/lib/module/components/UserLocation.js +1 -1
- package/lib/module/components/UserLocation.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/location/locationManager.js +8 -1
- package/lib/module/modules/location/locationManager.js.map +1 -1
- package/lib/module/utils/filterUtils.js.map +1 -1
- package/lib/module/utils/getAnnotationsLayerID.js +15 -0
- package/lib/module/utils/getAnnotationsLayerID.js.map +1 -0
- package/lib/module/utils/styleMap.js +1 -41
- package/lib/module/utils/styleMap.js.map +1 -1
- package/lib/module/web/UnimplementedComponent.js.map +1 -1
- package/lib/typescript/utils/filterUtils.d.ts.map +1 -1
- package/lib/typescript/utils/getAnnotationsLayerID.d.ts +2 -0
- package/lib/typescript/utils/getAnnotationsLayerID.d.ts.map +1 -0
- package/lib/typescript/utils/styleMap.d.ts +0 -40
- package/lib/typescript/utils/styleMap.d.ts.map +1 -1
- package/package.json +2 -2
- package/plugin/build/withMapbox.d.ts +1 -1
- package/plugin/build/withMapbox.js +46 -59
- package/plugin/src/withMapbox.ts +62 -65
- package/react-native.config.js +0 -3
- package/rnmapbox-maps.podspec +1 -1
package/plugin/src/withMapbox.ts
CHANGED
|
@@ -13,7 +13,12 @@ import {
|
|
|
13
13
|
withAppBuildGradle,
|
|
14
14
|
} from 'expo/config-plugins';
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
mergeContents,
|
|
18
|
+
createGeneratedHeaderComment,
|
|
19
|
+
removeGeneratedContents,
|
|
20
|
+
MergeResults,
|
|
21
|
+
} from './generateCode';
|
|
17
22
|
|
|
18
23
|
let pkg: { name: string; version?: string } = {
|
|
19
24
|
name: '@rnmapbox/maps',
|
|
@@ -266,74 +271,66 @@ const addLibCppFilter = (appBuildGradle: string): string => {
|
|
|
266
271
|
}).contents;
|
|
267
272
|
};
|
|
268
273
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
274
|
+
// Because we need the package to be added AFTER the React and Google maven packages, we create a new allprojects.
|
|
275
|
+
// It's ok to have multiple allprojects.repositories, so we create a new one since it's cheaper than tokenizing
|
|
276
|
+
// the existing block to find the correct place to insert our mapbox maven.
|
|
277
|
+
const gradleMaven = `
|
|
278
|
+
allprojects {
|
|
279
|
+
repositories {
|
|
280
|
+
maven {
|
|
281
|
+
url 'https://api.mapbox.com/downloads/v2/releases/maven'
|
|
282
|
+
authentication { basic(BasicAuthentication) }
|
|
283
|
+
credentials {
|
|
284
|
+
username = 'mapbox'
|
|
285
|
+
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
|
|
286
|
+
}
|
|
281
287
|
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
`;
|
|
291
|
+
|
|
292
|
+
// Fork of config-plugins mergeContents, but appends the contents to the end of the file.
|
|
293
|
+
function appendContents({
|
|
294
|
+
src,
|
|
295
|
+
newSrc,
|
|
296
|
+
tag,
|
|
297
|
+
comment,
|
|
298
|
+
}: {
|
|
299
|
+
src: string;
|
|
300
|
+
newSrc: string;
|
|
301
|
+
tag: string;
|
|
302
|
+
comment: string;
|
|
303
|
+
}): MergeResults {
|
|
304
|
+
const header = createGeneratedHeaderComment(newSrc, tag, comment);
|
|
305
|
+
if (!src.includes(header)) {
|
|
306
|
+
// Ensure the old generated contents are removed.
|
|
307
|
+
const sanitizedTarget = removeGeneratedContents(src, tag);
|
|
308
|
+
const contentsToAdd = [
|
|
309
|
+
// @something
|
|
310
|
+
header,
|
|
311
|
+
// contents
|
|
312
|
+
newSrc,
|
|
313
|
+
// @end
|
|
314
|
+
`${comment} @generated end ${tag}`,
|
|
315
|
+
].join('\n');
|
|
316
|
+
|
|
317
|
+
return {
|
|
318
|
+
contents: sanitizedTarget ?? src + contentsToAdd,
|
|
319
|
+
didMerge: true,
|
|
320
|
+
didClear: !!sanitizedTarget,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
return { contents: src, didClear: false, didMerge: false };
|
|
324
|
+
}
|
|
282
325
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
username = 'mapbox'
|
|
289
|
-
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
mavenLocal()
|
|
293
|
-
maven {
|
|
294
|
-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
|
295
|
-
url(new File(['node', '--print', \\"require.resolve('react-native/package.json')\\"].execute(null, rootDir).text.trim(), '../android'))
|
|
296
|
-
}
|
|
297
|
-
// ...
|
|
298
|
-
*/
|
|
299
|
-
|
|
300
|
-
/*
|
|
301
|
-
Since mergeContents checks the anchor for each line, we can't do a "correct"
|
|
302
|
-
RegExp for allprojects...repositories.
|
|
303
|
-
Instead, we check for the first `allprojects`, and then count the # of lines to the next `repositories` block.
|
|
304
|
-
*/
|
|
305
|
-
let offset = 0;
|
|
306
|
-
const anchor = new RegExp(`^\\s*allprojects\\s*{`, 'gm');
|
|
307
|
-
// hack to count offset
|
|
308
|
-
const allProjectSplit = projectBuildGradle.split(anchor);
|
|
309
|
-
if (allProjectSplit.length <= 1)
|
|
310
|
-
throw new Error('Could not find `allprojects` block');
|
|
311
|
-
|
|
312
|
-
const allProjectLines =
|
|
313
|
-
allProjectSplit[allProjectSplit.length - 1].split('\n');
|
|
314
|
-
const allProjectReposOffset = allProjectLines.findIndex((line) =>
|
|
315
|
-
line.includes('repositories'),
|
|
316
|
-
);
|
|
317
|
-
anchor.lastIndex = 0;
|
|
318
|
-
offset = allProjectReposOffset + 1;
|
|
319
|
-
|
|
320
|
-
return mergeContents({
|
|
321
|
-
tag: `@rnmapbox/maps-v2-maven`,
|
|
322
|
-
src: projectBuildGradle,
|
|
323
|
-
newSrc: `
|
|
324
|
-
maven {
|
|
325
|
-
url 'https://api.mapbox.com/downloads/v2/releases/maven'
|
|
326
|
-
authentication { basic(BasicAuthentication) }
|
|
327
|
-
credentials {
|
|
328
|
-
username = 'mapbox'
|
|
329
|
-
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
|
|
330
|
-
}
|
|
331
|
-
}\n`,
|
|
332
|
-
anchor,
|
|
333
|
-
offset,
|
|
326
|
+
export function addMapboxMavenRepo(src: string): string {
|
|
327
|
+
return appendContents({
|
|
328
|
+
tag: '@rnmapbox/maps-v2-maven',
|
|
329
|
+
src,
|
|
330
|
+
newSrc: gradleMaven,
|
|
334
331
|
comment: '//',
|
|
335
332
|
}).contents;
|
|
336
|
-
}
|
|
333
|
+
}
|
|
337
334
|
|
|
338
335
|
const withAndroidAppGradle: ConfigPlugin<MapboxPlugProps> = (config) => {
|
|
339
336
|
return withAppBuildGradle(config, ({ modResults, ...config }) => {
|
package/react-native.config.js
CHANGED
package/rnmapbox-maps.podspec
CHANGED
|
@@ -20,7 +20,7 @@ require 'json'
|
|
|
20
20
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
21
21
|
|
|
22
22
|
## Warning: these lines are scanned by autogenerate.js
|
|
23
|
-
rnMapboxMapsDefaultMapboxVersion = '~> 10.
|
|
23
|
+
rnMapboxMapsDefaultMapboxVersion = '~> 10.10.0'
|
|
24
24
|
rnMapboxMapsDefaultMapboxGLVersion = '~> 5.9.0'
|
|
25
25
|
rnMapboxMapsDefaultMapLibreVersion = 'exactVersion 5.12.1'
|
|
26
26
|
|