Skip to content

Commit 1c40094

Browse files
committed
Added ability to place polygons
1 parent c231cca commit 1c40094

13 files changed

+188
-12
lines changed

lib/platform_maps_flutter.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
library flutter_platform_maps;
1+
library platform_maps_flutter;
22

33
import 'dart:io';
44

@@ -16,6 +16,7 @@ part 'src/platform_maps.dart';
1616
part 'src/location.dart';
1717
part 'src/marker.dart';
1818
part 'src/polyline.dart';
19+
part 'src/polygon.dart';
1920
part 'src/cap.dart';
2021
part 'src/joint_type.dart';
2122
part 'src/pattern_item.dart';

lib/src/bitmap.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
part of flutter_platform_maps;
1+
part of platform_maps_flutter;
22

33
/// Defines a bitmap image. For a marker, this class can be used to set the
44
/// image of the marker icon. For a ground overlay, it can be used to set the

lib/src/camera.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
part of flutter_platform_maps;
1+
part of platform_maps_flutter;
22

33
/// The position of the map "camera", the view point from which the world is
44
/// shown in the map view. Aggregates the camera's [target] geographical

lib/src/cap.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2019 The Chromium Authors. All rights reserved.
2-
part of flutter_platform_maps;
2+
part of platform_maps_flutter;
33

44
enum Cap {
55
buttCap,

lib/src/controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
part of flutter_platform_maps;
1+
part of platform_maps_flutter;
22

33
class PlatformMapController {
44
appleMaps.AppleMapController appleController;

lib/src/joint_type.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
part of flutter_platform_maps;
5+
part of platform_maps_flutter;
66

77
/// Joint types for [Polyline].
88
@immutable

lib/src/location.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
part of flutter_platform_maps;
1+
part of platform_maps_flutter;
22

33
/// A pair of latitude and longitude coordinates, stored as degrees.
44
class LatLng {

lib/src/marker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
part of flutter_platform_maps;
1+
part of platform_maps_flutter;
22

33
/// Text labels for a [Marker] info window.
44
class InfoWindow {

lib/src/pattern_item.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
part of flutter_platform_maps;
1+
part of platform_maps_flutter;
22

33
/// Item used in the stroke pattern for a Polyline.
44
@immutable

lib/src/platform_maps.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
part of flutter_platform_maps;
1+
part of platform_maps_flutter;
22

33
typedef void MapCreatedCallback(PlatformMapController controller);
44

@@ -22,6 +22,7 @@ class PlatformMap extends StatefulWidget {
2222
this.myLocationButtonEnabled = false,
2323
this.markers,
2424
this.polylines,
25+
this.polygons,
2526
this.onCameraMoveStarted,
2627
this.onCameraMove,
2728
this.onCameraIdle,
@@ -68,6 +69,9 @@ class PlatformMap extends StatefulWidget {
6869
/// Polylines to be placed on the map.
6970
final Set<Polyline> polylines;
7071

72+
/// Polygons to be placed on the map.
73+
final Set<Polygon> polygons;
74+
7175
/// Called when the camera starts moving.
7276
///
7377
/// This can be initiated by the following:
@@ -168,6 +172,9 @@ class _PlatformMapState extends State<PlatformMap> {
168172
polylines: widget.polylines != null
169173
? Polyline.toGoogleMapsPolylines(widget.polylines)
170174
: widget.polylines,
175+
polygons: widget.polygons != null
176+
? Polygon.toGoogleMapsPolygonSet(widget.polygons)
177+
: widget.polygons,
171178
gestureRecognizers: widget.gestureRecognizers,
172179
onCameraIdle: widget.onCameraIdle,
173180
myLocationButtonEnabled: widget.myLocationButtonEnabled,
@@ -199,6 +206,9 @@ class _PlatformMapState extends State<PlatformMap> {
199206
polylines: widget.polylines != null
200207
? Polyline.toAppleMapsPolylines(widget.polylines)
201208
: widget.polylines,
209+
polygons: widget.polygons != null
210+
? Polygon.toAppleMapsPolygonSet(widget.polygons)
211+
: widget.polygons,
202212
gestureRecognizers: widget.gestureRecognizers,
203213
onCameraIdle: widget.onCameraIdle,
204214
myLocationButtonEnabled: widget.myLocationButtonEnabled,

0 commit comments

Comments
 (0)