Snazzymaps

Permalink
Can I use color schemes fromhttp://snazzymaps.com/ in the Google map block? I know it is not an integral part of it, but is there a way?

djoniba
 
mesuva replied on at Permalink Reply
mesuva
This might help: http://www.mesuva.com.au/blog/concrete5/how-to-customise-the-appear...

I hadn't seen Snazzymaps, that's very cool. (might link it on my blog post!)
djoniba replied on at Permalink Reply
djoniba
Fantastic. Thanks a lot.

Found the site when looking for one page html templates (thinking about making my own site flat html instead of cms). One of the themes used this site for a grey map. very cool

http://startbootstrap.com/grayscale...
djoniba replied on at Permalink Reply
djoniba
Harder than I thought. I chose the map I liked and was presented with two blocks of code.
I am guessing I have to pick out the snippets I need to change the map in the may that you describe.

Care to point me in the right direction?

Here is the code to create the map:

var myOptions = {
    zoom: 15,
    center: new google.maps.LatLng(53.385873, -1.471471),
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    styles: [{"featureType":"water","elementType":"geometry","stylers":[{"color":"#193341"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#2c5a71"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#29768a"},{"lightness":-37}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#3e606f"},{"weight":2},{"gamma":0.84}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"weight":0.6},{"color":"#1a3541"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#2c5a71"}]}]
};
var map = new google.maps.Map(document.getElementById('map'), myOptions);


In addition there is a code for Java Script Style Array

[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#193341"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#2c5a71"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#29768a"},{"lightness":-37}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#3e606f"},{"weight":2},{"gamma":0.84}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"weight":0.6},{"color":"#1a3541"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#2c5a71"}]}]


Hmm. What to do.

Link to the map in question:http://snazzymaps.com/style/13/neutral-blue...
mesuva replied on at Permalink Reply
mesuva
Try to just follow my instructions exactly, then when you get to the bit where it talks about:

var styles = [];

just replace the [] with your javascript style array.

I don't think you need to consider the 'Create a map' piece of code Snazzymaps generates, just the array of the styles.
djoniba replied on at Permalink Reply
djoniba
Great. I'll give it a try. Thanks
djoniba replied on at Permalink Reply
djoniba
Cant seem to be able to change the colors. I noticed that I do not get color coding of var styles in Coda. Have I forgotten something?
Here is the code:

<?php 
   defined('C5_EXECUTE') or die("Access Denied.");
   class GoogleMapBlockController extends Concrete5_Controller_Block_GoogleMap {
      public function on_page_view() {
         $html = Loader::helper('html');
         $c = Page::getCurrentPage();
         if (!$c->isEditMode()) {
            $this->addFooterItem('<script type="text/javascript" src="//maps.google.com/maps/api/js?sensor=true"></script>');
            $this->addFooterItem('<script type="text/javascript"> 
            function googleMapInit' . $this->bID . '() { 
               try{
                 var latlng = new google.maps.LatLng(' . $this->latitude . ', ' . $this->longitude . ');
                   var styles = [{"featureType":"water","elementType":"geometry","stylers":[{"color":"#193341"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#2c5a71"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#29768a"},{"lightness":-37}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#3e606f"},{"weight":2},{"gamma":0.84}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"weight":0.6},{"color":"#1a3541"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#2c5a71"}]}]
                  var mapOptions = {
                   zoom: ' . $this->zoom . ',
mesuva replied on at Permalink Reply 1 Attachment
mesuva
See my attached, drop the folder into your top level blocks folder so you have /blocks/google_map/controller.php
mesuva replied on at Permalink Reply
mesuva
But just looking at your code, I think you're simply missing the semicolon at the end of your styles. It needs to end in

}];
djoniba replied on at Permalink Reply
djoniba
Fantastiv. Thanks a bunch. Just one question. I would like to remove the grids on the map (the strong white vertical and horizontal lines). I checked and discovered it is a css problem (how blocks are defined in the css). Can I make a custom css class just for the map?