Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
16 changes: 8 additions & 8 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Branch & PR"
on:
push:
branches: [ "!master" ]
branches: ["!master"]
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: [ "3.27.0", "" ]
sdk: ["3.27.0", ""]
steps:
- name: Checkout Repository
uses: actions/checkout@v7
Expand All @@ -72,7 +72,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: [ "3.27.0", "" ]
sdk: ["3.27.0", ""]
defaults:
run:
working-directory: ./example
Expand All @@ -91,7 +91,7 @@ jobs:
flutter-version: ${{ matrix.sdk }}
cache: true
- name: Build Android Application
run: flutter build apk --dart-define=COMMIT_SHA=${{ github.sha }} --dart-define=flutter.flutter_map.unblockOSM="${{ secrets.UNBLOCK_OSM }}"
run: flutter build apk --dart-define=COMMIT_SHA=${{ github.sha }}
- name: Archive Artifact
if: ${{ matrix.sdk == '' }}
uses: actions/upload-artifact@v7
Expand All @@ -106,7 +106,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: [ "3.27.0", "" ]
sdk: ["3.32.0", ""]
defaults:
run:
working-directory: ./example
Expand All @@ -119,7 +119,7 @@ jobs:
flutter-version: ${{ matrix.sdk }}
cache: true
- name: Build Windows Application
run: flutter build windows --dart-define=COMMIT_SHA=${{ github.sha }} --dart-define=flutter.flutter_map.unblockOSM="${{ secrets.UNBLOCK_OSM }}"
run: flutter build windows --dart-define=COMMIT_SHA=${{ github.sha }}
- name: Install Inno Setup
if: ${{ matrix.sdk == '' }}
run: choco install innosetup --yes --no-progress
Expand All @@ -141,7 +141,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: [ "3.27.0", "" ]
sdk: ["3.27.0", ""]
defaults:
run:
working-directory: ./example
Expand All @@ -154,7 +154,7 @@ jobs:
flutter-version: ${{ matrix.sdk }}
cache: true
- name: Build Web Application
run: flutter build web --wasm --dart-define=COMMIT_SHA=${{ github.sha }} --dart-define=flutter.flutter_map.unblockOSM="${{ secrets.UNBLOCK_OSM }}"
run: flutter build web --wasm --dart-define=COMMIT_SHA=${{ github.sha }}
- name: Archive Artifact
uses: actions/upload-artifact@v7
if: ${{ matrix.sdk == '' }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
build-android:
name: "Build Android Example App"
runs-on: ubuntu-latest
needs: [ run-tests ]
needs: [run-tests]
if: github.repository == 'fleaflet/flutter_map'
defaults:
run:
Expand All @@ -44,14 +44,14 @@ jobs:
with:
distribution: "temurin"
java-version: "21"
cache: 'gradle'
cache: "gradle"
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Build Android Application
run: flutter build apk --dart-define=COMMIT_SHA=${{ github.sha }} --dart-define=flutter.flutter_map.unblockOSM="${{ secrets.UNBLOCK_OSM }}"
run: flutter build apk --dart-define=COMMIT_SHA=${{ github.sha }}
- name: Archive Artifact
uses: actions/upload-artifact@v7
with:
Expand All @@ -62,7 +62,7 @@ jobs:
build-windows:
name: "Build Windows Example App"
runs-on: windows-latest
needs: [ run-tests ]
needs: [run-tests]
if: github.repository == 'fleaflet/flutter_map'
defaults:
run:
Expand All @@ -75,7 +75,7 @@ jobs:
with:
cache: true
- name: Build Windows Application
run: flutter build windows --dart-define=COMMIT_SHA=${{ github.sha }} --dart-define=flutter.flutter_map.unblockOSM="${{ secrets.UNBLOCK_OSM }}"
run: flutter build windows --dart-define=COMMIT_SHA=${{ github.sha }}
- name: Install Inno Setup
run: choco install innosetup --yes --no-progress
- name: Create Windows Application Installer
Expand All @@ -91,7 +91,7 @@ jobs:
build-web:
name: "Build & Deploy Web Example App"
runs-on: ubuntu-latest
needs: [ run-tests ]
needs: [run-tests]
if: github.repository == 'fleaflet/flutter_map'
defaults:
run:
Expand All @@ -105,7 +105,7 @@ jobs:
channel: "stable"
cache: true
- name: Build Web Application
run: flutter build web --wasm --dart-define=COMMIT_SHA=${{ github.sha }} --dart-define=flutter.flutter_map.unblockOSM="${{ secrets.UNBLOCK_OSM }}"
run: flutter build web --wasm --dart-define=COMMIT_SHA=${{ github.sha }}
- name: Archive Artifact
uses: actions/upload-artifact@v7
with:
Expand All @@ -118,4 +118,4 @@ jobs:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_FLEAFLET }}"
channelId: live
projectId: fleaflet-firebase
projectId: fleaflet-firebase
33 changes: 26 additions & 7 deletions example/lib/pages/markers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ class _MarkerPageState extends State<MarkerPage> {
openStreetMapTileLayer,
MarkerLayer(
rotate: counterRotate,
markers: const [
Marker(
point: LatLng(47.18664724067855, -1.5436768515939427),
markers: [
const Marker(
point: LatLng(47.18664, -1.54367),
width: 64,
height: 64,
alignment: Alignment.centerLeft,
Expand All @@ -142,8 +142,8 @@ class _MarkerPageState extends State<MarkerPage> {
),
),
),
Marker(
point: LatLng(47.18664724067855, -1.5436768515939427),
const Marker(
point: LatLng(47.18664, -1.54367),
width: 64,
height: 64,
alignment: Alignment.centerRight,
Expand All @@ -155,11 +155,30 @@ class _MarkerPageState extends State<MarkerPage> {
),
),
),
Marker(
point: LatLng(47.18664724067855, -1.5436768515939427),
const Marker(
point: LatLng(47.18664, -1.54367),
rotate: false,
child: ColoredBox(color: Colors.black),
),
Marker(
point: const LatLng(
51.51868,
-0.12835,
),
height: 1000,
width: 1000,
useDimensionsInMeters: const BoxConstraints(
minHeight: 30,
minWidth: 30,
),
child: SizedBox.expand(
child: LayoutBuilder(
builder: (context, constraints) => DecoratedBox(
decoration: BoxDecoration(border: Border.all()),
),
),
),
),
],
),
MarkerLayer(
Expand Down
37 changes: 30 additions & 7 deletions lib/src/layer/marker_layer/marker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,45 @@ class Marker {
/// This key will get passed through to the created marker widget.
final Key? key;

/// Coordinates of the marker
/// Coordinates of the marker.
///
/// This will be the center of the marker, assuming that [alignment] is
/// [Alignment.center] (default).
final LatLng point;

/// Widget tree of the marker, sized by [width] & [height]
/// Widget tree of the marker, sized by [width] & [height].
///
/// The [Marker] itself is not a widget.
final Widget child;

/// Width of [child]
/// Width of child, in pixels (unless [useDimensionsInMeters] is set).
final double width;

/// Height of [child]
/// Height of child, in pixels (unless [useDimensionsInMeters] is set).
final double height;

/// Alignment of the marker relative to the normal center at [point]
/// Whether to treat [width] and [height] as meters, with optional pixel size
/// constraints.
///
/// If `null` (as default), [width] and [height] are specified in pixels.
///
/// If set to [BoxConstraints], [width] and [height] are specified in meters.
/// They will constrain size of the marker on the screen in pixels. The
/// constraints must have finite minimum dimensions.
///
/// Set an empty [BoxConstraints] to display the marker as its true
/// geographical size (without constraints):
///
/// ```dart
/// useDimensionsInMeters: const BoxConstraints(),
/// ```
///
/// When using geographical sizing, the child can use [SizedBox.expand] to
/// expand itself to the available size. [LayoutBuilder] can be used to obtain
/// its calculated screen size, if necessary.
final BoxConstraints? useDimensionsInMeters;

/// Alignment of the marker relative to the normal center at [point].
///
/// For example, [Alignment.topCenter] will mean the entire marker widget is
/// located above the [point].
Expand All @@ -39,7 +60,7 @@ class Marker {
final Alignment? alignment;

/// Whether to counter rotate this marker to the map's rotation, to keep a
/// fixed orientation
/// fixed orientation.
///
/// When `true`, this marker will always appear upright and vertical from the
/// user's perspective. Defaults to `false` if also unset by [MarkerLayer].
Expand All @@ -59,11 +80,13 @@ class Marker {
required this.child,
this.width = 30,
this.height = 30,
this.useDimensionsInMeters,
this.alignment,
this.rotate,
});

/// Returns the alignment of a [width]x[height] rectangle by [left]x[top] pixels.
/// Returns the alignment of a [width]x[height] rectangle by [left]x[top]
/// pixels.
static Alignment computePixelAlignment({
required final double width,
required final double height,
Expand Down
Loading
Loading