Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'page/customize_marker_example.dart';
import 'page/geolocator_settings_example.dart';
import 'page/minimum_example.dart';
import 'page/navigation_example.dart';
import 'page/old_style_example.dart';
import 'page/selectable_distance_filter_example.dart';

void main() {
Expand Down Expand Up @@ -102,17 +101,6 @@ class Home extends StatelessWidget {
);
},
),
ListTile(
title: const Text('Old Style Example'),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => OldStyleExample(),
),
);
},
),
],
),
);
Expand Down
14 changes: 6 additions & 8 deletions example/lib/page/center_fab_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@ class _CenterFabExampleState extends State<CenterFabExample> {
),
// ignore: sort_child_properties_last
children: [
TileLayerWidget(
options: TileLayerOptions(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
TileLayer(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
LocationMarkerLayerWidget(
plugin: LocationMarkerPlugin(
Expand Down
14 changes: 6 additions & 8 deletions example/lib/page/custom_stream_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ class _CustomStreamExampleState extends State<CustomStreamExample> {
),
// ignore: sort_child_properties_last
children: [
TileLayerWidget(
options: TileLayerOptions(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
TileLayer(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
LocationMarkerLayerWidget(
options: LocationMarkerLayerOptions(
Expand Down
14 changes: 6 additions & 8 deletions example/lib/page/customize_marker_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ class CustomizeMarkerExample extends StatelessWidget {
maxZoom: 19,
),
children: [
TileLayerWidget(
options: TileLayerOptions(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
TileLayer(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
LocationMarkerLayerWidget(
options: LocationMarkerLayerOptions(
Expand Down
14 changes: 6 additions & 8 deletions example/lib/page/geolocator_settings_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ class GeolocatorSettingsExample extends StatelessWidget {
maxZoom: 19,
),
children: [
TileLayerWidget(
options: TileLayerOptions(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
TileLayer(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
LocationMarkerLayerWidget(
options: LocationMarkerLayerOptions(
Expand Down
14 changes: 6 additions & 8 deletions example/lib/page/minimum_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ class MinimumExample extends StatelessWidget {
maxZoom: 19,
),
children: [
TileLayerWidget(
options: TileLayerOptions(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
TileLayer(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
LocationMarkerLayerWidget(),
],
Expand Down
14 changes: 6 additions & 8 deletions example/lib/page/navigation_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@ class _NavigationExampleState extends State<NavigationExample> {
),
// ignore: sort_child_properties_last
children: [
TileLayerWidget(
options: TileLayerOptions(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
TileLayer(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
LocationMarkerLayerWidget(
plugin: LocationMarkerPlugin(
Expand Down
35 changes: 0 additions & 35 deletions example/lib/page/old_style_example.dart

This file was deleted.

14 changes: 6 additions & 8 deletions example/lib/page/selectable_distance_filter_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ class _SelectableDistanceFilterExampleState
maxZoom: 19,
),
children: [
TileLayerWidget(
options: TileLayerOptions(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
TileLayer(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
userAgentPackageName:
'net.tlserver6y.flutter_map_location_marker.example',
maxZoom: 19,
),
LocationMarkerLayerWidget(
options: LocationMarkerLayerOptions(
Expand Down
10 changes: 6 additions & 4 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ packages:
flutter_map:
dependency: "direct main"
description:
name: flutter_map
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
path: "."
ref: HEAD
resolved-ref: c6f31eaee57fa77785e7840931b0a9767e99a171
url: "https://github.com/MooNag/flutter_map"
source: git
version: "3.0.0"
flutter_map_location_marker:
dependency: "direct main"
description:
Expand Down
3 changes: 2 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ dependencies:
flutter:
sdk: flutter
flutter_joystick: ^0.0.2
flutter_map: any
flutter_map: #any
git: https://github.com/MooNag/flutter_map
flutter_map_location_marker:
path: ../
geolocator: any
Expand Down
14 changes: 14 additions & 0 deletions example/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Generated file. Do not edit.
//

// clang-format off

#include "generated_plugin_registrant.h"

#include <geolocator_windows/geolocator_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows"));
}
15 changes: 15 additions & 0 deletions example/windows/flutter/generated_plugin_registrant.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//

// clang-format off

#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_

#include <flutter/plugin_registry.h>

// Registers Flutter plugins.
void RegisterPlugins(flutter::PluginRegistry* registry);

#endif // GENERATED_PLUGIN_REGISTRANT_
24 changes: 24 additions & 0 deletions example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Generated file, do not edit.
#

list(APPEND FLUTTER_PLUGIN_LIST
geolocator_windows
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)

set(PLUGIN_BUNDLED_LIBRARIES)

foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)

foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
23 changes: 6 additions & 17 deletions lib/src/layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,14 @@ class LocationMarkerLayer extends StatefulWidget {
final LocationMarkerLayerOptions? locationMarkerOpts;

/// The map that should this layer be drawn.
final MapState map;

/// A rebuild signal stream for GroupLayer. See [GroupLayer.stream].
final Stream<void> stream;
final FlutterMapState map;

/// Create a LocationMarkerLayer.
LocationMarkerLayer(
this.plugin,
this.locationMarkerOpts,
this.map,
this.stream,
) : super(
key: locationMarkerOpts?.key,
);
);

@override
LocationMarkerLayerState createState() => LocationMarkerLayerState();
Expand Down Expand Up @@ -199,11 +193,9 @@ class LocationMarkerLayerState extends State<LocationMarkerLayer>
Widget _buildLocationMarker(LocationMarkerPosition position) {
final latLng = position.latLng;
final diameter = _locationMarkerOpts.headingSectorRadius * 2;
return GroupLayer(
GroupLayerOptions(
group: [
return Stack(children: [
if (_locationMarkerOpts.showAccuracyCircle)
CircleLayerOptions(
CircleLayer(
circles: [
CircleMarker(
point: latLng,
Expand All @@ -213,7 +205,7 @@ class LocationMarkerLayerState extends State<LocationMarkerLayer>
),
],
),
MarkerLayerOptions(
MarkerLayer(
markers: [
if (_locationMarkerOpts.showHeadingSector)
Marker(
Expand Down Expand Up @@ -316,10 +308,7 @@ class LocationMarkerLayerState extends State<LocationMarkerLayer>
],
),
],
),
widget.map,
widget.stream,
);
);
}

TickerFuture _moveMap(LatLng latLng, [double? zoom]) {
Expand Down
10 changes: 2 additions & 8 deletions lib/src/layer_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'marker_direction.dart';
/// 1) an accuracy circle (in a circle layer)
/// 2) a heading sector (in a marker layer) and
/// 3) a marker (in the same marker layer).
class LocationMarkerLayerOptions extends LayerOptions {
class LocationMarkerLayerOptions {
/// A Stream that provide position data for this marker. Default to
/// [LocationMarkerDataStreamFactory.geolocatorPositionStream].
final Stream<LocationMarkerPosition> positionStream;
Expand Down Expand Up @@ -64,7 +64,6 @@ class LocationMarkerLayerOptions extends LayerOptions {

/// Create a LocationMarkerLayerOptions.
LocationMarkerLayerOptions({
Key? key,
Stream<LocationMarkerPosition>? positionStream,
Stream<LocationMarkerHeading>? headingStream,
this.marker = const DefaultLocationMarker(),
Expand All @@ -83,19 +82,14 @@ class LocationMarkerLayerOptions extends LayerOptions {
Duration? rotateAnimationDuration,
this.moveAnimationCurve = Curves.fastOutSlowIn,
this.rotateAnimationCurve = Curves.easeInOut,
Stream<void>? rebuild,
}) : positionStream = positionStream ??
const LocationMarkerDataStreamFactory().geolocatorPositionStream(),
headingStream = headingStream ??
const LocationMarkerDataStreamFactory().compassHeadingStream(),
moveAnimationDuration =
moveAnimationDuration ?? markerAnimationDuration,
rotateAnimationDuration =
rotateAnimationDuration ?? markerAnimationDuration,
super(
key: key,
rebuild: rebuild,
);
rotateAnimationDuration ?? markerAnimationDuration;

/// The duration of the animation of location update.
@Deprecated(
Expand Down
Loading