Git Product home page Git Product logo

Comments (5)

greensopinion avatar greensopinion commented on June 24, 2024

from flutter-vector-map-tiles.

stolus902 avatar stolus902 commented on June 24, 2024

@greensopinion Hi, I mean to use vector tiles as a Widget, not only as Layer options, so FlutterMap has both layers and children property and I can eg. use TileLayerWidget in children or TileLayerOptions in layers and both behave the same way (because widget only accepts options). My use case is to build custom map abstraction when I can place markers, widgets, and stack it properly, and using children gives that flexibility. So I'd be very nice to have VectorTileLayerWidget that I can use in the widget tree, not only in layers. Can you support that?

from flutter-vector-map-tiles.

greensopinion avatar greensopinion commented on June 24, 2024

from flutter-vector-map-tiles.

Wackymax avatar Wackymax commented on June 24, 2024

Hi,

I am in the same situation as @stolus902 . All of my other layers are rendered as map children which is the new recommended way of handling layers in flutter_map, but map children are rendered beneath the old layers. Changing this should be fairly easy by adding a new file with the following contents and exposing it for public use.

class VectorTileLayerWidget extends StatelessWidget {
  final VectorTileLayerOptions options;

  const VectorTileLayerWidget({Key? key, required this.options})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    final mapState = MapState.maybeOf(context)!;
    return VectorTileLayer(options, mapState, mapState.onMoved);
  }
}

Using it would then be

FlutterMap(
...
      children: [
        const VectorTileLayerWidget(
            options: VectorTileLayerOptions(....)),
      ],
    ));

from flutter-vector-map-tiles.

greensopinion avatar greensopinion commented on June 24, 2024

Added widget-based layer, in version 1.0.22 https://pub.dev/packages/vector_map_tiles

from flutter-vector-map-tiles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.