diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml deleted file mode 100644 index 926d4df1..00000000 --- a/.github/workflows/build-docs.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Generate docs - -on: - push: - branches: [ main ] - -jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - defaults: - run: - working-directory: docs - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 - # Can't use cache because build fails with "Dependencies lock file is not found" - # with: - # cache: yarn - - name: Install dependencies - run: yarn install --frozen-lockfile --non-interactive - - name: Build - run: yarn build - - name: Deploy to GitHub Pages - if: github.repository_owner == 'josxha' - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/build - keep_files: true \ No newline at end of file diff --git a/.github/workflows/check-docs.yml b/.github/workflows/docs.yml similarity index 61% rename from .github/workflows/check-docs.yml rename to .github/workflows/docs.yml index e087dea4..36dc27c0 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/docs.yml @@ -6,6 +6,11 @@ on: pull_request: workflow_dispatch: +# Ensure that new pushes/updates cancel running jobs +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build: defaults: @@ -17,10 +22,9 @@ jobs: uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 - # Can't use cache because build fails with "Dependencies lock file is not found" - # with: - # cache: yarn +# with: +# cache: yarn - name: Install dependencies - run: yarn install --frozen-lockfile --non-interactive + run: yarn install --immutable - name: Build run: yarn build \ No newline at end of file diff --git a/.github/workflows/flutter-ci.yml b/.github/workflows/flutter-ci.yml index 42185030..8e760e52 100644 --- a/.github/workflows/flutter-ci.yml +++ b/.github/workflows/flutter-ci.yml @@ -114,11 +114,3 @@ jobs: run: dart pub get - name: Build web run: flutter build web -# - name: Deploy to GitHub Pages -# if: github.repository_owner == 'josxha' -# uses: peaceiris/actions-gh-pages@v4 -# with: -# github_token: ${{ secrets.GITHUB_TOKEN }} -# publish_dir: example/build/web -# destination_dir: demo -# keep_files: true \ No newline at end of file diff --git a/.pubignore b/.pubignore new file mode 100644 index 00000000..36253cf1 --- /dev/null +++ b/.pubignore @@ -0,0 +1,3 @@ +docs/ +example/assets/ +pigeons/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 67b5cb31..cf1329e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ -## 0.1.0 +## 0.0.1 -* TODO: Describe initial release. +### New features + +- Initial release +- Implement map for android and web +- Add docs diff --git a/README.md b/README.md index 74b88803..f03f28e4 100644 --- a/README.md +++ b/README.md @@ -9,59 +9,58 @@ [![stars](https://badgen.net/github/stars/josxha/flutter-maplibre?label=stars&color=green&icon=github)](https://github.com/josxha/flutter-maplibre/stargazers) [![GitHub issues](https://img.shields.io/github/issues/josxha/flutter-maplibre)](https://github.com/josxha/flutter-maplibre/issues) -This package provides unofficial Flutter bindings for MapLibre libraries. +This package provides unofficial Flutter bindings for MapLibre SDKs. - [maplibre-gl-js](https://github.com/maplibre/maplibre-gl-js) is used for web - [maplibre-native](https://github.com/maplibre/maplibre-native) (previously named maplibre-gl) is used for android and in the future for iOS, windows, macOS and Linux -### What is the difference to [maplibre_gl](https://pub.dev/packages/maplibre_gl)? - -Both, `maplibre_gl` and `maplibre` try to solve the same purpose to create -bindings between the -platform specific MapLibre SDK and Flutter. `maplibre_gl` is a fork -of `mapbox_gl` and already some -years around. `maplibre` on the other hand is a brand new and fresh -implementation. It tries to -provide the following improvements: - -1. A WebAssembly compatible web implementation using the new JavaScript interop - from `package:web` - and `js_interop`. -2. Zero cost JavaScript interop - using [extension types](https://dart.dev/language/extension-types) - that got delivered - in [Dart 3.3](https://medium.com/dartlang/dart-3-3-325bf2bf6c13). -3. More type safety and reducing the amount of platform custom code using code - generation with [pigeon](https://pub.dev/packages/pigeon). -4. No legacy code or workarounds in the code base (with the risk of not yet - including necessary - fixes). -5. Get rid of code where the licensing is not clear. For example some files - have - a `Copyright 2018 The Chromium Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.` - header but the LICENSE file doesn't mention it. -6. Using Kotlin instead of Java to benefit from null safety and reduce potential - NullPointerExceptions. -7. Keep all platforms in one package to simplify the release cycle. Having - multiple packages is a potential cause of bugs (e.g. - https://github.com/maplibre/flutter-maplibre-gl/pull/476) -8. Use [geotypes](https://pub.dev/packages/geotypes) which are - GeoJSON compatible - ([RFC 7946](https://datatracker.ietf.org/doc/html/rfc7946) compliant). This - makes it compatible with all the functionality - from [dart_turf](https://pub.dev/packages/turf). - from [dart_turf](https://pub.dev/packages/turf). +MapLibre is a permissive and open source solution for the MVT +(Mapbox Vector Tile) standard. By binding to native SDKs the package +accomplishes performant rendering while supporting a lot of complex +functionality. + +
Use custom styles for your map | +Tilt or rotate your map | + + +
---|---|
+ | + |
1024,I&&(t.dump&&Nw===t.dump.charCodeAt(0)?v+="?":v+="? "),v+=t.dump,I&&(v+=aT(t,e)),z0(t,e+1,E,!0,I)&&(t.dump&&Nw===t.dump.charCodeAt(0)?v+=":":v+=": ",v+=t.dump,a+=v));t.tag=n,t.dump=a||"{}"}function kK(t,e,r){var o,a,n,u,A,p;for(a=r?t.explicitTypes:t.implicitTypes,n=0,u=a.length;n tag resolver accepts not "'+p+'" style');t.dump=o}return!0}return!1}function z0(t,e,r,o,a,n){t.tag=null,t.dump=r,kK(t,r,!1)||kK(t,r,!0);var u=QK.call(t.dump);o&&(o=t.flowLevel<0||t.flowLevel>e);var A=u==="[object Object]"||u==="[object Array]",p,h;if(A&&(p=t.duplicates.indexOf(r),h=p!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(a=!1),h&&t.usedDuplicates[p])t.dump="*ref_"+p;else{if(A&&h&&!t.usedDuplicates[p]&&(t.usedDuplicates[p]=!0),u==="[object Object]")o&&Object.keys(t.dump).length!==0?(_6e(t,e,t.dump,a),h&&(t.dump="&ref_"+p+t.dump)):(U6e(t,e,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump));else if(u==="[object Array]"){var E=t.noArrayIndent&&e>0?e-1:e;o&&t.dump.length!==0?(O6e(t,E,t.dump,a),h&&(t.dump="&ref_"+p+t.dump)):(M6e(t,E,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump))}else if(u==="[object String]")t.tag!=="?"&&T6e(t,t.dump,e,n);else{if(t.skipInvalid)return!1;throw new Mw("unacceptable kind of an object to dump "+u)}t.tag!==null&&t.tag!=="?"&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function H6e(t,e){var r=[],o=[],a,n;for(lT(t,r,o),a=0,n=o.length;a {var n,u;if(Object.getPrototypeOf(o).toString()==="[object Set]")if(typeof a?.coercions<"u"){if(typeof a?.coercion>"u")return pr(a,"Unbound coercion result");let A=[...o],p=[...o];if(!r(p,Object.assign(Object.assign({},a),{coercion:void 0})))return!1;let h=()=>p.some((E,I)=>E!==A[I])?new Set(p):o;return a.coercions.push([(n=a.p)!==null&&n!==void 0?n:".",Hw(a.coercion,o,h)]),!0}else{let A=!0;for(let p of o)if(A=t(p,Object.assign({},a))&&A,!A&&a?.errors==null)break;return A}if(typeof a?.coercions<"u"){if(typeof a?.coercion>"u")return pr(a,"Unbound coercion result");let A={value:o};return r(o,Object.assign(Object.assign({},a),{coercion:Wu(A,"value")}))?(a.coercions.push([(u=a.p)!==null&&u!==void 0?u:".",Hw(a.coercion,o,()=>new Set(A.value))]),!0):!1}return pr(a,`Expected a set (got ${qn(o)})`)}})}function uqe(t,e){let r=qD(jD([t,e])),o=GD(e,{keys:t});return Hr({test:(a,n)=>{var u,A,p;if(Object.getPrototypeOf(a).toString()==="[object Map]")if(typeof n?.coercions<"u"){if(typeof n?.coercion>"u")return pr(n,"Unbound coercion result");let h=[...a],E=[...a];if(!r(E,Object.assign(Object.assign({},n),{coercion:void 0})))return!1;let I=()=>E.some((v,x)=>v[0]!==h[x][0]||v[1]!==h[x][1])?new Map(E):a;return n.coercions.push([(u=n.p)!==null&&u!==void 0?u:".",Hw(n.coercion,a,I)]),!0}else{let h=!0;for(let[E,I]of a)if(h=t(E,Object.assign({},n))&&h,!h&&n?.errors==null||(h=e(I,Object.assign(Object.assign({},n),{p:jp(n,E)}))&&h,!h&&n?.errors==null))break;return h}if(typeof n?.coercions<"u"){if(typeof n?.coercion>"u")return pr(n,"Unbound coercion result");let h={value:a};return Array.isArray(a)?r(a,Object.assign(Object.assign({},n),{coercion:void 0}))?(n.coercions.push([(A=n.p)!==null&&A!==void 0?A:".",Hw(n.coercion,a,()=>new Map(h.value))]),!0):!1:o(a,Object.assign(Object.assign({},n),{coercion:Wu(h,"value")}))?(n.coercions.push([(p=n.p)!==null&&p!==void 0?p:".",Hw(n.coercion,a,()=>new Map(Object.entries(h.value)))]),!0):!1}return pr(n,`Expected a map (got ${qn(a)})`)}})}function jD(t,{delimiter:e}={}){let r=dV(t.length);return Hr({test:(o,a)=>{var n;if(typeof o=="string"&&typeof e<"u"&&typeof a?.coercions<"u"){if(typeof a?.coercion>"u")return pr(a,"Unbound coercion result");o=o.split(e),a.coercions.push([(n=a.p)!==null&&n!==void 0?n:".",a.coercion.bind(null,o)])}if(!Array.isArray(o))return pr(a,`Expected a tuple (got ${qn(o)})`);let u=r(o,Object.assign({},a));for(let A=0,p=o.length;A {var n;if(Array.isArray(o)&&typeof a?.coercions<"u")return typeof a?.coercion>"u"?pr(a,"Unbound coercion result"):r(o,Object.assign(Object.assign({},a),{coercion:void 0}))?(o=Object.fromEntries(o),a.coercions.push([(n=a.p)!==null&&n!==void 0?n:".",a.coercion.bind(null,o)]),!0):!1;if(typeof o!="object"||o===null)return pr(a,`Expected an object (got ${qn(o)})`);let u=Object.keys(o),A=!0;for(let p=0,h=u.length;p `:`[${x}]`)}o.push(...this.arity.leading.map(u=>`<${u}>`)),this.arity.extra===rl?o.push("..."):o.push(...this.arity.extra.map(u=>`[${u}]`)),o.push(...this.arity.trailing.map(u=>`<${u}>`))}return{usage:o.join(" "),options:a}}compile(){if(typeof this.context>"u")throw new Error("Assertion failed: No context attached");let e=yV(),r=un.InitialNode,o=this.usage().usage,a=this.options.filter(A=>A.required).map(A=>A.nameSet);r=Oc(e,tl()),zo(e,un.InitialNode,Hn.StartOfInput,r,["setCandidateState",{candidateUsage:o,requiredOptions:a}]);let n=this.arity.proxy?"always":"isNotOptionLike",u=this.paths.length>0?this.paths:[[]];for(let A of u){let p=r;if(A.length>0){let v=Oc(e,tl());am(e,p,v),this.registerOptions(e,v),p=v}for(let v=0;v