8000 feat(google-map-utils): google maps utilities (#298) · NativeScript/plugins@2157f97 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2157f97

Browse files
feat(google-map-utils): google maps utilities (#298)
1 parent 44ecf1a commit 2157f97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+14216
-556
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- [@nativescript/fingerprint-auth](packages/fingerprint-auth/README.md)
1818
- [@nativescript/geolocation](packages/geolocation/README.md)
1919
- [@nativescript/google-maps](packages/google-maps/README.md)
20+
- [@nativescript/google-maps-utils](packages/google-maps-utils/README.md)
2021
- [@nativescript/google-mobile-ads](packages/google-mobile-ads/README.md)
2122
- [@nativescript/google-signin](packages/google-signin/README.md)
2223
- [@nativescript/haptics](packages/haptics/README.md)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ActionBar title="google-maps-utils" class="action-bar"> </ActionBar>
2+
<StackLayout class="p-20">
3+
<ScrollView class="h-full">
4+
<StackLayout>
5+
<Button text="Test google-maps-utils" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6+
</StackLayout>
7+
</ScrollView>
8+
</StackLayout>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Component, NgZone } from '@angular/core';
2+
import { DemoSharedGoogleMapsUtils } from '@demo/shared';
3+
import { } from '@nativescript/google-maps-utils';
4+
5+
@Component({
6+
selector: 'demo-google-maps-utils',
7+
templateUrl: 'google-maps-utils.component.html',
8+
})
9+
export class GoogleMapsUtilsComponent {
10+
11+
demoShared: DemoSharedGoogleMapsUtils;
12+
13+
constructor(private _ngZone: NgZone) {}
14+
15+
ngOnInit() {
16+
this.demoShared = new DemoSharedGoogleMapsUtils();
17+
}
18+
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2+
import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3+
import { GoogleMapsUtilsComponent } from './google-maps-utils.component';
4+
5+
@NgModule({
6+
imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: GoogleMapsUtilsComponent }])],
7+
declarations: [GoogleMapsUtilsComponent],
8+
schemas: [ NO_ERRORS_SCHEMA]
9+
})
10+
export class GoogleMapsUtilsModule {}

apps/demo/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"license": "SEE LICENSE IN <your-license-filename>",
55
"repository": "<fill-your-repository-here>",
66
"dependencies": {
7+
"@nativescript/google-maps": "file:../../packages/google-maps",
8+
"@nativescript/google-maps-utils": "file:../../packages/google-maps-utils",
9+
"@nativescript/jetpack-compose": "file:../../packages/jetpack-compose",
710
"@nativescript/core": "*",
811
"@nativescript/camera": "file:../../packages/camera",
912
"@nativescript/animated-circle": "file:../../packages/animated-circle",
@@ -23,7 +26,6 @@
2326
"@nativescript/facebook": "file:../../packages/facebook",
2427
"@nativescript/fingerprint-auth": "file:../../packages/fingerprint-auth",
2528
"@nativescript/geolocation": "file:../../packages/geolocation",
26-
"@nativescript/google-maps": "file:../../packages/google-maps",
2729
"@nativescript/google-signin": "file:../../packages/google-signin",
2830
"@nativescript/haptics": "file:../../packages/haptics",
2931
"@nativescript/imagepicker": "file:../../packages/imagepicker",

apps/demo/src/main-page.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<Button text="fingerprint-auth" tap="{{ viewDemo }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
2525
<Button text="geolocation" tap="{{ viewDemo }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
2626
<Button text="google-maps" tap="{{ viewDemo }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
27+
<Button text="google-maps-utils" tap="{{ viewDemo }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
2728
<Button text="google-signin" tap="{{ viewDemo }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
2829
<Button text="haptics" tap="{{ viewDemo }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
2930
<Button text="imagepicker" tap="{{ viewDemo }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Observable, EventData, Page } from '@nativescript/core';
2+
import { DemoSharedGoogleMapsUtils } from '@demo/shared';
3+
import { } from '@nativescript/google-maps-utils';
4+
5+
export function navigatingTo(args: EventData) {
6+
const page = <Page>args.object;
7+
page.bindingContext = new DemoModel();
8+
}
9+
10+
export class DemoModel extends DemoSharedGoogleMapsUtils {
11+
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:map="@nativescript/google-maps" navigatingTo="navigatingTo" class="page">
2+
<Page.actionBar>
3+
<ActionBar title="google-maps-utils" icon="" class="action-bar">
4+
</ActionBar>
5+
</Page.actionBar>
6+
<StackLayout class="p-20">
7+
<StackLayout>
8+
<Button text="Test google-maps-utils" tap="{{ testIt }}" class="btn btn-primary"/>
9+
<map:MapView
10+
ready="{{ onMapReady }}"
11+
/>
12+
</StackLayout>
13+
</StackLayout>
14+
</Page>

packages/animated-circle/index.android.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class AnimatedCircle extends AnimatedCircleCommon {
4848
this.android.setInnerContourSize(0);
4949
this.android.setText(this.text);
5050
this.android.setTextColor(this._textColor.argb);
51-
if(this._textSize !== 0){
51+
if (this._textSize !== 0) {
5252
this.android.setTextSize(this._textSize);
5353
}
5454
if (this.animated) {
@@ -329,8 +329,8 @@ export class AnimatedCircle extends AnimatedCircleCommon {
329329
}
330330
}
331331

332-
private getNumber(value: number | string){
333-
return typeof value === 'string' ? parseInt(value) : value
332+
private getNumber(value: number | string) {
333+
return typeof value === 'string' ? parseInt(value) : value;
334334
}
335335
}
336336

0 commit comments

Comments
 (0)
0