Styling Google Maps - JSON? (4 posts)

  1. rmgl
    Posted 2 years ago #

    I'm trying to get a styled google map to match my wordpress site's styling. I found this:
    That makes the map look exactly like I want, but I can't figure out where I'm supposed to put in the JSON code...



  2. bcworkz
    Posted 2 years ago #

    It goes on your map javascript, passed to the MapOptions object's style property.

  3. rmgl
    Posted 2 years ago #

    Thanks bcworkz, I'm really new to this so I don't really understand where that is...
    I'm using the google maps embed code, which I put in the page where I want the map to show. Where would I find the map javascript to put in the styling?

  4. bcworkz
    Posted 2 years ago #

    I see. I'm only familiar with the map API where the map is fully programmable via a javascript interface, which is what the JSON is intended for. I'm only vaguely aware of the embeddable version. I would be surprised if that version can accept JSON styling, but I will allow that it could be possible.

    Typically with embeds like this, you are very limited with what customizations you can apply. They typically are applied via URL parameters or embed tag attributes, I've yet to see one that accepts JSON input.

    You likely either need to be satisfied with the limited styling available to embeds, or learn how to implement the full API version. If you have any javascript experience, getting a map to display is fairly simple. Getting it to do exactly what you want can get quite involved, or not. It all depends on what you want your map to do. Simply applying JSON to the style shouldn't be too complicated.

Topic Closed

This topic has been closed to new replies.

About this Topic