matthiasdittmer / lat_lon_grid_plugin

Plugin to display a latitude / longitude grid on flutter_map.
MIT License
10 stars 5 forks source link

Degree #6

Open adam-ashored opened 3 years ago

adam-ashored commented 3 years ago

This is a valuable plugin! But what would make it more valuable is to specify what grid lines you want to see. For instance, I would like to display a "10 minute grid" - every 0.1 degree of lat/lng. I could envision an API that looks like this:

      MapPluginLatLonGridOptions(
        latDegrees: 1 // default - I could change this to be 0.1 to display a 10 minute grid
        lngDegrees: 1 //default
        // ...existing
      ),

Thoughts?

matthiasdittmer commented 3 years ago

The grid spacing depends on the zoom level so that between 5 and 7 lines are visible for latitude and longitude each. The current hard-coded solution in DD format only is not perfect.

For your "10 minute grid" additional logic is needed to define the spacing for lower and higher zoom levels to keep the line count in the reasonable range.

There should be a general solution supporting different degree formats with adaptive grid line spacing calculation: • Format choosable in DD, DDM, DMS (https://www.pgc.umn.edu/apps/convert/). • Optional a minimal/maximal grid spacing defined by the user. • Optional the number of spacing steps between all zoom levels.

It was not implemented last year.