Skip to content

Instantly share code, notes, and snippets.

@cigalecigales
Last active August 29, 2015 14:15
Show Gist options
  • Save cigalecigales/b9db57f68d6bd6b8cb8f to your computer and use it in GitHub Desktop.
Save cigalecigales/b9db57f68d6bd6b8cb8f to your computer and use it in GitHub Desktop.
[*Rails*] GoogleMapの見た目をオシャレにしたい ref: http://qiita.com/cigalecigales/items/9dda1f67cea215c0feab
<script src="//maps.google.com/maps/api/js?v=3.13&amp;sensor=false&amp;libraries=geometry" type="text/javascript"></script>
<script src='//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js' type='text/javascript'></script>
<div style='width: 800px;'>
<div id="map" style='width: 800px; height: 400px;'></div>
</div>
<script type="text/javascript">
mapStyle = //使用したいSTYLEを貼り付ける
handler = Gmaps.build('Google');
handler.buildMap({ provider: {styles: mapStyle}, internal: {id: 'map'}}, function(){
markers = handler.addMarkers(<%=raw @hash.to_json %>);
handler.bounds.extendWith(markers);
handler.fitMapToBounds();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment