首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >颤动贴图框多段线贴图

颤动贴图框多段线贴图
EN

Stack Overflow用户
提问于 2020-08-01 16:24:46
回答 1查看 1.5K关注 0票数 1

我正在尝试使用mapbox创建折线地图,我可以正确地创建它。用户可以返回并在其配置文件中看到折线地图。

怀疑--有没有什么方法可以将我long列表转换成某种格式并存储在db中,然后我们从db中获取它并渲染map?

我也检查了geojson格式,但如果我们在mapbox中使用geoJson,它会生成静态地图。

我正在使用flutter_map生成地图。

更新-

代码语言:javascript
复制
var geoJson =   {
              "type": "polyline",
              "coordinates": [
                [
                  76.61219358444214,
                  27.555764420824236
                ],
                [
                  76.6120433807373,
                  27.55395717009122
                ],
                [
                  76.61094903945923,
                  27.55285378133631
                ],
                [
                  76.61021947860718,
                  27.55138892051556
                ],
                [
                  76.61000490188599,
                  27.550285505956428
                ],
                [
                  76.6101336479187,
                  27.549372326903264
                ],
                [
                  76.6107988357544,
                  27.548287916916344
                ],
                [
                  76.61150693893433,
                  27.547831320034653
                ],
                [
                  76.61109924316406,
                  27.54568148421033
                ],
                [
                  76.61097049713135,
                  27.54391211873852
                ]
              ]
            }

目前我正在使用flutter_map包,并使用下面的代码来渲染地图。

代码语言:javascript
复制
var points =  [LatLng(latitude:27.591585, longitude:76.61139), LatLng(latitude:27.591548, longitude:76.611397), LatLng(latitude:27.591473, longitude:76.611407), LatLng(latitude:27.591437, longitude:76.611413), LatLng(latitude:27.591362, longitude:76.611425), LatLng(latitude:27.591325, longitude:76.61143), LatLng(latitude:27.59125, longitude:76.611442), LatLng(latitude:27.591177, longitude:76.611452), LatLng(latitude:27.59114, longitude:76.611458), LatLng(latitude:27.591065, longitude:76.61147), LatLng(latitude:27.591028, longitude:76.611475), LatLng(latitude:27.591007, longitude:76.611587), LatLng(latitude:27.591013, longitude:76.611693), LatLng(latitude:27.590777, longitude:76.611805), LatLng(latitude:27.590657, longitude:76.611822), LatLng(latitude:27.590535, longitude:76.61184), LatLng(latitude:27.590413, longitude:76.611857), LatLng(latitude:27.590293, longitude:76.611875), LatLng(latitude:27.590172, longitude:76.611892)]



return new Scaffold(
        appBar: new AppBar(title: new Text('Leaflet Maps')),
        body: new FlutterMap(
            options: new MapOptions(
                center:  new LatLng(27.563896, 76.600460), minZoom: 10.0),
            layers: [
              new TileLayerOptions(
                  urlTemplate:
             "https://api.mapbox.com/styles/v1/jainaman8/ckd5v8bs00zm01ir3w3bjrrb3/tiles/256/{z}/{x}/{y}@2x?access_token=ACCESS_TOKEN",
                  additionalOptions: {
                    'accessToken': '',
                    'id': 'mapbox.mapbox-streets-v8'
                  }
              ),

            new PolylineLayerOptions(
              polylines: [
                new Polyline(
                  points: points,
                  strokeWidth: 2.0,
                  color:  Colors.red
                )
              ]
            )

我想将geoJson对象存储到firebase中,然后从那里提取这些数据,并使用mapbox渲染地图。

我在google上看到firebase不支持数组,所以另一个疑问是我如何在firebase上存储这些数据?

EN

回答 1

Stack Overflow用户

发布于 2021-07-03 18:39:20

您可以通过收集类型为geopoint的字段,然后在flutter项目中获取这些字段来完成所需的操作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63203226

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档