Skip to content

SfMaps and layers #12

Closed
Closed

Description

@Lima21

Hi :)
I'm trying to use two layers with SfMaps, however, after checking the code I saw that only show the last layer, it's supposed to happen?

https://github.com/syncfusion/flutter-widgets/blob/master/packages/syncfusion_flutter_maps/lib/src/maps.dart#L221

Stack(
              alignment: Alignment.center,
              children: <Widget>[widget.layers.last],
            ),

Activity

  1. LakshmiRadhaKrishnan commented on Oct 12, 2020

    @LakshmiRadhaKrishnan

    Hi Goncalo,

    Greetings from Syncfusion.

    We have logged the feature request for “Sub-layer support for tile layer” and it can be tracked through our feedback portal below.

    Feedback link: https://www.syncfusion.com/feedback/18668/sub-layer-support-for-tile-layer

    We have planned to include this feature in our upcoming Vol 4, 2020 release which is scheduled to be available in the mid of December, 2020.

    If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal.

    Disclaimer: The date for the feature implementation is tentative and not a commitment on our parts.

    Regards,
    Lakshmi R.

  2. LakshmiRadhaKrishnan commented on Dec 18, 2020

    @LakshmiRadhaKrishnan

    Hi,

    We are glad to announce that our Essential Studio 2020 Volume 4 release v18.4.0.30 is rolled out and is available for download under the following link.

    https://www.syncfusion.com/forums/160733/essential-studio-2020-volume-4-release-v18-4-0-30-is-available-for-download

    As we promised earlier, we have implemented the Shape sublayer feature and included in Volume 4, 2020 release (v18.4.0.30). Also, we have prepared sample for your requirement. Kindly check the attached sample.

    Feedback: https://www.syncfusion.com/feedback/18668/sub-layer-support-for-tile-layer

    Code Snippet:

    class _ShapeSublayerPageState extends State {
    MapZoomPanBehavior _zoomPanBehavior;
    MapShapeSource _source;
    int _selectedIndex = 12;
    List _dataModel;

    @OverRide
    void initState() {
    super.initState();
    _dataModel = [
    DataModel('Azores'),
    DataModel('Madeira'),
    DataModel('Aveiro'),
    DataModel('Leiria'),
    DataModel('Viana do Castelo'),
    DataModel('Beja'),
    DataModel('vora'),
    DataModel('Faro'),
    DataModel('Lisboa'),
    DataModel('Portalegre'),
    DataModel('Santarim'),
    DataModel('Braga'),
    DataModel('Braganca'),
    DataModel('Castelo Branco'),
    DataModel('Coimbra'),
    DataModel('Guarda'),
    DataModel('Porto'),
    DataModel('Viseu'),
    DataModel('Vila Real'),
    ];
    _zoomPanBehavior = MapZoomPanBehavior(
    focalLatLng: MapLatLng(39.916777, -8.07505),
    zoomLevel: 7,
    );
    _source = MapShapeSource.asset(
    'assets/portugal.json',
    shapeDataField: 'name',
    dataCount: _dataModel.length,
    primaryValueMapper: (int index) => _dataModel[index].primaryKey,
    );
    }

    @OverRide
    Widget build(BuildContext context) {
    return Scaffold(
    appBar: AppBar(
    title: const Text('Shape sublayer'),
    ),
    body: SfMaps(
    layers: [
    MapTileLayer(
    urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
    zoomPanBehavior: _zoomPanBehavior,
    sublayers: [
    MapShapeSublayer(
    source: _source,
    color: Colors.grey.withOpacity(0.5),
    strokeColor: Colors.black,
    strokeWidth: 2,
    selectedIndex: _selectedIndex,
    onSelectionChanged: (int index) {
    setState(() {
    _selectedIndex = index;
    });
    },
    selectionSettings: MapSelectionSettings(
    color: Colors.red.withOpacity(0.7),
    strokeColor: Colors.red[700],
    strokeWidth: 3,
    ),
    ),
    ],
    )
    ],
    ),
    );
    }
    }

    class DataModel {
    const DataModel(this.primaryKey);
    final String primaryKey;
    }

    shape-sublayer

    We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

    Regards,
    Lakshmi R.

  3. Lima21 commented on Dec 28, 2020

    @Lima21
    Author

    Hi, it solves my issue, thank you so much for your work!
    This package is awesome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions