File tree 8 files changed +59
-26
lines changed
8 files changed +59
-26
lines changed Original file line number Diff line number Diff line change 1
- ### 1.1.6:
1
+ ### 1.2.0:
2
+ * Create new widget ` OSMViewer ` as static map
3
+ * Add ` SimpleMapController ` as controller to manipulate ` OSMViewer `
4
+ * Improve BoundingBox API
5
+ ### 1.1.0:
2
6
* fix bug in drawMultiRoad #530
3
7
* improve customTile where we added the support for full url
4
8
* improve lints
Original file line number Diff line number Diff line change @@ -774,7 +774,28 @@ class CustomMapController extends BaseMapController {
774
774
}
775
775
}
776
776
```
777
+ ### STATIC Map:
777
778
779
+ > using ` OSMViewer ` we can show static map that contain on location
780
+
781
+
782
+ ``` dart
783
+ OSMViewer(
784
+ controller: SimpleMapController(
785
+ initPosition: GeoPoint(
786
+ latitude: 47.4358055,
787
+ longitude: 8.4737324,
788
+ ),
789
+ markerHome: const MarkerIcon(
790
+ icon: Icon(Icons.home),
791
+ ),
792
+ ),
793
+ zoomOption: const ZoomOption(
794
+ initZoom: 16,
795
+ minZoomLevel: 11,
796
+ )
797
+
798
+ ```
778
799
779
800
780
801
## STATIC METHODS:
Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
+ import 'package:flutter_osm_plugin/flutter_osm_plugin.dart' ;
2
3
import 'package:flutter_osm_plugin_example/src/home/main_example.dart' ;
3
4
import 'package:flutter_osm_plugin_example/src/search_example.dart' ;
4
5
import 'package:flutter_osm_plugin_example/src/simple_example_hook.dart' ;
@@ -25,9 +26,29 @@ class MyApp extends StatelessWidget {
25
26
return MaterialApp (
26
27
debugShowCheckedModeBanner: false ,
27
28
theme: ThemeData .light (useMaterial3: true ),
28
- initialRoute: "/home " ,
29
+ initialRoute: "/simple " ,
29
30
routes: {
30
31
"/home" : (context) => const MainPageExample (),
32
+ "/simple" : (context) => Scaffold (
33
+ appBar: AppBar (
34
+ title: const Text ('simple' ),
35
+ ),
36
+ body: OSMViewer (
37
+ controller: SimpleMapController (
38
+ initPosition: GeoPoint (
39
+ latitude: 47.4358055 ,
40
+ longitude: 8.4737324 ,
41
+ ),
42
+ markerHome: const MarkerIcon (
43
+ icon: Icon (Icons .home),
44
+ ),
45
+ ),
46
+ zoomOption: const ZoomOption (
47
+ initZoom: 16 ,
48
+ minZoomLevel: 11 ,
49
+ ),
50
+ ),
51
+ ),
31
52
"/old-home" : (context) => const OldMainExample (),
32
53
"/hook" : (context) => const SimpleHookExample (),
33
54
//"/adv-home": (ctx) => AdvandedMainExample(),
Original file line number Diff line number Diff line change @@ -494,22 +494,6 @@ class Map extends StatelessWidget {
494
494
),
495
495
],
496
496
),
497
- /*
498
- StaticPositionGeoPoint(
499
- "line 2",
500
- MarkerIcon(
501
- icon: Icon(
502
- Icons.train,
503
- color: Colors.red,
504
- size: 48,
505
- ),
506
- ),
507
- [
508
- GeoPoint(latitude: 47.4433594, longitude: 8.4680184),
509
- GeoPoint(latitude: 47.4517782, longitude: 8.4716146),
510
- ],
511
- )
512
- */
513
497
],
514
498
roadConfiguration: const RoadOption (
515
499
roadColor: Colors .blueAccent,
Original file line number Diff line number Diff line change @@ -27,14 +27,15 @@ dev_dependencies:
27
27
dependency_overrides :
28
28
flutter_osm_plugin : # ^0.70.3
29
29
path : ../
30
-
30
+ flutter_osm_interface : # ^1.0.2
31
+ path : ../flutter_osm_interface/
32
+ flutter_osm_web : # ^1.0.3
33
+ path : ../flutter_osm_web/
31
34
32
35
33
36
# For information on the generic Dart part of this file, see the
34
37
# following page: https://dart.dev/tools/pub/pubspec
35
38
36
- # The following section is specific to Flutter.
37
- flutter_osm_interface : any
38
39
flutter :
39
40
40
41
# The following line ensures that the Material Icons font is
Original file line number Diff line number Diff line change @@ -17,3 +17,5 @@ export 'src/widgets/copyright_osm_widget.dart';
17
17
export 'src/widgets/custom_picker_location.dart' ;
18
18
export 'src/widgets/picker_location.dart' ;
19
19
export 'src/common/osm_option.dart' ;
20
+ export 'src/widgets/static_osm.dart' ;
21
+ export 'src/controller/simple_map_controller.dart' ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class MapController extends BaseMapController {
34
34
35
35
MapController .withUserPosition ({
36
36
super .areaLimit = const BoundingBox .world (),
37
- super . useExternalTracking = false ,
37
+ super .useExternalTracking = false ,
38
38
UserTrackingOption trackUserLocation = const UserTrackingOption (
39
39
enableTracking: false ,
40
40
unFollowUser: false ,
@@ -59,8 +59,8 @@ class MapController extends BaseMapController {
59
59
60
60
MapController .cyclOSMLayer ({
61
61
super .initMapWithUserPosition,
62
- super .initPosition,
63
- super .areaLimit = const BoundingBox .world (),
62
+ super .initPosition,
63
+ super .areaLimit = const BoundingBox .world (),
64
64
}) : assert (
65
65
(initMapWithUserPosition != null ) || initPosition != null ,
66
66
),
@@ -83,7 +83,7 @@ class MapController extends BaseMapController {
83
83
);
84
84
MapController .publicTransportationLayer ({
85
85
super .initMapWithUserPosition,
86
- super .initPosition,
86
+ super .initPosition,
87
87
super .areaLimit = const BoundingBox .world (),
88
88
}) : assert (
89
89
(initMapWithUserPosition != null ) || initPosition != null ,
Original file line number Diff line number Diff line change 1
1
name : flutter_osm_plugin
2
2
description : OpenStreetMap Plugin Native for flutter apps (Andoird/iOS/web)
3
- version : 1.1 .0
3
+ version : 1.2 .0
4
4
5
5
6
6
homepage : https://github.com/liodali/osm_flutter
You can’t perform that action at this time.
0 commit comments