Maximum coordinates frames for SfMaps object

Hello community and congrats on the great product!

May I kindly ask for the coordinate frames we need to fit in when we draw different elements in SfMaps object.
Is it like google maps (-180:180 / -90:90) or it is something different?

Also when I try to draw polygon with coordinates like -180, -90 : 180, -90 : 180, 90 : -180,90 which I expect not to be quadrant - I have quadrant visualised on the screen.

Could you suggest what it the proper way to deal with the coordinate numbers within the SfMaps object.


Admirations once more for the great product, 
Venelin

3 Replies 1 reply marked as answer

LR Lakshmi Radha Krishnan Syncfusion Team June 2, 2021 06:06 PM UTC

Hi Venelin, 

 

Greetings from Syncfusion support. 

 

We would like to inform you that, we support both MapTileLayer and MapShapeLayer in the SfMaps. You can refer the below links to know about the features in both layers. 

 

Tile layer - https://help.syncfusion.com/flutter/maps/tile-layer 

Shape layer - https://help.syncfusion.com/flutter/maps/getting-started#set-geojson-data-for-shape-layer-from-various-source 

 

Query: Is it like google maps (-180:180 / -90:90) or it is something different? 

 

Yes, it is identical to google maps. You can draw shapes like line, arc, polyline, polygon, and circle over the map by specifying coordinates in this range (Latitude: -85 to 85 and Longitude: -180 to 180). In addition to that, we have drawn polygon using the provided coordinates and able to view polygon on the map. Kindly refer the below links to know more about the shapes.

 

https://help.syncfusion.com/flutter/maps/vector-layers/line-layer 

https://help.syncfusion.com/flutter/maps/vector-layers/arc-layer 

https://help.syncfusion.com/flutter/maps/vector-layers/polyline-layer 

https://help.syncfusion.com/flutter/maps/vector-layers/circle-layer 

https://help.syncfusion.com/flutter/maps/vector-layers/polygon-layer 

 

Code snippet: 

 
 class MapTileLayerPage extends StatefulWidget {
 
@override   _MapTileLayerPageState createState() => _MapTileLayerPageState(); }
class _MapTileLayerPageState extends State<MapTileLayerPage> {   late MapZoomPanBehavior zoomPanBehavior;   double _value = -180.0;  @override   void initState() {     zoomPanBehavior = MapZoomPanBehavior(zoomLevel: 1);     super.initState();   }
 
@override   Widget build(BuildContext context) {     return Scaffold(       appBar: AppBar(title: Text('MapTileLayer')),       body: Padding(         padding: const EdgeInsets.all(8.0),         child: Column(           children: [             Expanded(               child: SfMaps(                 layers: [                   MapTileLayer(                     urlTemplate:                         'https://tile.openstreetmap.org/{z}/{x}/{y}.png',                     zoomPanBehavior: zoomPanBehavior,                     sublayers: [                       MapPolygonLayer(                         polygons: List<MapPolygon>.generate(                           1,                           (int index) {                             return MapPolygon(                               points: <MapLatLng>[                                 MapLatLng(-90, _value),                                 MapLatLng(-90, 180),                                 MapLatLng(90, 180),                                 MapLatLng(90, _value),                               ],                             );                           },                         ).toSet(),                       ),                     ],                   ),                 ],               ),             ),             SizedBox(height: 20),             SfSlider(               min: -180.0,               max: 0.0,               value: _value,               interval: 30,               showLabels: true,               showTicks: true,               onChanged: (dynamic newValue) {                 setState(() {                   _value = newValue;                 });               },             ),           ],         ),       ),     );   } }

 

Kindly check the above code snippet and let us know if you need further assistance with this. 

 

Regards, 

Lakshmi R. 


Marked as answer

VS Venelin Spiridonov June 3, 2021 10:12 AM UTC

That's very cool.
Thanks for the clarification.


LR Lakshmi Radha Krishnan Syncfusion Team June 4, 2021 04:31 PM UTC

Hi Venelin,

Thanks for the confirmation. We are glad that the given suggestions cleared your concerns. Please let us know if you require any additional support.

Regards,

Lakshmi R.


Loader.
Up arrow icon