Resources for Flutter App

108 views
Skip to first unread message
Assigned to procras...@gmail.com by david...@gmail.com

Marianne Hänggi

unread,
Feb 19, 2021, 4:18:30 AM2/19/21
to GeoAdmin API
Hey 
We are working on a flutter app which uses Swisstopo data for the map. We also want to show some trails (hiking, biking, ...) and the public transportation information.

Maybe somebody can help us with the following questions:
- How to integrate Swisstopo to flutter application that is cross-platform, is there any existing packages we can use?
- If there are no existing packages, what is the alternative to obtain Swisstopo maps on flutter since it is rendering native ios and android.
- Can we use geodataapi https://api3.geo.admin.ch/services/sdiservices.html , to render map data. If so, do you have any examples on how to accomplish this?

Many thanks. 
Marianne

Marc Monnerat

unread,
Feb 23, 2021, 8:55:31 AM2/23/21
to geoadmin-api
Hello,

I'm not familiar with Flutter or any native phone development framework. We are doing exclusively web developement

If you are interested in the raster data, these are served through the OGC WMTS protocol. Basically, if you have a module/package/plugins that serve Google/Bing/OSM maps, you may serve swisstopo tiles.

Something like https://pub.dev/documentation/syncfusion_flutter_maps may be suitable, as you may define your own 'urlTemplate' in the MapTileLayer class


  @override
  Widget build(BuildContext context) {
    return SfMaps(
      layers: [
        MapTileLayer(
          urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
          initialFocalLatLng: MapLatLng(-23.698042, 133.880753),
          initialZoomLevel: 3
        ),
      ],
    );
  }
Alternatively, if you have a Web widget in Flutter, you may use it to display a Web application based on a Web mapping framework like OpenLayers. I don't know if it makes sens.

These Raster OGC WMTS data are defined: https://api3.geo.admin.ch/services/sdiservices.html#wmts

Regards,

Marc Monnerat


--
You received this message because you are subscribed to the Google Groups "GeoAdmin API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/a0a1549e-c3c4-4cde-9105-a876db2174fcn%40googlegroups.com.


--
-- ἡ φύσις οὐδὲν ποιεῖ ἅλματα.

Marianne Hänggi

unread,
Feb 25, 2021, 11:26:38 AM2/25/21
to GeoAdmin API
Many thanks! We will test this approach in the next weeks. 
Best
Marianne

Marianne Hänggi

unread,
May 3, 2021, 9:14:06 AM5/3/21
to GeoAdminCh API
Hi
we made some progress with our Flutter app.
We used the following link to display the map

Now we want to add some layers on this map like e.g. http://map3.geo.admin.ch/?layers=ch.astra.mountainbikeland and also we would like to show the map also as a satelite version. 

Can you help us with finding or creating similar jpeg files for the layers? Or is there a better way to intergrate them?
Many thanks!

Best
Marianne

Marc Monnerat schrieb am Dienstag, 23. Februar 2021 um 14:55:31 UTC+1:

Marianne Hänggi

unread,
Jul 7, 2021, 7:19:28 AM7/7/21
to GeoAdminCh API

Dear Marc

Many thanks for your help.

We found the information we needed with the help of the link you provided me. We used the information from https://wmts.geo.admin.ch/1.0.0/WMTSCapabilities.xml

however we get a server error.

Eg we took:

https://wmts.geo.admin.ch/1.0.0/ch.astra.mountainbikeland/default/{Time}/21781/{TileMatrix}/{TileRow}/{TileCol}.png

And translate it to the format we need which is:

https://wmts.geo.admin.ch/1.0.0/ch.astra.mountainbikeland/default/{Time}/21781/{z}/{x}/{y}.png

Unfortunately this returns an server error 400 (not found server) However we found the below link at another location (it was an example of a simple code as described in another post) and this one works.

https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857/{z}/{x}/{y}.jpeg

Do you maybe have an idea who could provide us the right location for the data above in that format? We are looking for Mountaibikeland schweiz, Veloland Schweiz and öV Haltestellen

Many thanks.

Best

Marianne 



Marc Monnerat schrieb am Dienstag, 23. Februar 2021 um 14:55:31 UTC+1:

GeoAdminCh API

unread,
Jul 8, 2021, 8:29:52 AM7/8/21
to GeoAdminCh API
Hello Marianne,

Your HTTP 400 error means that you are requesting a tile that is outside the extent (basically outside Switzerland). Looking at your examples, I still do not know which projection/tiling schemes/pyramid you are using. 

To see the tiles addresses in Web Mercator (tiling scheme used by OSM and the most used web mapping applications) you may use this example :


Hope it helps, 

Regards,

Marc

Reply all
Reply to author
Forward
0 new messages