Skip to content

Commit 30ada48

Browse files
committed
publishg: 1.2.0
1 parent 1075b6e commit 30ada48

File tree

8 files changed

+59
-26
lines changed

8 files changed

+59
-26
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
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:
26
* fix bug in drawMultiRoad #530
37
* improve customTile where we added the support for full url
48
* improve lints

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,28 @@ class CustomMapController extends BaseMapController {
774774
}
775775
}
776776
```
777+
### STATIC Map:
777778

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+
```
778799

779800

780801
## STATIC METHODS:

example/lib/main.dart

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter_osm_plugin/flutter_osm_plugin.dart';
23
import 'package:flutter_osm_plugin_example/src/home/main_example.dart';
34
import 'package:flutter_osm_plugin_example/src/search_example.dart';
45
import 'package:flutter_osm_plugin_example/src/simple_example_hook.dart';
@@ -25,9 +26,29 @@ class MyApp extends StatelessWidget {
2526
return MaterialApp(
2627
debugShowCheckedModeBanner: false,
2728
theme: ThemeData.light(useMaterial3: true),
28-
initialRoute: "/home",
29+
initialRoute: "/simple",
2930
routes: {
3031
"/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+
),
3152
"/old-home": (context) => const OldMainExample(),
3253
"/hook": (context) => const SimpleHookExample(),
3354
//"/adv-home": (ctx) => AdvandedMainExample(),

example/lib/src/home/main_example.dart

-16
Original file line numberDiff line numberDiff line change
@@ -494,22 +494,6 @@ class Map extends StatelessWidget {
494494
),
495495
],
496496
),
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-
*/
513497
],
514498
roadConfiguration: const RoadOption(
515499
roadColor: Colors.blueAccent,

example/pubspec.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ dev_dependencies:
2727
dependency_overrides:
2828
flutter_osm_plugin: #^0.70.3
2929
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/
3134

3235

3336
# For information on the generic Dart part of this file, see the
3437
# following page: https://dart.dev/tools/pub/pubspec
3538

36-
# The following section is specific to Flutter.
37-
flutter_osm_interface: any
3839
flutter:
3940

4041
# The following line ensures that the Material Icons font is

lib/flutter_osm_plugin.dart

+2
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ export 'src/widgets/copyright_osm_widget.dart';
1717
export 'src/widgets/custom_picker_location.dart';
1818
export 'src/widgets/picker_location.dart';
1919
export 'src/common/osm_option.dart';
20+
export 'src/widgets/static_osm.dart';
21+
export 'src/controller/simple_map_controller.dart';

lib/src/controller/map_controller.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MapController extends BaseMapController {
3434

3535
MapController.withUserPosition({
3636
super.areaLimit = const BoundingBox.world(),
37-
super. useExternalTracking = false,
37+
super.useExternalTracking = false,
3838
UserTrackingOption trackUserLocation = const UserTrackingOption(
3939
enableTracking: false,
4040
unFollowUser: false,
@@ -59,8 +59,8 @@ class MapController extends BaseMapController {
5959

6060
MapController.cyclOSMLayer({
6161
super.initMapWithUserPosition,
62-
super.initPosition,
63-
super.areaLimit = const BoundingBox.world(),
62+
super.initPosition,
63+
super.areaLimit = const BoundingBox.world(),
6464
}) : assert(
6565
(initMapWithUserPosition != null) || initPosition != null,
6666
),
@@ -83,7 +83,7 @@ class MapController extends BaseMapController {
8383
);
8484
MapController.publicTransportationLayer({
8585
super.initMapWithUserPosition,
86-
super.initPosition,
86+
super.initPosition,
8787
super.areaLimit = const BoundingBox.world(),
8888
}) : assert(
8989
(initMapWithUserPosition != null) || initPosition != null,

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_osm_plugin
22
description: OpenStreetMap Plugin Native for flutter apps (Andoird/iOS/web)
3-
version: 1.1.0
3+
version: 1.2.0
44

55

66
homepage: https://github.com/liodali/osm_flutter

0 commit comments

Comments
 (0)