Last active
August 29, 2015 14:15
-
-
Save cigalecigales/b9db57f68d6bd6b8cb8f to your computer and use it in GitHub Desktop.
[*Rails*] GoogleMapの見た目をオシャレにしたい ref: http://qiita.com/cigalecigales/items/9dda1f67cea215c0feab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//maps.google.com/maps/api/js?v=3.13&sensor=false&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