mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-06-24 03:14:30 +10:00
reduce map marker size (#131)
* reduce map marker size reduces map markers from 80 to 60 px to improve visibility with higher density areas * add flutter test to actions * Add GPX export functionality and related UI components * Refactor GPX export constants to use lowercase naming convention and improve export function error handling * ran formating * Enhance GPX export functionality with customizable parameters and improved metadata * Implement PathTraceMapScreen and refactor path tracing functionality across screens * Add localization for missing location error in path tracing * Updated GPX export functionality for contacts and repeaters in multiple languages. * Add scrollbar to path trace details list for improved navigation * Integrate SharePlus plugin for enhanced sharing functionality across platforms * reduce map marker size reduces map markers from 80 to 60 px to improve visibility with higher density areas * reduce marker size to improve map clarity and add path trace navigation to path management --------- Co-authored-by: Winston Lowe <wel97459@gmail.com>
This commit is contained in:
@@ -500,8 +500,8 @@ class _ChannelMessagePathMapScreenState
|
|||||||
if (hop.hasLocation)
|
if (hop.hasLocation)
|
||||||
Marker(
|
Marker(
|
||||||
point: hop.position!,
|
point: hop.position!,
|
||||||
width: 40,
|
width: 35,
|
||||||
height: 40,
|
height: 35,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
@@ -526,37 +526,39 @@ class _ChannelMessagePathMapScreenState
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Marker(
|
if (context.read<MeshCoreConnector>().selfLatitude != null &&
|
||||||
point: LatLng(
|
context.read<MeshCoreConnector>().selfLongitude != null)
|
||||||
context.read<MeshCoreConnector>().selfLatitude ?? 0.0,
|
Marker(
|
||||||
context.read<MeshCoreConnector>().selfLongitude ?? 0.0,
|
point: LatLng(
|
||||||
),
|
context.read<MeshCoreConnector>().selfLatitude!,
|
||||||
width: 40,
|
context.read<MeshCoreConnector>().selfLongitude!,
|
||||||
height: 40,
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.blue,
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
border: Border.all(color: Colors.white, width: 2),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withValues(alpha: 0.3),
|
|
||||||
blurRadius: 4,
|
|
||||||
offset: const Offset(0, 2),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
alignment: Alignment.center,
|
width: 35,
|
||||||
child: Text(
|
height: 35,
|
||||||
context.l10n.pathTrace_you,
|
child: Container(
|
||||||
style: const TextStyle(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.teal,
|
||||||
fontWeight: FontWeight.bold,
|
shape: BoxShape.circle,
|
||||||
fontSize: 12,
|
border: Border.all(color: Colors.white, width: 2),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withValues(alpha: 0.3),
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
context.l10n.pathTrace_you,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -349,6 +349,43 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
),
|
),
|
||||||
..._buildMarkers(contactsWithLocation, settings),
|
..._buildMarkers(contactsWithLocation, settings),
|
||||||
...sharedMarkers.map(_buildSharedMarker),
|
...sharedMarkers.map(_buildSharedMarker),
|
||||||
|
if (connector.selfLatitude != null &&
|
||||||
|
connector.selfLongitude != null)
|
||||||
|
Marker(
|
||||||
|
point: LatLng(
|
||||||
|
connector.selfLatitude!,
|
||||||
|
connector.selfLongitude!,
|
||||||
|
),
|
||||||
|
width: 35,
|
||||||
|
height: 35,
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.teal,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.white,
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withValues(alpha: 0.3),
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
context.l10n.pathTrace_you,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -394,14 +431,14 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
|
|
||||||
final marker = Marker(
|
final marker = Marker(
|
||||||
point: LatLng(contact.latitude!, contact.longitude!),
|
point: LatLng(contact.latitude!, contact.longitude!),
|
||||||
width: 80,
|
width: 35,
|
||||||
height: 80,
|
height: 35,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () => _showNodeInfo(context, contact),
|
onTap: () => _showNodeInfo(context, contact),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _getNodeColor(contact.type),
|
color: _getNodeColor(contact.type),
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
@@ -417,7 +454,7 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
child: Icon(
|
child: Icon(
|
||||||
_getNodeIcon(contact.type),
|
_getNodeIcon(contact.type),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
size: 24,
|
size: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ class _PathTraceMapScreenState extends State<PathTraceMapScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (!_hasData && _noLocationErr)
|
if (!_hasData && !_noLocationErr)
|
||||||
Center(
|
Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -364,37 +364,6 @@ class _PathTraceMapScreenState extends State<PathTraceMapScreen> {
|
|||||||
|
|
||||||
List<Marker> _buildHopMarkers(List<int> pathData) {
|
List<Marker> _buildHopMarkers(List<int> pathData) {
|
||||||
return [
|
return [
|
||||||
Marker(
|
|
||||||
point: LatLng(
|
|
||||||
context.read<MeshCoreConnector>().selfLatitude!,
|
|
||||||
context.read<MeshCoreConnector>().selfLongitude!,
|
|
||||||
),
|
|
||||||
width: 40,
|
|
||||||
height: 40,
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.blue,
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
border: Border.all(color: Colors.white, width: 2),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withValues(alpha: 0.3),
|
|
||||||
blurRadius: 4,
|
|
||||||
offset: const Offset(0, 2),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: Text(
|
|
||||||
context.l10n.pathTrace_you,
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 12,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
for (final hop in pathData)
|
for (final hop in pathData)
|
||||||
if (_traceData!.pathContacts[hop]!.hasLocation)
|
if (_traceData!.pathContacts[hop]!.hasLocation)
|
||||||
Marker(
|
Marker(
|
||||||
@@ -402,9 +371,10 @@ class _PathTraceMapScreenState extends State<PathTraceMapScreen> {
|
|||||||
_traceData!.pathContacts[hop]!.latitude!,
|
_traceData!.pathContacts[hop]!.latitude!,
|
||||||
_traceData!.pathContacts[hop]!.longitude!,
|
_traceData!.pathContacts[hop]!.longitude!,
|
||||||
),
|
),
|
||||||
width: 40,
|
width: 35,
|
||||||
height: 40,
|
height: 35,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
@@ -433,6 +403,40 @@ class _PathTraceMapScreenState extends State<PathTraceMapScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (context.read<MeshCoreConnector>().selfLatitude != null &&
|
||||||
|
context.read<MeshCoreConnector>().selfLongitude != null)
|
||||||
|
Marker(
|
||||||
|
point: LatLng(
|
||||||
|
context.read<MeshCoreConnector>().selfLatitude!,
|
||||||
|
context.read<MeshCoreConnector>().selfLongitude!,
|
||||||
|
),
|
||||||
|
width: 35,
|
||||||
|
height: 35,
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blue,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
border: Border.all(color: Colors.white, width: 2),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withValues(alpha: 0.3),
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
context.l10n.pathTrace_you,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:meshcore_open/screens/path_trace_map.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../connector/meshcore_connector.dart';
|
import '../connector/meshcore_connector.dart';
|
||||||
@@ -61,6 +62,19 @@ class _PathManagementDialog extends StatelessWidget {
|
|||||||
title: Text(l10n.chat_fullPath),
|
title: Text(l10n.chat_fullPath),
|
||||||
content: SelectableText(formattedPath),
|
content: SelectableText(formattedPath),
|
||||||
actions: [
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => PathTraceMapScreen(
|
||||||
|
title: context.l10n.contacts_repeaterPathTrace,
|
||||||
|
path: Uint8List.fromList(pathBytes),
|
||||||
|
flipPathRound: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(context.l10n.contacts_pathTrace),
|
||||||
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.pop(context),
|
onPressed: () => Navigator.pop(context),
|
||||||
child: Text(l10n.common_close),
|
child: Text(l10n.common_close),
|
||||||
|
|||||||
Reference in New Issue
Block a user