Skip to content

Instantly share code, notes, and snippets.

@anny-goerl
Created December 7, 2013 14:40
Show Gist options
  • Save anny-goerl/7843060 to your computer and use it in GitHub Desktop.
Save anny-goerl/7843060 to your computer and use it in GitHub Desktop.
JUG Gist
rails genarate scaffold user company name address:text picture
rails g gmaps4rails:copy_coffee
rails generate migration AddLatitudeAndLongitudeToUser latitude:float longitude:float
<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">
handler = Gmaps.build('Google');
handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
markers = handler.addMarkers([
{
"lat": 0,
"lng": 0,
"picture": {
"url": "https://addons.cdn.mozilla.net/img/uploads/addon_icons/13/13028-64.png",
"width": 36,
"height": 36
},
"infowindow": "hello!"
}
]);
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