Last changes not published
This commit is contained in:
parent
ac65ccf990
commit
21ec08303a
43 changed files with 607 additions and 613 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import 'dart:core';
|
||||
import 'locationUtils.dart';
|
||||
|
||||
import 'package:comunes_flutter/comunes_flutter.dart';
|
||||
import 'package:fires_flutter/models/yourLocation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -11,6 +11,7 @@ import 'package:share/share.dart';
|
|||
|
||||
import 'attributionMapPlugin.dart';
|
||||
import 'colors.dart';
|
||||
import 'customMoment.dart';
|
||||
import 'dummyMapPlugin.dart';
|
||||
import 'fireMarkType.dart';
|
||||
import 'fireMarker.dart';
|
||||
|
|
@ -18,13 +19,13 @@ import 'generated/i18n.dart';
|
|||
import 'genericMapBottom.dart';
|
||||
import 'globals.dart' as globals;
|
||||
import 'layerSelectorMapPlugin.dart';
|
||||
import 'locationUtils.dart';
|
||||
import 'models/appState.dart';
|
||||
import 'models/fireMapState.dart';
|
||||
import 'redux/actions.dart';
|
||||
import 'sentryReport.dart';
|
||||
import 'slider.dart';
|
||||
import 'zoomMapPlugin.dart';
|
||||
import 'customMoment.dart';
|
||||
|
||||
@immutable
|
||||
class _ViewModel {
|
||||
|
|
@ -142,33 +143,34 @@ class _genericMapState extends State<genericMap> {
|
|||
double maxZoom = 18.0; // works?
|
||||
|
||||
MapOptions mapOptions = new MapOptions(
|
||||
center: new LatLng(_location.lat, _location.lon),
|
||||
plugins: globals.isDevelopment
|
||||
? [
|
||||
new ZoomMapPlugin(),
|
||||
new AttributionPlugin(),
|
||||
new LayerSelectorMapPlugin()
|
||||
]
|
||||
: [
|
||||
new DummyMapPlugin(),
|
||||
new AttributionPlugin(),
|
||||
new LayerSelectorMapPlugin()
|
||||
],
|
||||
// this works ?
|
||||
interactive: false,
|
||||
zoom: 13.0,
|
||||
// THIS does not works as expected
|
||||
maxZoom: maxZoom,
|
||||
onTap: (callback) {
|
||||
if (status == FireMapStatus.edit) {
|
||||
_location = _location.copyWith(
|
||||
lat: callback.latitude, lon: callback.longitude);
|
||||
view.onEditing(_location);
|
||||
}
|
||||
},
|
||||
onPositionChanged: (positionCallback) {
|
||||
// print('${positionCallback.center}, ${positionCallback.zoom}');
|
||||
});
|
||||
center: new LatLng(_location.lat, _location.lon),
|
||||
plugins: globals.isDevelopment
|
||||
? [
|
||||
new ZoomMapPlugin(),
|
||||
new AttributionPlugin(),
|
||||
new LayerSelectorMapPlugin()
|
||||
]
|
||||
: [
|
||||
new DummyMapPlugin(),
|
||||
new AttributionPlugin(),
|
||||
new LayerSelectorMapPlugin()
|
||||
],
|
||||
// this works ?
|
||||
interactive: true,
|
||||
zoom: 13.0,
|
||||
// THIS does not works as expected
|
||||
maxZoom: maxZoom,
|
||||
onTap: (callback) {
|
||||
if (status == FireMapStatus.edit) {
|
||||
_location = _location.copyWith(
|
||||
lat: callback.latitude, lon: callback.longitude);
|
||||
view.onEditing(_location);
|
||||
}
|
||||
},
|
||||
// onPositionChanged: (positionCallback) {
|
||||
// print('${positionCallback.center}, ${positionCallback.zoom}');
|
||||
//}
|
||||
);
|
||||
var mapController = new MapController();
|
||||
|
||||
// mapController.fitBounds(bounds);
|
||||
|
|
@ -312,7 +314,7 @@ class _genericMapState extends State<genericMap> {
|
|||
}
|
||||
},
|
||||
// https://github.com/flutter/flutter/issues/17583
|
||||
heroTag: "firesmap" + _location.id.toHexString(),
|
||||
heroTag: "firesmap" + _location.id.hexString,
|
||||
icon: new Icon(btnIcon, color: fires600),
|
||||
label: new Text(
|
||||
btnText,
|
||||
|
|
@ -388,8 +390,7 @@ class _genericMapState extends State<genericMap> {
|
|||
icon: new Icon(Icons.share),
|
||||
onPressed: () {
|
||||
Share.share(
|
||||
'${view.mapState.fireNotification.description}. ${view
|
||||
.serverUrl}fire/${view.mapState.fireNotification.sealed}');
|
||||
'${view.mapState.fireNotification.description}. ${view.serverUrl}fire/${view.mapState.fireNotification.sealed}');
|
||||
})
|
||||
];
|
||||
default:
|
||||
|
|
@ -405,14 +406,14 @@ class _genericMapState extends State<genericMap> {
|
|||
bool isNotif,
|
||||
OnFirePressedInMap onFirePressed) {
|
||||
List<Marker> markers = [];
|
||||
print('building markers: fires: ${fires.length} falsePos: ${falsePosList
|
||||
.length} industries: ${industries.length}, isNotif: ${isNotif} ');
|
||||
print(
|
||||
'building markers: fires: ${fires.length} falsePos: ${falsePosList.length} industries: ${industries.length}, isNotif: $isNotif ');
|
||||
const calibrate = false; // useful when we change the fire icons size
|
||||
falsePosList.forEach((falsePos) {
|
||||
try {
|
||||
var coords = falsePos['geo']['coordinates'];
|
||||
// print('false pos: ${coords}');
|
||||
var loc = LatLng(coords[1], coords[0]);
|
||||
var loc = LatLng(coords[1].toDouble(), coords[0].toDouble());
|
||||
markers.add(FireMarker(loc, FireMarkType.falsePos));
|
||||
if (calibrate) markers.add(FireMarker(loc, FireMarkType.pixel));
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue