Compare commits

..

14 Commits

Author SHA1 Message Date
Ibby Hadeed
0a8146b76c 4.4.2 2017-11-15 08:52:51 -05:00
Ibby Hadeed
2d60db9d3b chore(): update changelog 2017-11-13 16:21:09 -05:00
Ibby Hadeed
3378d7a398 4.4.1 2017-11-13 16:12:23 -05:00
Ibby Hadeed
61defd480c chore(): revert back to angular 4.4.4 2017-11-13 16:11:45 -05:00
Ibby Hadeed
4e28295486 Hide function/interface properly 2017-11-09 18:13:29 -05:00
Ibby Hadeed
dee32c921c Fix build issue 2017-11-09 18:09:40 -05:00
Ibby Hadeed
2475c57e00 Update 2017-11-09 16:19:48 -05:00
Ibby Hadeed
79b522f832 chore(): update changelog 2017-11-09 16:18:09 -05:00
Ibby Hadeed
ccb2e55435 4.4.0 2017-11-09 16:18:01 -05:00
FallenRiteMonk
f09c9cfe9a docs(): fix typo (#2071) 2017-11-09 16:13:47 -05:00
Sefa Ilkimen
d96d3eef07 feat(http): add support for new methods (#2054)
* feat(http): add patch request support (#2052)

* feat(http): add "disableRedirect" support (#2022)

* fix(http): remove obsolete "validateDomainName" function (#2053)
2017-11-09 16:13:36 -05:00
Daniel Sogl
95daca166b chore(package): Angular 5 support (#2089)
* docs(github): issue template

* initial commit

* Added StatusObject Interface

* style(wrap.tmpl): added missing field

* style(wrap.tmpl): added missing field

* chore(package.json): Angular 5 support

I also bumped the tslint rules and tslint

* Update package.json
2017-11-09 16:12:48 -05:00
Masashi Katsumata
196be026ea feat(google-maps): accept own properties for addMarker() and others (#2093)
* Update index.ts

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

* Update: getMap() methods return the instance of the wrapper plugin

* Update: getMap() methods return the instance of the wrapper plugin

* Remove `@CordovaInstance` decorators from getMap()

* Update: GoogleMapOptions (all fields are not optional).

* Follow up:  version `2.0.0-beta2-20170719-2226` of cordova-plugin-googlemaps

* Fix: tslint error

* Fix: tslint error

* No more isAvailable() method.

* Bug fix: description is incorrect

* Bug fix: example code was wrong.

* Bug fix: HtmlInfoWindow does not work
https://github.com/ionic-team/ionic-native/pull/1815#issuecomment-318909795

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* It seems the ionViewDidLoad() is enough delayed after platform.ready()

* Bug fix: map.setDiv()

* Bug fix: HtmlInfoWindow does not work

* Bug fix: BaseArrayClass definition is incorrect

* Bug fix: BaseArrayClass constructor is wrong

* Bug fix: Geocoder class does not work

* Bug fix: LatLngBounds constructor is wrong

* update: noNotify option is not declared

* Bug fix: Geocoder.geocode() returns array of GeocoderResult

* Update: clarify acceptable parameters of BaseArrayClass

* Add: AnimateCameraOption.padding is missing

* Revert: BaseClass.empty() method does not have the noNotify option

* Add `destruct` option to the CordovaOption.

- This allows BaseClass.on() is able to pass multiple retuned values from the cordova plugin side to the event lister.

* A semicolon is mixing

* update: event names

* Update: BaseClass.addEventListener(), addEventListenerOnce(), on(), and one()

* Add: destruct option for otherPromise
Change: inside event names (must use the version 2.0.0-beta3-20170808-1950 or higher)

* Build for working group

* Bug fix: map.getCameraTarget() definition is incorrect

* Bug fix: The definition of VisibleRegion interface is incorrect

* Fix: LatLng, LatLngBounds, and PolylineOptions classes
Update: map.getVisibleRegion()

Add: VisibleRegion class

* Bug fix: the definition of map.clear() method is incorrect

* Fix: map.fromLatLngToPoint()

* Ignore the dist directory on the master branch

* Remove the dist folder on the master branch

* fixes and tweaks

* use union types for CameraPosition

fixes issue mentioned on slack by @wf9a5m75

* fix types

* update AnimateCameraOptions interface

* remove AnimateCameraOptions interface

* add MarkerCluster class

* Bug fix: Can not create an instance of BaseArrayClass

* Bug fix: the icons property of MarkerClusterOptions

* Bug fix: the zoom option is missing

https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1712

* Update index.ts

* fix: need to convert instance type from the JS class to the wrapper class

https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1706

* remove test file

* fix: Error: Illegal use of "@private" tag.

* fix: The Environment, Encode, and Spherical  are static class

* fix:  convert JS instance to the ionic instance
add: BaseClass.destroy()
add: getId() method for all instance classes

* Documentation Error https://github.com/ionic-team/ionic-native/issues/1994

* Need to create another way to convert the instance for marker cluster

* save

* Remove the instance of wrapper class if the JS instance is removed.

* Bug fix: HtmlInfoWindow missing .on and .one methods
https://github.com/ionic-team/ionic-native/issues/2034

* Bug fix: HtmlInfoWindow constructor cause the error
https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1661

* Fix: Error when removing map
https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1823

* Add: the cssOptions argument for HtmlInfoWindow.setContent() method

* Bug fix: Polyline.getPoints(), Polygon.getPoints() and Polygon.getHoles()

Those methods need to create new instance of BaseArrayClass of wrapper plugin.

* Add: forEachAsync(), mapAsync(), and filterAsync() methods into BaseArray class

* update: use document.querySelector() instead of document.getElementById() if the passed element is string

update: map.setDiv()

Bug fix: can not create empty GoogleMap (pure JS version is available way)

* Fix: wait until the page is fully ready

* Fix: missing `clickable` option for PolygonOptions and PolylineOptions

* Add: accept own properties for `addMarker()` and others #2087

Fix: some properties are required, but specified as optional.

Add: descriptions for properties

* Bug fix: Static classes are defined as non static class
https://stackoverflow.com/questions/47083289/ionic-native-google-maps-plugin-set-app-background-color/47165721#47165721

* Add: poly class (plugin.google.maps.geometory.poly namespace)
2017-11-08 08:12:07 -05:00
Daniel Sogl
1fa7c91105 chore(package): bump Angular (#2096) 2017-11-08 04:46:25 -05:00
11 changed files with 3949 additions and 3656 deletions

View File

@@ -1,7 +1,7 @@
**I'm submitting a ...** (check one with "x")
[ ] bug report
[ ] feature request
<!-- Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/ -->
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
**Current behavior:**
<!-- Describe how the bug manifests. -->
@@ -21,8 +21,8 @@ insert any relevant code here
**Other information:**
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
**package.json info:**
**Ionic info:** (run `ionic info` from a terminal/cmd prompt and paste output below):
```json
insert the content here
```
insert the output from ionic info here
```

View File

@@ -1,5 +1,21 @@
<a name="4.4.1"></a>
## [4.4.1](https://github.com/ionic-team/ionic-native/compare/v4.4.0...v4.4.1) (2017-11-13)
<a name="4.4.0"></a>
# [4.4.0](https://github.com/ionic-team/ionic-native/compare/v4.3.3...v4.4.0) (2017-11-09)
### Features
* **google-maps:** accept own properties for `addMarker()` and others ([#2093](https://github.com/ionic-team/ionic-native/issues/2093)) ([196be02](https://github.com/ionic-team/ionic-native/commit/196be02))
* **http:** add support for new methods ([#2054](https://github.com/ionic-team/ionic-native/issues/2054)) ([d96d3ee](https://github.com/ionic-team/ionic-native/commit/d96d3ee))
<a name="4.3.3"></a>
## [4.3.3](https://github.com/ionic-team/ionic-native/compare/4.3.2...v4.3.3) (2017-11-01)
## [4.3.3](https://github.com/ionic-team/ionic-native/compare/v4.3.2...v4.3.3) (2017-11-01)
### Bug Fixes
@@ -8,6 +24,11 @@
<a name="4.3.2"></a>
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/4.3.2...v4.3.2) (2017-10-18)
<a name="4.3.2"></a>
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/4.3.1...4.3.2) (2017-10-17)
@@ -24,17 +45,7 @@
<a name="4.3.1"></a>
## [4.3.1](https://github.com/ionic-team/ionic-native/compare/v4.3.1...4.3.1) (2017-10-06)
### Features
* **pro:** Add support for Ionic Pro by incorporating cordova-plugin-ionic ([465d551](https://github.com/ionic-team/ionic-native/commit/465d551))
<a name="4.3.1"></a>
## [4.3.1](https://github.com/ionic-team/ionic-native/compare/v4.3.0...v4.3.1) (2017-10-06)
## [4.3.1](https://github.com/ionic-team/ionic-native/compare/v4.3.0...4.3.1) (2017-10-06)
### Bug Fixes
@@ -46,6 +57,7 @@
### Features
* **pro:** Add support for Ionic Pro by incorporating cordova-plugin-ionic ([465d551](https://github.com/ionic-team/ionic-native/commit/465d551))
* **regula-document-reader:** separate initialization and scanning, add android ([#2013](https://github.com/ionic-team/ionic-native/issues/2013)) ([2179699](https://github.com/ionic-team/ionic-native/commit/2179699))
@@ -58,7 +70,6 @@
* **google-maps:** convert JS classes to Ionic Native ([#1956](https://github.com/ionic-team/ionic-native/issues/1956)) ([57af5c5](https://github.com/ionic-team/ionic-native/commit/57af5c5))
* **google-maps:** fix icons property of MarkerClusterOptions ([#1937](https://github.com/ionic-team/ionic-native/issues/1937)) ([8004790](https://github.com/ionic-team/ionic-native/commit/8004790))
* **google-maps:** fix issue when creating new instance of BaseArrayClass ([#1931](https://github.com/ionic-team/ionic-native/issues/1931)) ([957396b](https://github.com/ionic-team/ionic-native/commit/957396b))
* **google-maps:** the zoom option is missing in the GoogleMapOptions class ([#1948](https://github.com/ionic-team/ionic-native/issues/1948)) ([ef898ef](https://github.com/ionic-team/ionic-native/commit/ef898ef))
* **http:** fix plugin ref ([#1934](https://github.com/ionic-team/ionic-native/issues/1934)) ([3a1034e](https://github.com/ionic-team/ionic-native/commit/3a1034e))
* **launch-navigator:** fix navigate method ([#1940](https://github.com/ionic-team/ionic-native/issues/1940)) ([a150d4d](https://github.com/ionic-team/ionic-native/commit/a150d4d))
@@ -83,6 +94,16 @@
<a name="4.2.1"></a>
## [4.2.1](https://github.com/ionic-team/ionic-native/compare/v4.2.0...v4.2.1) (2017-08-29)
### Bug Fixes
* **google-maps:** fix issue when creating new instance of BaseArrayClass ([#1931](https://github.com/ionic-team/ionic-native/issues/1931)) ([957396b](https://github.com/ionic-team/ionic-native/commit/957396b))
<a name="4.2.0"></a>
# [4.2.0](https://github.com/ionic-team/ionic-native/compare/v4.1.0...v4.2.0) (2017-08-26)
@@ -1832,13 +1853,13 @@ The whole implementation has changed now. You must update your code.
* **geolocation:** call correct clearFunction ([9e86a40](https://github.com/ionic-team/ionic-native/commit/9e86a40))
* **plugin:** return originalMethod return value ([240f0f8](https://github.com/ionic-team/ionic-native/commit/240f0f8))
* **plugin:** use call for id based clearFunction ([c2fdf39](https://github.com/ionic-team/ionic-native/commit/c2fdf39))
* datepicker plugin, pluginref, and [@Cordova](https://github.com/Cordova) wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
* datepicker plugin, pluginref, and @Cordova wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
### Features
* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f))
* **plugin:** add sync option to [@Cordova](https://github.com/Cordova) for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
* **plugin:** add sync option to @Cordova for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9))
* add app version plugin ([20cb01f](https://github.com/ionic-team/ionic-native/commit/20cb01f))
* add app version plugin ([8b78521](https://github.com/ionic-team/ionic-native/commit/8b78521))

6861
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "4.3.3",
"version": "4.4.2",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"homepage": "https://ionicframework.com/",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
@@ -10,12 +10,12 @@
"@angular/compiler-cli": "4.4.4",
"@angular/core": "4.4.4",
"@types/cordova": "0.0.34",
"@types/jasmine": "^2.5.51",
"@types/node": "^7.0.27",
"@types/jasmine": "^2.6.3",
"@types/node": "^8.0.50",
"canonical-path": "0.0.2",
"child-process-promise": "2.2.1",
"conventional-changelog-cli": "1.3.1",
"cpr": "2.0.2",
"conventional-changelog-cli": "1.3.4",
"cpr": "2.0.0",
"cz-conventional-changelog": "2.0.0",
"decamelize": "1.2.0",
"dgeni": "0.4.7",
@@ -39,11 +39,11 @@
"q": "1.5.0",
"queue": "4.2.1",
"rimraf": "2.6.1",
"rxjs": "5.4.3",
"rxjs": "5.5.2",
"semver": "5.3.0",
"tslint": "3.15.1",
"tslint-ionic-rules": "0.0.8",
"typescript": "2.3.4",
"typescript": "~2.4.2",
"zone.js": "0.8.18"
},
"scripts": {

View File

@@ -1,9 +1,23 @@
import { Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* This is a template for new plugin wrappers
*
* TODO:
* - Add/Change information below
* - Document usage (importing, executing main functionality)
* - Remove any imports that you are not using
* - Add this file to /src/index.ts (follow style of other plugins)
* - Remove all the comments included in this template, EXCEPT the @Plugin wrapper docs and any other docs you added
* - Remove this note
*
*/
import { Injectable } from '@angular/core';
import { Plugin, Cordova, CordovaProperty, CordovaInstance, InstanceProperty, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
* @name {{ Plugin_Name }}
* @description
* This plugin does something
*
* @usage
* ```typescript
@@ -15,16 +29,33 @@ import { Injectable } from '@angular/core';
* ...
*
*
* this.{{ pluginName }}.functionName('Hello', 123)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: '{{ PluginName }}',
plugin: '',
pluginRef: '',
repo: '',
platforms: []
plugin: '', // npm package name, example: cordova-plugin-camera
pluginRef: '', // the variable reference to call the plugin, example: navigator.geolocation
repo: '', // the github repository URL for the plugin
install: '', // OPTIONAL install command, in case the plugin requires variables
installVariables: [], // OPTIONAL the plugin requires variables
platforms: [] // Array of platforms supported, example: ['Android', 'iOS']
})
@Injectable()
export class {{ PluginName }} extends IonicNativePlugin {
/**
* This function does something
* @param arg1 {string} Some param to configure something
* @param arg2 {number} Another param to configure something
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
functionName(arg1: string, arg2: number): Promise<any> {
return; // We add return; here to avoid any IDE / Compiler errors
}
}

View File

@@ -40,8 +40,9 @@ import { Observable } from 'rxjs/Observable';
plugin: '', // npm package name, example: cordova-plugin-camera
pluginRef: '', // the variable reference to call the plugin, example: navigator.geolocation
repo: '', // the github repository URL for the plugin
platforms: [], // Array of platforms supported, example: ['Android', 'iOS']
install: '', // OPTIONAL install command, in case the plugin requires variables
installVariables: [], // OPTIONAL the plugin requires variables
platforms: [] // Array of platforms supported, example: ['Android', 'iOS']
})
@Injectable()
export class {{ PluginName }} extends IonicNativePlugin {

View File

@@ -105,17 +105,6 @@ export interface CordovaCheckOptions {
observable?: boolean;
}
export interface CordovaFiniteObservableOptions extends CordovaOptions {
/**
* Function that gets a result returned from plugin's success callback, and decides whether it is last value and observable should complete.
*/
resultFinalPredicate?: (result: any) => boolean;
/**
* Function that gets called after resultFinalPredicate, and removes service data that indicates end of stream from the result.
*/
resultTransform?: (result: any) => any;
}
/**
* @private
*/
@@ -167,7 +156,6 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
};
}
/**
* @private
*
@@ -323,39 +311,3 @@ export function CordovaFunctionOverride(opts: any = {}) {
};
}
/**
* @private
*
* Wraps method that returns an observable that can be completed. Provided opts.resultFinalPredicate dictates when the observable completes.
*
*/
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
if (opts.observable === false) {
throw new Error('CordovaFiniteObservable decorator can only be used on methods that returns observable. Please provide correct option.');
}
opts.observable = true;
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
return {
value: function(...args: any[]) {
let wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
return new Observable<any>((observer) => {
let wrappedSubscription = wrappedObservable.subscribe({
next: (x) => {
observer.next(opts.resultTransform ? opts.resultTransform(x) : x);
if (opts.resultFinalPredicate && opts.resultFinalPredicate(x)) {
observer.complete();
}
},
error: (err) => { observer.error(err); },
complete: () => { observer.complete(); }
});
return () => {
wrappedSubscription.unsubscribe();
};
});
},
enumerable: true
};
};
}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaCheck, CordovaInstance, Plugin, InstanceProperty, InstanceCheck, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
import { CordovaCheck, CordovaInstance, Plugin, InstanceProperty, InstanceCheck, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';
@@ -93,6 +93,9 @@ export class LatLngBounds implements ILatLngBounds {
export interface GoogleMapOptions {
/**
* MapType
*/
mapType?: MapType;
controls?: {
@@ -124,9 +127,25 @@ export interface GoogleMapOptions {
};
gestures?: {
/**
* Set false to disable the scroll gesture (default: true)
*/
scroll?: boolean;
/**
* Set false to disable the tilt gesture (default: true)
*/
tilt?: boolean;
/**
* Set false to disable the zoom gesture (default: true)
*/
zoom?: boolean;
/**
* Set false to disable the rotate gesture (default: true)
*/
rotate?: boolean;
};
@@ -171,6 +190,23 @@ export interface GoogleMapOptions {
export interface CameraPosition<T> {
/**
* The center location of the camera view.
*
* [usage 1]
*
* let cameraPos: CameraPosition<ILatLng> = {
* target: {lat: ..., lng: ...},
* zoom: 10
* }
*
* [usage 2] The zoom property is ignored when you specify multiple position
*
* let cameraPos: CameraPosition<ILatLng[]> = {
* target: [
* {lat: ..., lng: ...},
* {lat: ..., lng: ...},
* {lat: ..., lng: ...}
* ]
* }
*/
target?: T;
/**
@@ -196,18 +232,91 @@ export interface CameraPosition<T> {
}
export interface CircleOptions {
center?: ILatLng;
radius?: number;
/**
* Center position of circle
*/
center: ILatLng;
/**
* Radius of circle in meter
*/
radius: number;
/**
* Set the stroke color
* (rgb, rgba, #RRGGBB, "colorname", ...etc)
*/
strokeColor?: string;
/**
* Set the stroke width in pixel
*/
strokeWidth?: number;
/**
* Set the inside color of polygon
* (rgb, rgba, #RRGGBB, "colorname", ...etc)
*/
fillColor?: string;
/**
* Set to true to receive the CIRCLE_CLICK event
* (default: false)
*/
clickable?: boolean;
/**
* Set to false to hide
*/
visible?: boolean;
/**
* Z-index
*/
zIndex?: number;
/**
* Accept own properties
* You can get the property later using `get()` method.
*/
[key: string]: any;
}
export interface GeocoderRequest {
/**
* The address property or position property is required.
* You can not specify both property at the same time.
*
* [geocoding usage1]
* let request: GeocoderRequest = {
* address: "Los Angeles, California, USA"
* };
*
* [geocoding usage2]
* let request: GeocoderRequest = {
* address: [
* "Los Angeles, California, USA",
* "San Francisco, California, USA",
* ]
* };
*/
address?: string | string[];
/**
*
* [reverse-geocoding usage1]
* let request: GeocoderRequest = {
* position: {"lat": 37.421655, "lng": -122.085637}
* };
*
* [reverse-geocoding usage2]
* let request: GeocoderRequest = {
* address: [
* {"lat": 37.421655, "lng": -122.085637},
* {"lat": 37.332, "lng": -122.030781}
* ]
* };
*/
position?: ILatLng | ILatLng[];
}
@@ -236,31 +345,44 @@ export interface GroundOverlayOptions {
/**
* URL of overlay
*/
url?: string;
url: string;
/**
* Bounds, array of ILatLng
*/
bounds?: Array<ILatLng>;
bounds: Array<ILatLng>;
/**
* Set to false to ignore click event
* Set to true to receive the GROUND_OVERLAY_CLICK event
* (default: false)
*/
clickable?: boolean;
/**
* Set to false to hide
*/
visible?: boolean;
/**
* Opacity. From 0.0 to 1.0 .
*/
opacity?: number;
/**
* Bearing
*/
bearing?: number;
/**
* Z-index
*/
zIndex?: number;
/**
* Accept own properties
* You can get the property later using `get()` method.
*/
[key: string]: any;
}
export interface ILatLng {
@@ -341,13 +463,52 @@ export interface MarkerOptions {
* Set to true to disable auto panning when the marker is clicked.
*/
disableAutoPan?: boolean;
/**
* Accept own properties
* You can get the property later using `get()` method.
*/
[key: string]: any;
}
export interface MarkerClusterOptions {
/**
* Maximum zoom level of clustering
* (default: 15, max: 18)
*/
maxZoomLevel?: number;
/**
* Draw a rectangle that contains all locations of clustered when you tap on a clister marker.
* (default: true)
*/
boundsDraw?: boolean;
/**
* Position list
* [
* {title: "store A", position: {lat: ..., lng: ...}},
* {title: "store B", position: {lat: ..., lng: ...}},
* {title: "store C", position: {lat: ..., lng: ...}}
* ]
*/
markers: MarkerOptions[];
/**
* Conditions of clustering
* [
* {icon: "assets/small.png", min: 2, max: 10},
* {icon: "assets/middle.png", min: 11, max: 30},
* {icon: "assets/large.png", min: 31},
* ]
*/
icons: any[];
/**
* Accept own properties
* You can get the property later using `get()` method.
*/
[key: string]: any;
}
export interface MyLocation {
@@ -363,38 +524,159 @@ export interface MyLocation {
}
export interface MyLocationOptions {
/**
* Set true if you want to try to use GPS mandatory.
* (In false, the plugin try to use GPS and network)
* (default: false)
*/
enableHighAccuracy?: boolean;
}
export interface PolygonOptions {
points?: Array<ILatLng>;
/**
* Pass ILatLng[] to specify the vertixes.
* You need to contain two points at least.
*/
points: Array<ILatLng>;
/**
* Set true if you want to draw the curve polygon based on the earth
* (default: false)
*/
geodesic?: boolean;
/**
* Set the stroke color
* (rgb, rgba, #RRGGBB, "colorname", ...etc)
*/
strokeColor?: string;
/**
* Set the stroke width in pixel
*/
strokeWidth?: number;
/**
* Set the inside color of polygon
* (rgb, rgba, #RRGGBB, "colorname", ...etc)
*/
fillColor?: string;
/**
* Set false if you want to create invisible polygon
* (Invisible polygon is not clickable, default true)
*/
visible?: boolean;
/**
* Hierarchy z-index
*/
zIndex?: number;
/**
* Pass ILatLng[][] to create holes in polygon
*/
addHole?: Array<Array<ILatLng>>;
/**
* Set true if you want to receive the POLYGON_CLICK event
* (default: false)
*/
clickable?: boolean;
/**
* Accept own properties
* You can get the property later using `get()` method.
*/
[key: string]: any;
}
export interface PolylineOptions {
points?: Array<ILatLng>;
/**
* Pass ILatLng[] to specify the vertixes.
* You need to contain two points at least.
*/
points: Array<ILatLng>;
/**
* Set false if you want to create invisible polyline
* (Invisible polyline is not clickable, default true)
*/
visible?: boolean;
/**
* Set true if you want to draw the curve polyline based on the earth
* (default: false)
*/
geodesic?: boolean;
/**
* Set the stroke color
* (rgb, rgba, #RRGGBB, "colorname", ...etc)
*/
color?: string;
/**
* Set the stroke width in pixel
*/
width?: number;
/**
* Hierarchy z-index
*/
zIndex?: number;
/**
* Set true if you want to receive the POLYLINE_CLICK event
* (default: false)
*/
clickable?: boolean;
/**
* Accept own properties
* You can get the property later using `get()` method.
*/
[key: string]: any;
}
export interface TileOverlayOptions {
/**
* This callback must return string of image URL.
* If no tile, you need to return null.
*/
getTile: (x: number, y: number, zoom: number) => string;
/**
* Set false if you want to create invisible tilelayer
* (default true)
*/
visible?: boolean;
/**
* Hierarchy z-index of tilelayer
*/
zIndex?: number;
/**
* Default: 512px
*/
tileSize?: number;
/**
* Default: 1.0
*/
opacity?: number;
/**
* Set true if you want to display the tile information over the tile images.
*/
debug?: boolean;
/**
* Accept own properties
* You can get the property later using `get()` method.
*/
[key: string]: any;
}
@@ -583,6 +865,7 @@ export const GoogleMapsMapTypeId: { [mapType: string]: MapType; } = {
* Polygon
* Polyline
* Spherical
* Poly
* TileOverlay
* BaseClass
* BaseArrayClass
@@ -623,7 +906,7 @@ export class GoogleMaps extends IonicNativePlugin {
* @param options {any} Options
* @return {GoogleMap}
*/
create(element: string | HTMLElement | GoogleMapOptions, options?: GoogleMapOptions): GoogleMap {
static create(element: string | HTMLElement | GoogleMapOptions, options?: GoogleMapOptions): GoogleMap {
if (element instanceof HTMLElement) {
if (element.getAttribute('__pluginMapId')) {
console.error('GoogleMaps', element.tagName + '[__pluginMapId=\'' + element.getAttribute('__pluginMapId') + '\'] has already map.');
@@ -638,6 +921,15 @@ export class GoogleMaps extends IonicNativePlugin {
return googleMap;
}
/**
* @deprecation
* @hidden
*/
create(element: string | HTMLElement | GoogleMapOptions, options?: GoogleMapOptions): GoogleMap {
console.error('GoogleMaps', '[deprecated] Please use GoogleMaps.create()');
return GoogleMaps.create(element, options);
}
}
/**
@@ -1188,20 +1480,37 @@ export class Environment {
* Get the open source software license information for Google Maps SDK for iOS.
* @return {Promise<any>}
*/
getLicenseInfo(): Promise<any> {
static getLicenseInfo(): Promise<any> {
return new Promise<any>((resolve) => {
GoogleMaps.getPlugin().environment.getLicenseInfo((text: string) => resolve(text));
});
}
/**
* @deprecation
* @hidden
*/
getLicenseInfo(): Promise<any> {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Environment.getLicenseInfo()');
return Environment.getLicenseInfo();
}
/**
* Specifies the background color of the app.
* @param color
*/
setBackgroundColor(color: string): void {
static setBackgroundColor(color: string): void {
GoogleMaps.getPlugin().environment.setBackgroundColor(color);
}
/**
* @deprecation
* @hidden
*/
setBackgroundColor(color: string): void {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Environment.setBackgroundColor()');
Environment.setBackgroundColor(color);
}
}
/**
@@ -1214,12 +1523,22 @@ export class Environment {
repo: ''
})
export class Geocoder {
/**
* @deprecation
* @hidden
*/
geocode(request: GeocoderRequest): Promise<GeocoderResult[] | BaseArrayClass<GeocoderResult>> {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Geocoder.geocode()');
return Geocoder.geocode(request);
}
/**
* Converts position to address and vice versa
* @param {GeocoderRequest} request Request object with either an address or a position
* @return {Promise<GeocoderResult[] | BaseArrayClass<GeocoderResult>>}
*/
geocode(request: GeocoderRequest): Promise<GeocoderResult[] | BaseArrayClass<GeocoderResult>> {
static geocode(request: GeocoderRequest): Promise<GeocoderResult[] | BaseArrayClass<GeocoderResult>> {
if (request.address instanceof Array || Array.isArray(request.address) ||
request.position instanceof Array || Array.isArray(request.position)) {
@@ -1269,22 +1588,71 @@ export class Geocoder {
repo: ''
})
export class Encoding {
/**
* @deprecation
* @hidden
*/
decodePath(encoded: string, precision?: number): LatLng {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Encoding.decodePath()');
return Encoding.decodePath(encoded, precision);
}
/**
* @deprecation
* @hidden
*/
encodePath(path: Array<ILatLng> | BaseArrayClass<ILatLng>): string {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Encoding.encodePath()');
return Encoding.encodePath(path);
}
/**
* Decodes an encoded path string into a sequence of LatLngs.
* @param encoded {string} an encoded path string
* @param precision? {number} default: 5
* @return {LatLng}
*/
@Cordova({ sync: true })
decodePath(encoded: string, precision?: number): LatLng { return; }
static decodePath(encoded: string, precision?: number): LatLng { return; }
/**
* Encodes a sequence of LatLngs into an encoded path string.
* @param path {Array<ILatLng> | BaseArrayClass<ILatLng>} a sequence of LatLngs
* @return {string}
*/
@Cordova({ sync: true })
encodePath(path: Array<ILatLng> | BaseArrayClass<ILatLng>): string { return; }
static encodePath(path: Array<ILatLng> | BaseArrayClass<ILatLng>): string { return; }
}
/**
* @hidden
*/
@Plugin({
pluginName: 'GoogleMaps',
pluginRef: 'plugin.google.maps.geometry.poly',
plugin: 'cordova-plugin-googlemaps',
repo: ''
})
export class Poly {
/**
* Returns true if the speicified location is in the polygon path
* @param location {ILatLng}
* @param path {ILatLng[]}
* @return {boolean}
*/
static containsLocation(location: ILatLng, path: ILatLng[]): boolean {
return GoogleMaps.getPlugin().geometry.poly.containsLocation(location, path);
}
/**
* Returns true if the speicified location is on the polyline path
* @param location {ILatLng}
* @param path {ILatLng[]}
* @return {boolean}
*/
static isLocationOnEdge(location: ILatLng, path: ILatLng[]): boolean {
return GoogleMaps.getPlugin().geometry.poly.isLocationOnEdge(location, path);
}
}
/**
@@ -1297,13 +1665,92 @@ export class Encoding {
repo: ''
})
export class Spherical {
/**
* @deprecation
* @hidden
*/
computeDistanceBetween(from: ILatLng, to: ILatLng): number {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeDistanceBetween()');
return Spherical.computeDistanceBetween(from, to);
}
/**
* @deprecation
* @hidden
*/
computeOffset(from: ILatLng, distance: number, heading: number): LatLng {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeOffset()');
return Spherical.computeOffset(from, distance, heading);
}
/**
* @deprecation
* @hidden
*/
computeOffsetOrigin(to: ILatLng, distance: number, heading: number): LatLng {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeOffsetOrigin()');
return Spherical.computeOffsetOrigin(to, distance, heading);
}
/**
* @deprecation
* @hidden
*/
computeLength(path: Array<ILatLng> | BaseArrayClass<ILatLng>): number {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeLength()');
return Spherical.computeLength(path);
}
/**
* @deprecation
* @hidden
*/
computeArea(path: Array<ILatLng> | BaseArrayClass<ILatLng>): number {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeArea()');
return Spherical.computeArea(path);
}
/**
* @deprecation
* @hidden
*/
computeSignedArea(path: Array<ILatLng> | BaseArrayClass<ILatLng>): number {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeSignedArea()');
return Spherical.computeSignedArea(path);
}
/**
* @deprecation
* @hidden
*/
computeHeading(from: ILatLng, to: ILatLng): number {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeHeading()');
return Spherical.computeHeading(from, to);
}
/**
* @deprecation
* @hidden
*/
interpolate(from: ILatLng, to: ILatLng, fraction: number): LatLng {
console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.interpolate()');
return Spherical.interpolate(from, to, fraction);
}
/**
* Returns the distance, in meters, between two LatLngs.
* @param locationA {ILatLng}
* @param locationB {ILatLng}
* @return {number}
*/
computeDistanceBetween(from: ILatLng, to: ILatLng): number {
static computeDistanceBetween(from: ILatLng, to: ILatLng): number {
return GoogleMaps.getPlugin().geometry.spherical.computeDistanceBetween(from, to);
}
@@ -1314,7 +1761,7 @@ export class Spherical {
* @param heading {number}
* @return {LatLng}
*/
computeOffset(from: ILatLng, distance: number, heading: number): LatLng {
static computeOffset(from: ILatLng, distance: number, heading: number): LatLng {
return GoogleMaps.getPlugin().geometry.spherical.computeOffset(from, distance, heading);
}
@@ -1325,7 +1772,7 @@ export class Spherical {
* @param heading {number} The heading in degrees clockwise from north.
* @return {LatLng}
*/
computeOffsetOrigin(to: ILatLng, distance: number, heading: number): LatLng {
static computeOffsetOrigin(to: ILatLng, distance: number, heading: number): LatLng {
return GoogleMaps.getPlugin().geometry.spherical.computeOffsetOrigin(to, distance, heading);
}
@@ -1334,7 +1781,7 @@ export class Spherical {
* @param path {Array<ILatLng> | BaseArrayClass<ILatLng>}
* @return {number}
*/
computeLength(path: Array<ILatLng> | BaseArrayClass<ILatLng>): number {
static computeLength(path: Array<ILatLng> | BaseArrayClass<ILatLng>): number {
return GoogleMaps.getPlugin().geometry.spherical.computeLength(path);
}
@@ -1343,7 +1790,7 @@ export class Spherical {
* @param path {Array<ILatLng> | BaseArrayClass<ILatLng>}.
* @return {number}
*/
computeArea(path: Array<ILatLng> | BaseArrayClass<ILatLng>): number {
static computeArea(path: Array<ILatLng> | BaseArrayClass<ILatLng>): number {
return GoogleMaps.getPlugin().geometry.spherical.computeArea(path);
}
@@ -1352,7 +1799,7 @@ export class Spherical {
* @param path {Array<ILatLng> | BaseArrayClass<ILatLng>}.
* @return {number}
*/
computeSignedArea(path: Array<ILatLng> | BaseArrayClass<ILatLng>): number {
static computeSignedArea(path: Array<ILatLng> | BaseArrayClass<ILatLng>): number {
return GoogleMaps.getPlugin().geometry.spherical.computeSignedArea(path);
}
@@ -1362,7 +1809,7 @@ export class Spherical {
* @param to {ILatLng}
* @return {number}
*/
computeHeading(from: ILatLng, to: ILatLng): number {
static computeHeading(from: ILatLng, to: ILatLng): number {
return GoogleMaps.getPlugin().geometry.spherical.computeHeading(from, to);
}
@@ -1373,7 +1820,7 @@ export class Spherical {
* @param fraction {number} A fraction of the distance to travel from 0.0 to 1.0 .
* @return {LatLng}
*/
interpolate(from: ILatLng, to: ILatLng, fraction: number): LatLng {
static interpolate(from: ILatLng, to: ILatLng, fraction: number): LatLng {
return GoogleMaps.getPlugin().geometry.spherical.interpolate(from, to, fraction);
}
}

View File

@@ -113,6 +113,13 @@ export class HTTP extends IonicNativePlugin {
@Cordova({ sync: true })
removeCookies(url: string, cb: () => void): void { }
/**
* Disable following redirects automatically
* @param disable {boolean} Set to true to disable following redirects automatically
*/
@Cordova({ sync: true })
disableRedirect(disable: boolean): void { }
/**
* Set request timeout
* @param timeout {number} The timeout in seconds. Default 60
@@ -140,14 +147,6 @@ export class HTTP extends IonicNativePlugin {
@Cordova()
acceptAllCerts(accept: boolean): Promise<void> { return; }
/**
* Whether or not to validate the domain name in the certificate. This defaults to true.
* @param validate {boolean} Set to true to validate
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
validateDomainName(validate: boolean): Promise<void> { return; }
/**
* Make a POST request
* @param url {string} The url to send the request to
@@ -178,6 +177,16 @@ export class HTTP extends IonicNativePlugin {
@Cordova()
put(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
/**
* Make a PATCH request
* @param url {string} The url to send the request to
* @param body {Object} The body of the request
* @param headers {Object} The headers to set for this request
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
patch(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
/**
* Make a DELETE request
* @param url {string} The url to send the request to

View File

@@ -61,7 +61,7 @@ export interface LocalNotificationOptions {
* import { PhonegapLocalNotification } from '@ionic-native/phonegap-local-notification';
*
*
* constructor(private localNotification: PhonegapLocalNotifications) { }
* constructor(private localNotification: PhonegapLocalNotification) { }
*
* ...
*

View File

@@ -1,7 +1,54 @@
import { Plugin, Cordova, CordovaFiniteObservable, IonicNativePlugin } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin, CordovaOptions, wrap } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Injectable } from '@angular/core';
/**
* @hidden
*/
export interface CordovaFiniteObservableOptions extends CordovaOptions {
/**
* Function that gets a result returned from plugin's success callback, and decides whether it is last value and observable should complete.
*/
resultFinalPredicate?: string;
/**
* Function that gets called after resultFinalPredicate, and removes service data that indicates end of stream from the result.
*/
resultTransform?: string;
}
/**
* @hidden
*
* Wraps method that returns an observable that can be completed. Provided opts.resultFinalPredicate dictates when the observable completes.
*/
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
opts.observable = true;
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
return {
value: function(...args: any[]) {
const wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
return new Observable<any>((observer: Observer<any>) => {
const wrappedSubscription = wrappedObservable.subscribe({
next: (x: any) => {
observer.next(opts.resultTransform ? x[opts.resultTransform] : x);
if (opts.resultFinalPredicate && x[opts.resultFinalPredicate]) {
observer.complete();
}
},
error: (err: any) => { observer.error(err); },
complete: () => { observer.complete(); }
});
return () => {
wrappedSubscription.unsubscribe();
};
});
},
enumerable: true
};
};
}
/**
* @name Photo Library
* @description
@@ -58,8 +105,8 @@ export class PhotoLibrary extends IonicNativePlugin {
*/
@CordovaFiniteObservable({
callbackOrder: 'reverse',
resultFinalPredicate: (result: { isLastChunk: boolean }) => { return result.isLastChunk; },
resultTransform: (result: { library: LibraryItem[] }) => { return result.library; },
resultFinalPredicate: 'isLastChunk',
resultTransform: 'library'
})
getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> { return; }
@@ -69,7 +116,7 @@ export class PhotoLibrary extends IonicNativePlugin {
* @return { Promise<void>} Returns a promise that resolves when permissions are granted, and fails when not.
*/
@Cordova({
callbackOrder: 'reverse',
callbackOrder: 'reverse'
})
requestAuthorization(options?: RequestAuthorizationOptions): Promise<void> { return; }
@@ -78,7 +125,7 @@ export class PhotoLibrary extends IonicNativePlugin {
* @return {Promise<AlbumItem[]>} Resolves to list of albums.
*/
@Cordova({
callbackOrder: 'reverse',
callbackOrder: 'reverse'
})
getAlbums(): Promise<AlbumItem[]> { return; }