Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yaml and/or XML config file for custom mapstyles #217

Open
jrswgtr opened this issue Aug 16, 2017 · 3 comments
Open

Yaml and/or XML config file for custom mapstyles #217

jrswgtr opened this issue Aug 16, 2017 · 3 comments

Comments

@jrswgtr
Copy link

jrswgtr commented Aug 16, 2017

I am currently working on a nice method to store custom mapstyles in Yaml files. This way you can make multiple configurations in a single or multiple files. Since the Symfony config component also takes XML files, they will be supported too.

If you are interested I can post it here when it is finished. Then you can take a look at it. If you like it you can consider using it.

@egeloen
Copy link
Owner

egeloen commented Aug 16, 2017

👍 Share your code and will look to it with interest :)

@jrswgtr
Copy link
Author

jrswgtr commented Aug 17, 2017

Okay then I will. It can take a while because I am also really busy with work stuff.

@jrswgtr
Copy link
Author

jrswgtr commented Aug 17, 2017

The tree will look something like this:

mapstyles:

    my_mapstyle:

        - featureType: 'water'
          elementType: 'all'
          stylers:
              - color: '#bbdefb'

        - featureType: 'road'
          stylers:
              - visibility: 'off'

        - featureType: 'administrative'
          elementType: 'labels.text.fill'
          stylers:
              - color: '#ffffff'
              - weight: 3

For static maps like this:

static_mapstyles:

    my_static_mapstyle:

        - feature: 'road'
          visibility: 'off'

        - feature: 'water'
          color: '0xbbdefb'

        - feature: 'administrative'
          element: 'labels.text.fill'
          color: '0xffffff'
          weight: 3

These will result in ready-to-go arrays for google maps styles. I still have to write the configuration class with the treebuilder for validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants