Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
f2e9806
Worked on platform interface
Rexios80 Apr 13, 2022
2203401
Added heatmap layer code to web
Rexios80 Apr 14, 2022
bcc8f07
Added web target to example
Rexios80 Apr 14, 2022
b179c93
Worked on interface
Rexios80 Apr 14, 2022
6ee7ae8
Worked on Android implementation
Rexios80 Apr 14, 2022
7f78965
Refactoring
Rexios80 Apr 14, 2022
09c1fab
Android works
Rexios80 Apr 14, 2022
d5d0726
Merge branch 'master' into feature/google-maps-heatmap
Rexios80 Apr 14, 2022
cf29213
Java formatting
Rexios80 Apr 14, 2022
b2436f5
Fixed dart analysis
Rexios80 Apr 15, 2022
37c58ad
Added copyright text
Rexios80 Apr 15, 2022
789cd9a
Web tests
Rexios80 Apr 16, 2022
977dfd4
Heatmap updates test
Rexios80 Apr 16, 2022
d27c28c
Gradient works
Rexios80 Apr 17, 2022
2df83b5
Merge remote-tracking branch 'origin/master' into feature/google-maps…
Rexios80 Apr 18, 2022
efb432a
Example app now launches with Google-Maps-iOS-Utils included
Rexios80 Apr 18, 2022
5703eeb
Worked on ios implementation
Rexios80 Apr 18, 2022
c47d213
iOS kind of works; the gradient is being weird
Rexios80 Apr 19, 2022
2361e47
Merge branch 'flutter:main' into feature/google-maps-heatmap
Rexios80 Apr 19, 2022
72dd326
Merge remote-tracking branch 'origin/feature/google-maps-heatmap' int…
Rexios80 Apr 19, 2022
bc27137
Fixed gradient issue
Rexios80 Apr 19, 2022
146ea54
Only use 0 alpha gradient first color on web
Rexios80 Apr 19, 2022
5ed26a8
Ran clang-format
Rexios80 Apr 19, 2022
bd51355
Ran flutter format
Rexios80 Apr 19, 2022
876998f
iOS heatmap rendering is a lot better
Rexios80 Apr 19, 2022
d4b3524
Formatting
Rexios80 Apr 19, 2022
f6d3050
Merge branch 'flutter:main' into feature/google-maps-heatmap
Rexios80 Apr 26, 2022
8415953
Made WeightedLatLng extend LatLng
Rexios80 Apr 26, 2022
0a9495c
Resolved issues
Rexios80 Apr 26, 2022
65bad90
Fixed web code issue
Rexios80 Apr 26, 2022
319f84e
Resolved issues
Rexios80 Apr 26, 2022
b2e7e5e
Added heatmap controller to umbrella header
Rexios80 Apr 26, 2022
9cb30af
Made min/max zoom intensity configurable from flutter
Rexios80 Apr 26, 2022
5039dd1
Made start points and color map size configurable from flutter
Rexios80 Apr 27, 2022
177def0
dart formatting
Rexios80 Apr 27, 2022
ca94502
Fixed test code
Rexios80 Apr 27, 2022
6ee5fed
Merge branch 'master' into feature/google-maps-heatmap
Rexios80 Apr 28, 2022
d341949
Better use of null safety
Rexios80 May 1, 2022
c3e904f
Added web heatmaps tests
Rexios80 May 3, 2022
5cd2524
Merge branch 'master' into feature/google-maps-heatmap
Rexios80 May 3, 2022
7ad6e7b
Fixed web tests
Rexios80 May 3, 2022
7978892
Fixed another web test issue
Rexios80 May 3, 2022
d76e161
Got NSAssert working
Rexios80 May 4, 2022
dd3c82f
Removed incorrect doc comment
Rexios80 May 5, 2022
f89a3f4
Merge remote-tracking branch 'origin/master' into feature/google-maps…
Rexios80 May 10, 2022
994fd1f
Fixed analysis issues with HeatmapPage in example
Rexios80 May 10, 2022
f96f844
Merge remote-tracking branch 'origin/master' into feature/google-maps…
Rexios80 May 21, 2022
3c6c7cd
Fixed analysis issues
Rexios80 May 21, 2022
f63af88
Formatting
Rexios80 May 21, 2022
1160e32
Fixed issues
Rexios80 May 21, 2022
c41b00a
Merge remote-tracking branch 'origin/master' into feature/google-maps…
Rexios80 May 23, 2022
ead58b8
Added license text to example/web/index.html
Rexios80 May 23, 2022
d1a8856
Merge remote-tracking branch 'origin/master' into feature/google-maps…
Rexios80 May 23, 2022
5c78283
Merge branch 'google_map_clean_up' into feature/google-maps-heatmap
Rexios80 Jun 15, 2022
b9dd462
Merge branch 'master' into feature/google-maps-heatmap
Rexios80 Jun 15, 2022
d1daad1
Formatting
Rexios80 Jun 15, 2022
35d8715
Don't know where that came from but okay
Rexios80 Jun 15, 2022
ccc9ca2
iOS example changes
Rexios80 Jun 16, 2022
ea1975b
Added iOS JSON conversion tests
Rexios80 Jun 16, 2022
d39a901
Merge branch 'main' into feature/google-maps-heatmap
Rexios80 Jul 11, 2022
89239ab
Fixed issues
Rexios80 Jul 14, 2022
e5b4943
Refactored heatmap controllers
Rexios80 Jul 14, 2022
3c7d7dc
Merge branch 'main' into feature/google-maps-heatmap
Rexios80 Jul 14, 2022
011828d
Added swift version to podspec for CI
Rexios80 Jul 14, 2022
c39446b
Removed `use_modular_headers!` from Podfile
Rexios80 Jul 15, 2022
4999d14
Merge branch 'master' into feature/google-maps-heatmap
Rexios80 Aug 16, 2022
681eae8
Fixed missing things
Rexios80 Aug 16, 2022
0bf8dd2
Fixed issues
Rexios80 Aug 17, 2022
d011011
Xcode project file changes
Rexios80 Aug 17, 2022
b7f4f72
Formatting
Rexios80 Aug 17, 2022
906c3f0
Merge branch 'master' into feature/google-maps-heatmap
Rexios80 Aug 17, 2022
09467d1
Reverted changes to other packages
Rexios80 Aug 17, 2022
a5e1e5f
Fixed umbrella header
Rexios80 Aug 17, 2022
686b60a
Formatting
Rexios80 Aug 17, 2022
70c8dbe
Fixed issues
Rexios80 Aug 17, 2022
4eaa5d3
Reverted changes to pbxproj file
Rexios80 Aug 17, 2022
b9d33cd
Merge branch 'main' into feature/google-maps-heatmap
Rexios80 Aug 18, 2022
882d3b4
Merge branch 'main' into feature/google-maps-heatmap
Rexios80 Aug 18, 2022
9005231
Fixes
Rexios80 Sep 1, 2022
0c03dad
Fixes
Rexios80 Sep 1, 2022
6d69bed
Fixes
Rexios80 Sep 1, 2022
edcede1
Fixes
Rexios80 Sep 1, 2022
cd24b9e
Merge remote-tracking branch 'origin/master' into feature/google-maps…
Rexios80 Sep 7, 2022
e67b408
Merge branch 'master' into feature/google-maps-heatmap
Rexios80 Oct 17, 2022
f4d5c86
Fixed build issues
Rexios80 Oct 17, 2022
2f745ab
Fixed web test issues
Rexios80 Oct 17, 2022
1ce1595
Fixed analysis issues
Rexios80 Oct 17, 2022
b2be041
iOS build changes
Rexios80 Oct 18, 2022
60e15ea
Updated example
Rexios80 Oct 19, 2022
612e5be
Updated documentation
Rexios80 Oct 19, 2022
7c22792
Removed assertion for radius value
Rexios80 Oct 19, 2022
1d212eb
Fixed building in google_maps_flutter_ios/example
Rexios80 Oct 19, 2022
f1105ad
Formatting
Rexios80 Oct 19, 2022
ef7a9d4
Fixed android build issue
Rexios80 Oct 21, 2022
8c7c8f0
Merge remote-tracking branch 'origin/master' into feature/google-maps…
Rexios80 Oct 24, 2022
43ba954
Merge branch 'master' into feature/google-maps-heatmap
Rexios80 Dec 20, 2022
3928a72
Assert that heatmap data is not empty
Rexios80 Jan 1, 2023
4d6392b
Merge remote-tracking branch 'origin/master' into feature/google-maps…
Rexios80 Jan 12, 2023
5c8839e
Revert "Assert that heatmap data is not empty"
Rexios80 Jan 12, 2023
c187469
Working on testing
Rexios80 Jan 12, 2023
feeed2c
Refactoring
Rexios80 Jan 12, 2023
e7471ea
Wrote some dart code
Rexios80 Jan 12, 2023
e779c77
Working on integration tests
Rexios80 Jan 12, 2023
aab722a
Fixing things
Rexios80 Jan 12, 2023
e08a292
Test passes
Rexios80 Jan 12, 2023
20591b0
Working on test
Rexios80 Jan 12, 2023
5235dad
Added heatmaps update test
Rexios80 Jan 12, 2023
55988cc
Added remove heatmaps test
Rexios80 Jan 12, 2023
e6e1af2
Working on Android tests
Rexios80 Jan 12, 2023
28468b2
Android tests work
Rexios80 Jan 12, 2023
35d12bd
Formatting
Rexios80 Jan 12, 2023
5c8ce27
Uncommented other tests
Rexios80 Jan 12, 2023
597d065
Merge remote-tracking branch 'origin/master' into feature/google-maps…
Rexios80 Jan 27, 2023
115ed7f
Undoing unnecessary changes to example
Rexios80 Jan 27, 2023
b3e1d4a
Rewrite tests using `moreOrLessEquals`
Rexios80 Jan 27, 2023
38ec627
Fixing issues
Rexios80 Jan 27, 2023
3639957
Updated documentation
Rexios80 Jan 30, 2023
89a0e20
Platform-specific serialization
Rexios80 Jan 30, 2023
88db9ca
...
Rexios80 Jan 30, 2023
34deb7d
Merge remote-tracking branch 'origin/master' into feature/google-maps…
Rexios80 Feb 22, 2023
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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/master' into feature/google-maps…
…-heatmap
  • Loading branch information
Rexios80 committed May 23, 2022
commit c41b00a00f23612bf3a230d55e874564206f1b52
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## 2.2.0

* Adds support for heatmap layers.

## 2.1.7

* Updates code for stricter analysis options.
* Removes unnecessary imports.

## 2.1.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// found in the LICENSE file.

import 'package:flutter/foundation.dart' show listEquals;
import 'package:flutter/material.dart' show Color;
import 'package:flutter/foundation.dart' show immutable;
import 'package:flutter/material.dart' show Color;

import 'types.dart';

Expand All @@ -24,7 +24,7 @@ class Heatmap implements MapsObject<Heatmap> {
/// [GoogleMap].
const Heatmap({
required this.heatmapId,
this.data = const [],
this.data = const <WeightedLatLng>[],
this.dissipating = true,
this.gradient,
this.maxIntensity,
Expand Down Expand Up @@ -108,12 +108,14 @@ class Heatmap implements MapsObject<Heatmap> {

/// Creates a new [Heatmap] object whose values are the same as this
/// instance.
@override
Heatmap clone() => copyWith(
dataParam: List.of(data),
dataParam: List<WeightedLatLng>.of(data),
gradientParam: gradient?.clone(),
);

/// Converts this object to something serializable in JSON.
@override
Object toJson() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my comments elsewhere about doing serialization in the individual packages, we may be able to completely remove this method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is safe to remove. Let me know your thoughts.

final Map<String, Object> json = <String, Object>{};

Expand All @@ -124,7 +126,7 @@ class Heatmap implements MapsObject<Heatmap> {
}

addIfPresent('heatmapId', heatmapId.value);
addIfPresent('data', data.map((e) => e.toJson()).toList());
addIfPresent('data', data.map((WeightedLatLng e) => e.toJson()).toList());
addIfPresent('dissipating', dissipating);
addIfPresent('gradient', gradient?.toJson());
addIfPresent('maxIntensity', maxIntensity);
Expand All @@ -138,18 +140,22 @@ class Heatmap implements MapsObject<Heatmap> {

@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other.runtimeType != runtimeType) return false;
final Heatmap typedOther = other as Heatmap;
return heatmapId == typedOther.heatmapId &&
listEquals(data, typedOther.data) &&
dissipating == typedOther.dissipating &&
gradient == typedOther.gradient &&
maxIntensity == typedOther.maxIntensity &&
opacity == typedOther.opacity &&
radius == typedOther.radius &&
minimumZoomIntensity == typedOther.minimumZoomIntensity &&
maximumZoomIntensity == typedOther.maximumZoomIntensity;
if (identical(this, other)) {
return true;
}
if (other.runtimeType != runtimeType) {
return false;
}
return other is Heatmap &&
heatmapId == other.heatmapId &&
listEquals(data, other.data) &&
dissipating == other.dissipating &&
gradient == other.gradient &&
maxIntensity == other.maxIntensity &&
opacity == other.opacity &&
radius == other.radius &&
minimumZoomIntensity == other.minimumZoomIntensity &&
maximumZoomIntensity == other.maximumZoomIntensity;
}

@override
Expand All @@ -158,7 +164,17 @@ class Heatmap implements MapsObject<Heatmap> {

/// Represents a mapping of intensity to color. Interpolates between given set
/// intensity and color values to produce a full mapping for the range [0, 1].
@immutable
class HeatmapGradient {
/// Creates a new [HeatmapGradient] object.
const HeatmapGradient({
required this.colors,
required this.startPoints,
this.colorMapSize = 256,
}) : assert(colors.length == startPoints.length),
assert(colors.length > 0),
assert(startPoints.length > 0);

/// The specific colors for the specific intensities specified by startPoints.
final List<Color> colors;

Expand All @@ -172,15 +188,6 @@ class HeatmapGradient {
/// Android and iOS only.
final int colorMapSize;

/// Creates a new [HeatmapGradient] object.
const HeatmapGradient({
required this.colors,
required this.startPoints,
this.colorMapSize = 256,
}) : assert(colors.length == startPoints.length),
assert(colors.length > 0),
assert(startPoints.length > 0);

/// Creates a new [HeatmapGradient] object whose values are the same as this
/// instance, unless overwritten by the specified parameters.
HeatmapGradient copyWith({
Expand All @@ -198,8 +205,8 @@ class HeatmapGradient {
/// Creates a new [HeatmapGradient] object whose values are the same as this
/// instance.
HeatmapGradient clone() => copyWith(
colorsParam: List.of(colors),
startPointsParam: List.of(startPoints),
colorsParam: List<Color>.of(colors),
startPointsParam: List<double>.of(startPoints),
);

/// Converts this object to something serializable in JSON.
Expand All @@ -212,7 +219,7 @@ class HeatmapGradient {
}
}

addIfPresent('colors', colors.map((e) => e.value).toList());
addIfPresent('colors', colors.map((Color e) => e.value).toList());
addIfPresent('startPoints', startPoints);
addIfPresent('colorMapSize', colorMapSize);

Expand All @@ -221,11 +228,18 @@ class HeatmapGradient {

@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other.runtimeType != runtimeType) return false;
final HeatmapGradient typedOther = other as HeatmapGradient;
return listEquals(colors, typedOther.colors) &&
listEquals(startPoints, typedOther.startPoints) &&
colorMapSize == typedOther.colorMapSize;
if (identical(this, other)) {
return true;
}
if (other.runtimeType != runtimeType) {
return false;
}
return other is HeatmapGradient &&
listEquals(colors, other.colors) &&
listEquals(startPoints, other.startPoints) &&
colorMapSize == other.colorMapSize;
}

@override
int get hashCode => Object.hash(colors, startPoints, colorMapSize);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

import 'package:flutter/foundation.dart'
show objectRuntimeType, visibleForTesting;
show immutable, objectRuntimeType, visibleForTesting;

/// A pair of latitude and longitude coordinates, stored as degrees.
@immutable
Expand Down Expand Up @@ -128,8 +128,9 @@ class LatLngBounds {
}

@override
String toString() =>
'${objectRuntimeType(this, 'LatLngBounds')}($southwest, $northeast)';
String toString() {
return '${objectRuntimeType(this, 'LatLngBounds')}($southwest, $northeast)';
}

@override
bool operator ==(Object other) {
Expand All @@ -153,6 +154,7 @@ class WeightedLatLng extends LatLng {
final double weight;

/// Converts this object to something serializable in JSON.
@override
Object toJson() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with heatmap itself: can we eliminate this and fromJson?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is safe to remove. Let me know your thoughts.

return <Object>[super.toJson(), weight];
}
Expand All @@ -163,25 +165,26 @@ class WeightedLatLng extends LatLng {
return null;
}
assert(json is List && json.length == 2);
final list = json as List;
final latLng = LatLng.fromJson(list[0])!;
final List<dynamic> list = json as List<dynamic>;
final LatLng latLng = LatLng.fromJson(list[0])!;
return WeightedLatLng(
latLng.latitude,
latLng.longitude,
weight: list[1],
weight: list[1] as double,
);
}

@override
String toString() =>
'${objectRuntimeType(this, 'WeightedLatLng')}($latitude, $longitude, $weight)';
String toString() {
return '${objectRuntimeType(this, 'WeightedLatLng')}($latitude, $longitude, $weight)';
}

@override
bool operator ==(Object o) {
return o is WeightedLatLng &&
o.latitude == latitude &&
o.longitude == longitude &&
o.weight == weight;
bool operator ==(Object other) {
return other is WeightedLatLng &&
other.latitude == latitude &&
other.longitude == longitude &&
other.weight == weight;
}

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export 'callbacks.dart';
export 'camera.dart';
export 'cap.dart';
export 'circle.dart';
export 'heatmap_updates.dart';
export 'circle_updates.dart';
export 'heatmap.dart';
export 'heatmap_updates.dart';
export 'joint_type.dart';
export 'location.dart';
export 'maps_object.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ void main() {
expect(() {
controller.updateCircles(
CircleUpdates.from(
<Circle>{},
<Circle>{},
const <Circle>{},
const <Circle>{},
),
);
}, throwsAssertionError);
Expand All @@ -162,8 +162,8 @@ void main() {
expect(() {
controller.updateHeatmaps(
HeatmapUpdates.from(
<Heatmap>{},
<Heatmap>{},
const <Heatmap>{},
const <Heatmap>{},
),
);
}, throwsAssertionError);
Expand All @@ -176,8 +176,8 @@ void main() {
expect(() {
controller.updatePolygons(
PolygonUpdates.from(
<Polygon>{},
<Polygon>{},
const <Polygon>{},
const <Polygon>{},
),
);
}, throwsAssertionError);
Expand All @@ -190,8 +190,8 @@ void main() {
expect(() {
controller.updatePolylines(
PolylineUpdates.from(
<Polyline>{},
<Polyline>{},
const <Polyline>{},
const <Polyline>{},
),
);
}, throwsAssertionError);
Expand All @@ -204,8 +204,8 @@ void main() {
expect(() {
controller.updateMarkers(
MarkerUpdates.from(
<Marker>{},
<Marker>{},
const <Marker>{},
const <Marker>{},
),
);
}, throwsAssertionError);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ void main() {
// Geometry
testWidgets('updateMarkers', (WidgetTester tester) async {
final MarkerUpdates expectedUpdates = MarkerUpdates.from(
<Marker>{},
<Marker>{},
const <Marker>{},
const <Marker>{},
);

await plugin.updateMarkers(expectedUpdates, mapId: mapId);
Expand All @@ -243,8 +243,8 @@ void main() {
});
testWidgets('updatePolygons', (WidgetTester tester) async {
final PolygonUpdates expectedUpdates = PolygonUpdates.from(
<Polygon>{},
<Polygon>{},
const <Polygon>{},
const <Polygon>{},
);

await plugin.updatePolygons(expectedUpdates, mapId: mapId);
Expand All @@ -253,8 +253,8 @@ void main() {
});
testWidgets('updatePolylines', (WidgetTester tester) async {
final PolylineUpdates expectedUpdates = PolylineUpdates.from(
<Polyline>{},
<Polyline>{},
const <Polyline>{},
const <Polyline>{},
);

await plugin.updatePolylines(expectedUpdates, mapId: mapId);
Expand All @@ -263,8 +263,8 @@ void main() {
});
testWidgets('updateCircles', (WidgetTester tester) async {
final CircleUpdates expectedUpdates = CircleUpdates.from(
<Circle>{},
<Circle>{},
const <Circle>{},
const <Circle>{},
);

await plugin.updateCircles(expectedUpdates, mapId: mapId);
Expand All @@ -273,8 +273,8 @@ void main() {
});
testWidgets('updateHeatmaps', (WidgetTester tester) async {
final HeatmapUpdates expectedUpdates = HeatmapUpdates.from(
<Heatmap>{},
<Heatmap>{},
const <Heatmap>{},
const <Heatmap>{},
);

await plugin.updateHeatmaps(expectedUpdates, mapId: mapId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ void main() {
Heatmap(
heatmapId: const HeatmapId('1'),
gradient: HeatmapGradient(
colors: <Color>[const Color(0xFFFABADA)],
startPoints: <double>[0],
colors: const <Color>[Color(0xFFFABADA)],
startPoints: const <double>[0],
),
),
};
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.