PHP code example of poldixd / json-mapstyle-converter

1. Go to this page and download the library: Download poldixd/json-mapstyle-converter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

poldixd / json-mapstyle-converter example snippets


$converter = new poldixd\JsonMapstyleConverter\JsonMapstyleConverter();

echo $converter->convert('[{"elementType": "geometry", "stylers": [ { "color": "#212121"}]},{"elementType": "labels.icon","stylers": [ {"visibility": "off"}]}]');

// &style=element:geometry|color:0x212121&style=element:labels.icon|visibility:off