Reputation: 18550
I'm trying to apply custom styling to a Google Map with the Store Locator Plus plugin for WordPress. I found a support thread where someone was able to apply custom styles to the map using this bit of code:
<script>
$(window).load(function (){
var mapStyles = [{ "stylers": [{ "hue": '#ff0000'}, { "lightness": -1} ]}];
loaded_map = window.cslmap.gmap;
loaded_map.setOptions({ styles:mapStyles});
});
</script>
For some reason gmap
keeps returning as null
for me, so the script doesn't work. I've tried rooting around in the plugin's JavaScript, and I see the gmap
stuff, but I can't figure out why this isn't working.
My testing page: http://lombard.myweblinx.net/?page_id=2
Link to the plugin's JavaScript: http://lombard.myweblinx.net/wp-content/plugins/store-locator-le/js/slp.js?ver=4.1.01
Upvotes: 1
Views: 971
Reputation: 117354
Invoke the function at the end of __buildMap()
(that's the point where you can be sure that cslmap
has been initialized)
Upvotes: 1