2 ms·
mapstore.Add_Lat_Lng(40, -70) mapstore.Add_Lng_Lat(-70, 40) mapstore.Add_LatLng( []float64{ 40, -70 } ) Few minor gripes for the Go code; don't use undersc
by mutatio 12y ago
mapstore.Add_Lat_Lng(40, -70)
mapstore.Add_Lng_Lat(-70, 40)
mapstore.Add_LatLng( []float64{ 40, -70 } )
Few minor gripes for the Go code; don't use underscores and don't provide method signatures for all arrangements of values, all you need is mapstore.AddLatLng(x, y)
- mapmeld 12y agoHow can I differentiate the functions for adding {40, -70} and two parameters 40, -70? Both would be AddLatLng. I've asked the Go community about this before, and the suggestion was to create a Location object with latitude and longitude. This is the type of specialized API that I am trying to avoid. A developer should be able to chuck their existing data at MapPLZ and get back a geo point.
- mutatio 12y agoUser's responsibility: mapstore.AddLatLng(ll[0], ll[1]) Or: mapstore.Add([]float64) / mapstore.AddLatLngPair([]float64) // or some variation of A lat/lon struct would also be good, removes validation of the float slice etc.