From 94ebe11f781adf3dd9a9b6f4e6ef7c16cada91ac Mon Sep 17 00:00:00 2001 From: Chris Vietor Date: Sun, 15 Nov 2020 16:43:08 +0100 Subject: [PATCH 1/2] fix: npm script paths corrected, removed obsolete test scripts. reset scripts use ns clean. fixed readme removed hardcoded DEVELOPMENT_TEAM id from demo's build.xcconfig --- README.md | 25 +-- demo/app/App_Resources/iOS/build.xcconfig | 4 +- package.json | 228 +++++++++++----------- 3 files changed, 127 insertions(+), 130 deletions(-) diff --git a/README.md b/README.md index e55f8eb..43f467b 100755 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ You will also need to set up your development environment. Please refer to the [ # Installation ``` -$ tns plugin install @nativescript-community/ui-mapbox +$ ns plugin install @nativescript-community/ui-mapbox ``` # DEMOS @@ -63,22 +63,25 @@ The style can be set to one of the Mapbox style names or it can be the URL of yo > NOTE: As of this writing, the NativeScript demo only works with a mapbox token. The demo-angular will work with either a self hosted tile server or a mapbox token. +## Demo prerequisites +``` +npm run setup +``` + + ## To run the Angular demo ``` -cd src -npm run build.release -cd ../demo-angular -tns run +npm run build +cd ./demo-angular +ns run ``` ## To run the plain Nativescript demo - ``` -cd src -npm run build.release -cd ../demo -tns run +npm run build +cd ./demo +ns run ``` ## Debug Build @@ -96,7 +99,7 @@ sharing of mapping code between browser based and native applications. ## Issues If you get an error during iOS build related to Podspec versions, probably the easiest fix is: -`tns platform remove ios` and `tns platform add ios`. +`ns platform remove ios` and `ns platform add ios`. On Android the plugin adds this to the `` node of `app/App_Resources/Android/AndroidManifest.xml` (the plugin already attempts to do so): diff --git a/demo/app/App_Resources/iOS/build.xcconfig b/demo/app/App_Resources/iOS/build.xcconfig index a777ac8..8f2a45c 100644 --- a/demo/app/App_Resources/iOS/build.xcconfig +++ b/demo/app/App_Resources/iOS/build.xcconfig @@ -2,6 +2,4 @@ // for example you can uncomment the following line to force distribution code signing // CODE_SIGN_IDENTITY = iPhone Distribution ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; -ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - -DEVELOPMENT_TEAM = 8Q5F6M3TNS +ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; \ No newline at end of file diff --git a/package.json b/package.json index 33a2b7d..5e3288c 100644 --- a/package.json +++ b/package.json @@ -1,121 +1,117 @@ { - "name": "@nativescript-community/ui-mapbox", - "version": "5.0.0", - "description": "A Nativescript plugin for Mapbox Native Maps.", - "nativescript": { - "platforms": { - "android": "3.0.0", - "ios": "3.0.0" + "name": "@nativescript-community/ui-mapbox", + "version": "5.0.0", + "description": "A Nativescript plugin for Mapbox Native Maps.", + "nativescript": { + "platforms": { + "android": "3.0.0", + "ios": "3.0.0" + }, + "plugin": { + "nan": true, + "pan": true, + "core3": "true", + "category": "Interface" + } }, - "plugin": { - "nan": true, - "pan": true, - "core3": "true", - "category": "Interface" - } - }, - "scripts": { - "setup": "ts-patch install", - "build.angular": "ng-packagr -p src/angular/package.json -c src/angular/tsconfig.json", - "clean": "rimraf ./plugin/**/*.d.ts ./plugin/**/*.js ./plugin/**/*.js.map plugin/node_modules plugin/package-lock.json plugin/README.md demo/node_modules demo-angular/node_modules", - "tsc": "cpy '**/*.d.ts' '../plugin' --parents --cwd=src && tsc -skipLibCheck -d", - "build": "cp README.md ./plugin && rm -f .tsbuildinfo && npm run tsc ", - "publish": "npm run setup && npm run build && lerna publish --create-release=github", - "commitmsg": "commitlint -e $GIT_PARAMS", - "demo.ios": "npm run build && cd ../demo && tns run ios --syncAllFiles", - "demo.android": "npm run build && cd ../demo && tns run android", - "demo.android.build": "npm run build && cd ../demo && tns build android --log debug", - "test": "npm run tslint && npm run tslint.demo && cd ../demo && tns build ios && tns build android", - "test.ios": "cd ../demo && tns test ios --emulator --justlaunch", - "test.ios.device": "cd ../demo && tns test ios", - "test.android": "cd ../demo && tns test android --justlaunch", - "eslint": "eslint 'src/**/*.ts' --fix", - "prepublishOnly": "npm run build", - "generate.typings.ios": "cd ../demo && TNS_DEBUG_METADATA_PATH=\"$(pwd)/metadata\" tns build ios && TNS_TYPESCRIPT_DECLARATIONS_PATH=\"$(pwd)/typings\" tns build ios && echo 'Now look for your library typings in demo/typings!'", - "demo-angular.reset": "cd ../demo-angular && npx rimraf -- hooks node_modules platforms package-lock.json", - "demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json" - }, - "repository": { - "type": "git", - "url": "https://github.com/nativescript-community/ui-mapbox.git" - }, - "keywords": [ - "ecosystem:nativescript", - "NativeScript", - "Map", - "Maps", - "Native Maps", - "Mapbox" - ], - "author": { - "name": "Yermo Lamers", - "email": "yml@yml.com", - "url": "https://miles-by-motorcycle.com/flyingbricksoftware/about" - }, - "contributors": [ - { - "name": "Eddy Verbruggen - Original Author", - "email": "eddyverbruggen@gmail.com" + "scripts": { + "setup": "npm i && ts-patch install", + "build.angular": "ng-packagr -p src/angular/package.json -c src/angular/tsconfig.json", + "clean": "rimraf ./plugin/**/*.d.ts ./plugin/**/*.js ./plugin/**/*.js.map plugin/node_modules plugin/package-lock.json plugin/README.md demo/node_modules demo-angular/node_modules", + "tsc": "cpy '**/*.d.ts' '../plugin' --parents --cwd=src && tsc -skipLibCheck -d", + "build": "cp README.md ./plugin && rm -f .tsbuildinfo && npm run tsc ", + "publish": "npm run setup && npm run build && lerna publish --create-release=github", + "commitmsg": "commitlint -e $GIT_PARAMS", + "demo.ios": "npm run build && cd ./demo && ns run ios", + "demo.android": "npm run build && cd ./demo && ns run android", + "demo.android.build": "npm run build && cd ./demo && ns build android --log debug", + "eslint": "eslint 'src/**/*.ts' --fix", + "prepublishOnly": "npm run build", + "generate.typings.ios": "cd ./demo && TNS_DEBUG_METADATA_PATH=\"$(pwd)/metadata\" ns build ios && TNS_TYPESCRIPT_DECLARATIONS_PATH=\"$(pwd)/typings\" ns build ios && echo 'Now look for your library typings in demo/typings!'", + "demo-angular.reset": "cd ./demo-angular && ns clean", + "demo.reset": "cd ./demo && ns clean" + }, + "repository": { + "type": "git", + "url": "https://github.com/nativescript-community/ui-mapbox.git" + }, + "keywords": [ + "ecosystem:nativescript", + "NativeScript", + "Map", + "Maps", + "Native Maps", + "Mapbox" + ], + "author": { + "name": "Yermo Lamers", + "email": "yml@yml.com", + "url": "https://miles-by-motorcycle.com/flyingbricksoftware/about" + }, + "contributors": [ + { + "name": "Eddy Verbruggen - Original Author", + "email": "eddyverbruggen@gmail.com" + }, + { + "name": "Alex Wells", + "email": "autaut03@gmail.com" + } + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/nativescript-community/ui-mapbox/issues" + }, + "homepage": "https://github.com/nativescript-community/ui-mapbox", + "readmeFilename": "README.md", + "devDependencies": { + "@angular/animations": "~10.1.5", + "@angular/common": "~10.1.5", + "@angular/compiler": "~10.1.5", + "@angular/compiler-cli": "~10.1.5", + "@angular/core": "~10.1.5", + "@angular/forms": "~10.1.5", + "@angular/platform-browser": "~10.1.5", + "@angular/platform-browser-dynamic": "11.0.0-rc.3", + "@angular/router": "~10.1.5", + "@commitlint/cli": "^11.0.0", + "@commitlint/config-conventional": "^11.0.0", + "@nativescript-community/perms": "^2.1.1", + "@nativescript/angular": "10.1.7", + "@nativescript/core": "7.0.13", + "@nativescript/ios": "7.0.5", + "@nativescript/types-android": "~7.0.4", + "@nativescript/types-ios": "~7.0.4", + "@nativescript/webpack": "3.0.8", + "@types/node": "14.14.7", + "@types/react": "16.9.56", + "@typescript-eslint/eslint-plugin": "4.7.0", + "@typescript-eslint/parser": "4.7.0", + "cpy-cli": "^3.1.1", + "eslint": "7.13.0", + "eslint-config-prettier": "^6.15.0", + "eslint-plugin-prettier": "^3.1.4", + "husky": "^4.3.0", + "lerna": "^3.22.1", + "ng-packagr": "~10.1.2", + "prettier": "^2.1.2", + "prompt": "^1.0.0", + "react-nativescript": "^2.1.0", + "rimraf": "^3.0.2", + "rxjs": "^6.6.3", + "svelte-native": "0.9.5", + "ts-patch": "^1.3.0", + "tslib": "2.0.3", + "typescript": "3.9.7", + "zone.js": "0.11.3", + "vue": "^2.6.12" + }, + "dependencies": { + "ts-node": "^9.0.0" }, - { - "name": "Alex Wells", - "email": "autaut03@gmail.com" + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] } - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/nativescript-community/ui-mapbox/issues" - }, - "homepage": "https://github.com/nativescript-community/ui-mapbox", - "readmeFilename": "README.md", - "devDependencies": { - "@angular/animations": "~10.1.5", - "@angular/common": "~10.1.5", - "@angular/compiler": "~10.1.5", - "@angular/compiler-cli": "~10.1.5", - "@angular/core": "~10.1.5", - "@angular/forms": "~10.1.5", - "@angular/platform-browser": "~10.1.5", - "@angular/platform-browser-dynamic": "11.0.0-rc.3", - "@angular/router": "~10.1.5", - "@commitlint/cli": "^11.0.0", - "@commitlint/config-conventional": "^11.0.0", - "@nativescript-community/perms": "^2.1.1", - "@nativescript/angular": "10.1.7", - "@nativescript/core": "7.0.13", - "@nativescript/ios": "7.0.5", - "@nativescript/types-android": "~7.0.4", - "@nativescript/types-ios": "~7.0.4", - "@nativescript/webpack": "3.0.8", - "@types/node": "14.14.7", - "@types/react": "16.9.56", - "@typescript-eslint/eslint-plugin": "4.7.0", - "@typescript-eslint/parser": "4.7.0", - "cpy-cli": "^3.1.1", - "eslint": "7.13.0", - "eslint-config-prettier": "^6.15.0", - "eslint-plugin-prettier": "^3.1.4", - "husky": "^4.3.0", - "lerna": "^3.22.1", - "ng-packagr": "~10.1.2", - "prettier": "^2.1.2", - "prompt": "^1.0.0", - "react-nativescript": "^2.1.0", - "rimraf": "^3.0.2", - "rxjs": "^6.6.3", - "svelte-native": "0.9.5", - "ts-patch": "^1.3.0", - "tslib": "2.0.3", - "typescript": "3.9.7", - "zone.js": "0.11.3", - "vue": "^2.6.12" - }, - "dependencies": { - "ts-node": "^9.0.0" - }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - } } From 0b3f8826308b4e8a5bf5665fccd481cdf0900ac0 Mon Sep 17 00:00:00 2001 From: Chris Vietor Date: Mon, 16 Nov 2020 11:03:24 +0100 Subject: [PATCH 2/2] feat: getLayer + getLayers --- demo/app/main-page.xml | 9 ++-- demo/app/main-view-model.ts | 28 ++++++++++++ src/mapbox.android.ts | 88 +++++++++++++++++++++++++++++++++++++ src/mapbox.common.ts | 26 ++++++++++- src/mapbox.ios.ts | 73 ++++++++++++++++++++++++++++++ 5 files changed, 219 insertions(+), 5 deletions(-) diff --git a/demo/app/main-page.xml b/demo/app/main-page.xml index bf38f6e..a0aea12 100644 --- a/demo/app/main-page.xml +++ b/demo/app/main-page.xml @@ -1,5 +1,5 @@ - + @@ -103,7 +103,7 @@ - +