Styling the Cornerstone Maps element

Hello!

I have included the Maps element on my homepage to showcase store locations, i was wondering if there’s a practical way to style the map like the standard Google Maps embedded plugins (change colors, what to show and not to show).

If i create a JSON style on the Google Maps Styling wizard and copy/paste it into the JSON Style field in Cornerstone, the map then disappears from the preview.

Also, i was wondering if there’s a more practical way of adding locations by adding their google maps URL, instead of manually adding the coordinates and name fields for each one.

Thank you!

Hi There,

Thanks for the update!
The mentioned map styling issue via JSON is a known bug and It has been fixed in our development cycle and will be released in next update.

For the time you can fix it by replacing a single line of code.
Please go to
pro/cornerstone/includes/elements/mixins/map.php

Replace this line
'map_google_styles' => x_module_value( '', 'markup' ),
with
'map_google_styles' => x_module_value( '', 'markup:raw' ),

For X theme the path would be cornerstone/includes/elements/mixins/map.php

Hope this helps!

Thanks

Thanks a lot for your quick reply.

That fixed the issue!

I have a question that is less related to the theme itself and more to google maps javascript api.

Are you aware of an easier way to add markers by their google maps URL (business/store) rather than by their coordinates?

Thank you.

Hello there,

Glad to hear that! :slight_smile:

Yes, that’s Geocoding. Kindly check the link from Google Maps API below for more info:

https://developers.google.com/maps/documentation/javascript/geocoding

I have already added this to our list of feature requests. This request however, will be taken into consideration for future development. All of the requests are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.