Skip to content

Commit 71a1f11

Browse files
committed
Implemented getVisibleRegion for Android and iOS
1 parent 2626472 commit 71a1f11

File tree

11 files changed

+307
-64
lines changed

11 files changed

+307
-64
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,23 @@ class HomePage extends StatelessWidget {
5151
markers: Set<Marker>.of(
5252
[
5353
Marker(
54-
markerId: MarkerId('hi'),
54+
markerId: MarkerId('marker_1'),
5555
position: LatLng(47.6, 8.8796),
5656
consumeTapEvents: true,
5757
infoWindow: InfoWindow(
5858
title: 'PlatformMarker',
59-
snippet: 'Hi im a Platform Marker',
59+
snippet: "Hi I'm a Platform Marker",
6060
),
6161
onTap: () {
6262
print("Marker tapped");
6363
},
6464
),
6565
],
6666
),
67-
mapType: MapType.satellite,
6867
myLocationEnabled: true,
6968
myLocationButtonEnabled: true,
7069
onTap: (location) => print('onTap: $location'),
71-
onCameraMove: (location) => print('cameraMove: $location'),
70+
onCameraMove: (cameraUpdate) => print('onCameraMove: $cameraUpdate'),
7271
compassEnabled: true,
7372
onMapCreated: (controller) {
7473
Future.delayed(Duration(seconds: 2)).then(

example/README.md

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,54 @@
1-
# flutter_platform_maps_example
1+
## Sample Usage
22

3-
A new Flutter project.
4-
5-
## Getting Started
6-
7-
This project is a starting point for a Flutter application.
8-
9-
A few resources to get you started if this is your first Flutter project:
10-
11-
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13-
14-
For help getting started with Flutter, view our
15-
[online documentation](https://flutter.dev/docs), which offers tutorials,
16-
samples, guidance on mobile development, and a full API reference.
3+
```dart
4+
class HomePage extends StatelessWidget {
5+
@override
6+
Widget build(BuildContext context) {
7+
return Scaffold(
8+
body: PlatformMap(
9+
initialCameraPosition: CameraPosition(
10+
target: const LatLng(47.6, 8.8796),
11+
zoom: 16.0,
12+
),
13+
markers: Set<Marker>.of(
14+
[
15+
Marker(
16+
markerId: MarkerId('marker_1'),
17+
position: LatLng(47.6, 8.8796),
18+
consumeTapEvents: true,
19+
infoWindow: InfoWindow(
20+
title: 'PlatformMarker',
21+
snippet: "Hi I'm a Platform Marker",
22+
),
23+
onTap: () {
24+
print("Marker tapped");
25+
},
26+
),
27+
],
28+
),
29+
myLocationEnabled: true,
30+
myLocationButtonEnabled: true,
31+
onTap: (location) => print('onTap: $location'),
32+
onCameraMove: (cameraUpdate) => print('onCameraMove: $cameraUpdate'),
33+
compassEnabled: true,
34+
onMapCreated: (controller) {
35+
Future.delayed(Duration(seconds: 2)).then(
36+
(_) {
37+
controller.animateCamera(
38+
CameraUpdate.newCameraPosition(
39+
const CameraPosition(
40+
bearing: 270.0,
41+
target: LatLng(51.5160895, -0.1294527),
42+
tilt: 30.0,
43+
zoom: 18,
44+
),
45+
),
46+
);
47+
},
48+
);
49+
},
50+
),
51+
);
52+
}
53+
}
54+
```

example/ios/Podfile.lock

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
PODS:
2+
- apple_maps_flutter (0.0.1):
3+
- Flutter
4+
- Flutter (1.0.0)
5+
- google_maps_flutter (0.0.1):
6+
- Flutter
7+
- GoogleMaps
8+
- GoogleMaps (2.7.0):
9+
- GoogleMaps/Maps (= 2.7.0)
10+
- GoogleMaps/Base (2.7.0)
11+
- GoogleMaps/Maps (2.7.0):
12+
- GoogleMaps/Base
13+
14+
DEPENDENCIES:
15+
- apple_maps_flutter (from `.symlinks/plugins/apple_maps_flutter/ios`)
16+
- Flutter (from `.symlinks/flutter/ios`)
17+
- google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`)
18+
19+
SPEC REPOS:
20+
trunk:
21+
- GoogleMaps
22+
23+
EXTERNAL SOURCES:
24+
apple_maps_flutter:
25+
:path: ".symlinks/plugins/apple_maps_flutter/ios"
26+
Flutter:
27+
:path: ".symlinks/flutter/ios"
28+
google_maps_flutter:
29+
:path: ".symlinks/plugins/google_maps_flutter/ios"
30+
31+
SPEC CHECKSUMS:
32+
apple_maps_flutter: 45925bdf704b86f713fcf6979ee1999d17b2a6e0
33+
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
34+
google_maps_flutter: 78a52114c898b42ea647919679a4c58b70abe876
35+
GoogleMaps: f79af95cb24d869457b1f961c93d3ce8b2f3b848
36+
37+
PODFILE CHECKSUM: 10ae9c18d12c9ffc2275c9a159a3b1e281990db0
38+
39+
COCOAPODS: 1.8.3

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
1313
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1414
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
15+
7FE74C0AD0EF56424D639BC6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC748B521FCB03A49BA22856 /* Pods_Runner.framework */; };
1516
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
1617
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1718
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
@@ -38,8 +39,10 @@
3839
/* Begin PBXFileReference section */
3940
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
4041
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
42+
34ABAEC7C2DD893049707DA0 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
4143
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
4244
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
45+
729441750D12482C4D29D068 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
4346
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
4447
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4548
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -51,6 +54,8 @@
5154
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
5255
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
5356
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
57+
DC748B521FCB03A49BA22856 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
58+
EBA65092DBD8FDD261FAFFD0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
5459
/* End PBXFileReference section */
5560

5661
/* Begin PBXFrameworksBuildPhase section */
@@ -60,12 +65,32 @@
6065
files = (
6166
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
6267
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
68+
7FE74C0AD0EF56424D639BC6 /* Pods_Runner.framework in Frameworks */,
6369
);
6470
runOnlyForDeploymentPostprocessing = 0;
6571
};
6672
/* End PBXFrameworksBuildPhase section */
6773

6874
/* Begin PBXGroup section */
75+
1CE192A111D712DD9A43F4F8 /* Frameworks */ = {
76+
isa = PBXGroup;
77+
children = (
78+
DC748B521FCB03A49BA22856 /* Pods_Runner.framework */,
79+
);
80+
name = Frameworks;
81+
sourceTree = "<group>";
82+
};
83+
597E5CD6E9CF1449739D05C5 /* Pods */ = {
84+
isa = PBXGroup;
85+
children = (
86+
34ABAEC7C2DD893049707DA0 /* Pods-Runner.debug.xcconfig */,
87+
729441750D12482C4D29D068 /* Pods-Runner.release.xcconfig */,
88+
EBA65092DBD8FDD261FAFFD0 /* Pods-Runner.profile.xcconfig */,
89+
);
90+
name = Pods;
91+
path = Pods;
92+
sourceTree = "<group>";
93+
};
6994
9740EEB11CF90186004384FC /* Flutter */ = {
7095
isa = PBXGroup;
7196
children = (
@@ -85,6 +110,8 @@
85110
9740EEB11CF90186004384FC /* Flutter */,
86111
97C146F01CF9000F007C117D /* Runner */,
87112
97C146EF1CF9000F007C117D /* Products */,
113+
597E5CD6E9CF1449739D05C5 /* Pods */,
114+
1CE192A111D712DD9A43F4F8 /* Frameworks */,
88115
);
89116
sourceTree = "<group>";
90117
};
@@ -126,12 +153,15 @@
126153
isa = PBXNativeTarget;
127154
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
128155
buildPhases = (
156+
CBD17C7EFA1A784BF2C71A08 /* [CP] Check Pods Manifest.lock */,
129157
9740EEB61CF901F6004384FC /* Run Script */,
130158
97C146EA1CF9000F007C117D /* Sources */,
131159
97C146EB1CF9000F007C117D /* Frameworks */,
132160
97C146EC1CF9000F007C117D /* Resources */,
133161
9705A1C41CF9048500538489 /* Embed Frameworks */,
134162
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
163+
B0C469C42311B1BE80FECB95 /* [CP] Embed Pods Frameworks */,
164+
A44EDA5090B1A005FDEDDAF0 /* [CP] Copy Pods Resources */,
135165
);
136166
buildRules = (
137167
);
@@ -219,6 +249,58 @@
219249
shellPath = /bin/sh;
220250
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
221251
};
252+
A44EDA5090B1A005FDEDDAF0 /* [CP] Copy Pods Resources */ = {
253+
isa = PBXShellScriptBuildPhase;
254+
buildActionMask = 2147483647;
255+
files = (
256+
);
257+
inputPaths = (
258+
);
259+
name = "[CP] Copy Pods Resources";
260+
outputPaths = (
261+
);
262+
runOnlyForDeploymentPostprocessing = 0;
263+
shellPath = /bin/sh;
264+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
265+
showEnvVarsInLog = 0;
266+
};
267+
B0C469C42311B1BE80FECB95 /* [CP] Embed Pods Frameworks */ = {
268+
isa = PBXShellScriptBuildPhase;
269+
buildActionMask = 2147483647;
270+
files = (
271+
);
272+
inputPaths = (
273+
);
274+
name = "[CP] Embed Pods Frameworks";
275+
outputPaths = (
276+
);
277+
runOnlyForDeploymentPostprocessing = 0;
278+
shellPath = /bin/sh;
279+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
280+
showEnvVarsInLog = 0;
281+
};
282+
CBD17C7EFA1A784BF2C71A08 /* [CP] Check Pods Manifest.lock */ = {
283+
isa = PBXShellScriptBuildPhase;
284+
buildActionMask = 2147483647;
285+
files = (
286+
);
287+
inputFileListPaths = (
288+
);
289+
inputPaths = (
290+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
291+
"${PODS_ROOT}/Manifest.lock",
292+
);
293+
name = "[CP] Check Pods Manifest.lock";
294+
outputFileListPaths = (
295+
);
296+
outputPaths = (
297+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
298+
);
299+
runOnlyForDeploymentPostprocessing = 0;
300+
shellPath = /bin/sh;
301+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
302+
showEnvVarsInLog = 0;
303+
};
222304
/* End PBXShellScriptBuildPhase section */
223305

224306
/* Begin PBXSourcesBuildPhase section */
@@ -513,7 +595,6 @@
513595
defaultConfigurationName = Release;
514596
};
515597
/* End XCConfigurationList section */
516-
517598
};
518599
rootObject = 97C146E61CF9000F007C117D /* Project object */;
519600
}

example/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)