Skip to content

Instantly share code, notes, and snippets.

View dmsmidt's full-sized avatar

Daniël Smidt dmsmidt

View GitHub Profile
@wouterds
wouterds / convert-mapstylejson-to-urlargs.php
Created January 27, 2015 14:42
Convert google maps style json to url arguments to use for google maps static images.
<?php
public function mapStylesUrlArgs($mapStyleJson)
{
$params = [];
foreach (json_decode($mapStyleJson, true) as $style) {
$styleString = '';
if (isset($style['stylers']) && count($style['stylers']) > 0) {