Rename GpsMap to StaticMap

This commit is contained in:
Ming Ming 2024-10-30 22:26:11 +08:00
parent 55880944ce
commit 7c290a1825
6 changed files with 10 additions and 12 deletions

View file

@ -355,7 +355,7 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
height: 256, height: 256,
child: ValueStreamBuilder<GpsMapProvider>( child: ValueStreamBuilder<GpsMapProvider>(
stream: context.read<PrefController>().gpsMapProvider, stream: context.read<PrefController>().gpsMapProvider,
builder: (context, gpsMapProvider) => GpsMap( builder: (context, gpsMapProvider) => StaticMap(
providerHint: gpsMapProvider.requireData, providerHint: gpsMapProvider.requireData,
location: CameraPosition(center: _gps!, zoom: 16), location: CameraPosition(center: _gps!, zoom: 16),
onTap: _onMapTap, onTap: _onMapTap,

View file

@ -1,7 +1,7 @@
library np_gps_map; library np_gps_map;
export 'src/gps_map.dart';
export 'src/interactive_map.dart'; export 'src/interactive_map.dart';
export 'src/place_picker.dart'; export 'src/place_picker.dart';
export 'src/static_map.dart';
export 'src/type.dart'; export 'src/type.dart';
export 'src/util.dart' show initGpsMap; export 'src/util.dart' show initGpsMap;

View file

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:np_gps_map/src/gps_map.dart';
import 'package:np_gps_map/src/interactive_map/google.dart'; import 'package:np_gps_map/src/interactive_map/google.dart';
import 'package:np_gps_map/src/interactive_map/osm.dart'; import 'package:np_gps_map/src/interactive_map/osm.dart';
import 'package:np_gps_map/src/type.dart'; import 'package:np_gps_map/src/type.dart';

View file

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:np_gps_map/src/gps_map.dart';
import 'package:np_gps_map/src/interactive_map.dart'; import 'package:np_gps_map/src/interactive_map.dart';
import 'package:np_gps_map/src/type.dart'; import 'package:np_gps_map/src/type.dart';

View file

@ -6,14 +6,8 @@ import 'package:np_gps_map/src/type.dart';
import 'package:np_gps_map/src/util.dart'; import 'package:np_gps_map/src/util.dart';
import 'package:np_platform_util/np_platform_util.dart'; import 'package:np_platform_util/np_platform_util.dart';
enum GpsMapProvider { class StaticMap extends StatelessWidget {
google, const StaticMap({
osm,
;
}
class GpsMap extends StatelessWidget {
const GpsMap({
super.key, super.key,
required this.providerHint, required this.providerHint,
required this.location, required this.location,

View file

@ -3,6 +3,12 @@ import 'package:google_maps_flutter/google_maps_flutter.dart' as gmap;
import 'package:latlong2/latlong.dart'; import 'package:latlong2/latlong.dart';
import 'package:np_common/type.dart'; import 'package:np_common/type.dart';
enum GpsMapProvider {
google,
osm,
;
}
/// A pair of latitude and longitude coordinates, stored as degrees /// A pair of latitude and longitude coordinates, stored as degrees
class MapCoord { class MapCoord {
const MapCoord(this.latitude, this.longitude); const MapCoord(this.latitude, this.longitude);