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?
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...
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...
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:
In addition there is a code for Java Script Style Array
Hmm. What to do.
Link to the map in question:http://snazzymaps.com/style/13/neutral-blue...
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...
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.
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.
Great. I'll give it a try. Thanks
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:
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 . ',
Viewing 15 lines of 46 lines. View entire code block.
See my attached, drop the folder into your top level blocks folder so you have /blocks/google_map/controller.php
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
}];
}];
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?
I hadn't seen Snazzymaps, that's very cool. (might link it on my blog post!)