-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I'm trying to port some code from the old Google API to your docker which uses the Perl package Geo::Google::StaticMaps::V2. The issue is that both center and zoom parameters are required for your API but, they were not required for the Google API. I request that you add the business logic to calculate reasonable defaults when not specified.
- To calculate a reasonable center, it could use the average of the bounding box e.g. avg(min(lat), max(lat)), avg(min(lon), max(lon))
- To calculate a reasonable zoom, from the bounding box, you might be able to reverse this process discussed at Stack Overflow
An example with hard coded zoom and center.
perl -MGeo::Google::StaticMaps::V2 -E '
my $lat = shift || 38.780676;
my $lon = shift || -77.387105;
my $zoom = shift || 14;
my $map = Geo::Google::StaticMaps::V2->new(server=>"localhost:3000", script=>"/map.png");
$map->marker(location=>{lat=>$lat, lon=>$lon});
$map->center(join(",", $lat, $lon));
$map->zoom($zoom);
say $map->url;
'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels