Nicat / StaticMap

MIT License
8 stars 2 forks source link

Remove scheme from the generated map link #2

Closed alexdpunkt closed 7 years ago

alexdpunkt commented 7 years ago

could you please remove the hardcoded http scheme from the generated URL:

$url = 'http://maps.googleapis.com/maps/api/staticmap?center=' . $center . $zoom . $size . $mapType . $imageFormat . $markers . $key;

This won't work in a HTTPS environment, since you load unsecure content with this staticmap image.

Without the scheme it works just fine in both HTTP and HTTPS as it uses the current scheme:

$url = '//maps.googleapis.com/maps/api/staticmap?center=' . $center . $zoom . $size . $mapType . $imageFormat . $markers . $key;

Nicat commented 7 years ago

@adick , you are right. Fixed. Thanks a lot!