Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/google_maps_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@
* Update google_map_flutter_tizen based on webview_flutter_tizen
* Update example and integration_test
* Update google_map_flutter to 2.0.8

## 0.1.1

* Update webview_flutter_tizen to 0.3.8
* Replace deprecated API (evaluateJavascript -> [runJavascript, runJavascriptForResult])
2 changes: 1 addition & 1 deletion packages/google_maps_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This package is not an _endorsed_ implementation of `google_maps_flutter`. There
```yaml
dependencies:
google_maps_flutter: ^2.0.8
google_maps_flutter_tizen: ^0.1.0
google_maps_flutter_tizen: ^0.1.1
```

In addition, you need a Maps JavaScript API Key to use this plugin. Please refer to the site below to get the API key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>

<feature name="http://tizen.org/feature/screen.size.all"/>
</manifest>
2 changes: 1 addition & 1 deletion packages/google_maps_flutter/lib/src/circle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CircleController {
Future<void> _addCircleEvent(Future<WebViewController>? _controller) async {
final String command =
"$_circle.addListener('click', (event) => CircleClick.postMessage(JSON.stringify(${_circle?.id})));";
await (await _controller!).evaluateJavascript(command);
await (await _controller!).runJavascript(command);
}

/// Returns `true` if this Controller will use its own `onTap` handler to consume events.
Expand Down
28 changes: 14 additions & 14 deletions packages/google_maps_flutter/lib/src/google_maps_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class GoogleMapsController {
/// Returns min-max zoom levels. Test only.
@visibleForTesting
Future<MinMaxZoomPreference> getMinMaxZoomLevels() async {
final String value = await (await controller)
.evaluateJavascript('JSON.stringify([map.minZoom, map.maxZoom])');
final String value = await (await controller).runJavascriptReturningResult(
'JSON.stringify([map.minZoom, map.maxZoom])');
final dynamic bound = json.decode(value);
double min = 0, max = 0;
if (bound is List<dynamic>) {
Expand All @@ -52,25 +52,25 @@ class GoogleMapsController {
/// Returns if zoomGestures property is enabled. Test only.
@visibleForTesting
Future<bool> isZoomGesturesEnabled() async {
final String value =
await (await controller).evaluateJavascript('map.gestureHandling');
final String value = await (await controller)
.runJavascriptReturningResult('map.gestureHandling');
return value != 'none';
}

@visibleForTesting

/// Returns if zoomControls property is enabled. Test only.
Future<bool> isZoomControlsEnabled() async {
final String value =
await (await controller).evaluateJavascript('map.zoomControl');
final String value = await (await controller)
.runJavascriptReturningResult('map.zoomControl');
return value != 'false';
}

/// Returns if scrollGestures property is enabled. Test only.
@visibleForTesting
Future<bool> isScrollGesturesEnabled() async {
final String value =
await (await controller).evaluateJavascript('map.gestureHandling');
final String value = await (await controller)
.runJavascriptReturningResult('map.gestureHandling');
return value != 'none';
}

Expand Down Expand Up @@ -119,7 +119,7 @@ class GoogleMapsController {
map.addListener('click', (event) => Click.postMessage(JSON.stringify(event)));
map.addListener('rightclick', (event) => RightClick.postMessage(JSON.stringify(event)));
''';
await (await controller).evaluateJavascript(command);
await (await controller).runJavascript(command);
}

/// The Flutter widget that will contain the rendered Map. Used for caching.
Expand Down Expand Up @@ -491,7 +491,7 @@ class GoogleMapsController {
console.log('trafficLayer detached!!');
}
''';
await (await controller).evaluateJavascript(command);
await (await controller).runJavascript(command);
}

Future<void> _setMoveCamera(String options) async {
Expand All @@ -512,8 +512,8 @@ class GoogleMapsController {

Future<String> _callMethod(
WebViewController mapView, String method, List<Object?> args) async {
return await mapView
.evaluateJavascript('JSON.stringify(map.$method.apply(map, $args))');
return await mapView.runJavascriptReturningResult(
'JSON.stringify(map.$method.apply(map, $args))');
}

Future<double> _getZoom(WebViewController c) async {
Expand Down Expand Up @@ -629,7 +629,7 @@ class GoogleMapsController {
JSON.stringify(getPixelToLatLng());
''';

return await (await controller).evaluateJavascript(command);
return await (await controller).runJavascriptReturningResult(command);
}

Future<String> _latLngToPoint(LatLng latLng) async {
Expand All @@ -649,7 +649,7 @@ class GoogleMapsController {
JSON.stringify(getLatLngToPixel());
''';

return await (await controller).evaluateJavascript(command);
return await (await controller).runJavascriptReturningResult(command);
}

/// Returns the zoom level of the current viewport.
Expand Down
2 changes: 1 addition & 1 deletion packages/google_maps_flutter/lib/src/marker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MarkerController {
final String command =
'''$marker.addListener("click", (event) => MarkerClick.postMessage(JSON.stringify(${marker?.id})));
$marker.addListener("dragend", (event) => MarkerDragEnd.postMessage(JSON.stringify({id:${marker?.id}, event:event})));''';
await (await _controller!).evaluateJavascript(command);
await (await _controller!).runJavascript(command);
}

/// Returns `true` if this Controller will use its own `onTap` handler to consume events.
Expand Down
2 changes: 1 addition & 1 deletion packages/google_maps_flutter/lib/src/polygon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PolygonController {
Future<void> _addPolygonEvent(Future<WebViewController>? _controller) async {
final String command =
"$_polygon.addListener('click', (event) => PolygonClick.postMessage(JSON.stringify(${_polygon?.id})));";
await (await _controller!).evaluateJavascript(command);
await (await _controller!).runJavascript(command);
}

/// Returns `true` if this Controller will use its own `onTap` handler to consume events.
Expand Down
2 changes: 1 addition & 1 deletion packages/google_maps_flutter/lib/src/polyline.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PolylineController {
Future<void> _addPolylineEvent(Future<WebViewController>? _controller) async {
final String command =
"$_polyline.addListener('click', (event) => PolylineClick.postMessage(JSON.stringify(${_polyline?.id})));";
await (await _controller!).evaluateJavascript(command);
await (await _controller!).runJavascript(command);
}

/// Returns `true` if this Controller will use its own `onTap` handler to consume events.
Expand Down
28 changes: 14 additions & 14 deletions packages/google_maps_flutter/lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class GInfoWindow {
}

Future<void> _createInfoWindow(GInfoWindowOptions? opts) async {
await (await webController!).evaluateJavascript(
await (await webController!).runJavascript(
'var ${toString()} = new google.maps.InfoWindow($opts);');
}

Expand All @@ -171,7 +171,7 @@ class GInfoWindow {
}

Future<void> _callCloseInfoWindow() async {
await (await webController!).evaluateJavascript('${toString()}.close();');
await (await webController!).runJavascript('${toString()}.close();');
}

/// Opens InfoWindow on the given map.
Expand All @@ -182,7 +182,7 @@ class GInfoWindow {
}

Future<void> _callOpenInfoWindow(GMarker? anchor) async {
await (await webController!).evaluateJavascript(
await (await webController!).runJavascript(
'${toString()}.open({anchor: ${anchor.toString()}, map});');
}

Expand Down Expand Up @@ -217,8 +217,8 @@ class GMarker {
}

Future<void> _createMarker(GMarkerOptions? opts) async {
await (await webController!).evaluateJavascript(
'var ${toString()} = new google.maps.Marker($opts);');
await (await webController!)
.runJavascript('var ${toString()} = new google.maps.Marker($opts);');
}

/// GMarker id.
Expand Down Expand Up @@ -269,8 +269,8 @@ class GPolyline {
}

Future<void> _createPolyline(GPolylineOptions? opts) async {
await (await webController!).evaluateJavascript(
'var ${toString()} = new google.maps.Polyline($opts);');
await (await webController!)
.runJavascript('var ${toString()} = new google.maps.Polyline($opts);');
}

/// GPolyline id.
Expand Down Expand Up @@ -363,8 +363,8 @@ class GPolygon {
}

Future<void> _createPolygon(GPolygonOptions? opts) async {
await (await webController!).evaluateJavascript(
'var ${toString()} = new google.maps.Polygon($opts);');
await (await webController!)
.runJavascript('var ${toString()} = new google.maps.Polygon($opts);');
}

/// GPolygon id.
Expand Down Expand Up @@ -467,8 +467,8 @@ class GCircle {
}

Future<void> _createCircle(GCircleOptions? opts) async {
await (await webController!).evaluateJavascript(
'var ${toString()} = new google.maps.Circle($opts);');
await (await webController!)
.runJavascript('var ${toString()} = new google.maps.Circle($opts);');
}

/// GCircle id.
Expand Down Expand Up @@ -562,21 +562,21 @@ Future<WebViewController>? webController;
Future<String> getProperty(Object o, String property) async {
assert(webController != null, 'mapController is null!!');
final String command = 'JSON.stringify(${o.toString()}[\'$property\'])';
return await (await webController!).evaluateJavascript(command);
return await (await webController!).runJavascriptReturningResult(command);
}

/// Sets the value to property of the object.
Future<String> setProperty(Object o, String property, Object? value) async {
assert(webController != null, 'mapController is null!!');
final String command =
'JSON.stringify(${o.toString()}[\'$property\'] = $value)';
return await (await webController!).evaluateJavascript(command);
return await (await webController!).runJavascriptReturningResult(command);
}

/// Calls the method of the object with the args.
Future<String> callMethod(Object o, String method, List<Object?> args) async {
assert(webController != null, 'webController is null!!');
final String command =
'JSON.stringify(${o.toString()}.$method.apply(${o.toString()}, $args))';
return await (await webController!).evaluateJavascript(command);
return await (await webController!).runJavascriptReturningResult(command);
}
6 changes: 3 additions & 3 deletions packages/google_maps_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_maps_flutter_tizen
description: Tizen platform implementation of google_maps_flutter
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/google_maps_flutter
version: 0.1.0
version: 0.1.1

flutter:
plugin:
Expand All @@ -18,8 +18,8 @@ dependencies:
google_maps_flutter_platform_interface: ^2.0.1
flutter_lints: ^1.0.4
stream_transform: ^2.0.0
webview_flutter: ^2.0.4
webview_flutter_tizen: ^0.3.3
webview_flutter: ^2.3.0
Comment thread
bbrto21 marked this conversation as resolved.
webview_flutter_tizen: ^0.3.8

dev_dependencies:
flutter_test:
Expand Down