<commit_before>== Google Maps for Rails  {<img src="http://www.pledgie.com/campaigns/23367.png" alt="Endorse" />}[https://pledgie.com/campaigns/23367]

{<img src="https://secure.travis-ci.org/apneadiving/Google-Maps-for-Rails.png?branch=master" alt="Build Status" />}[http://travis-ci.org/apneadiving/Google-Maps-for-Rails]
{<img src="https://codeclimate.com/github/apneadiving/Google-Maps-for-Rails.png" />}[https://codeclimate.com/github/apneadiving/Google-Maps-for-Rails]
{<img src="https://badge.fury.io/rb/gmaps4rails.png" alt="Gem Version" />}[http://badge.fury.io/rb/gmaps4rails]
{<img src="http://api.coderwall.com/apneadiving/endorsecount.png" alt="Endorse" />}[http://coderwall.com/apneadiving]
{<img src="https://d2weczhvl823v0.cloudfront.net/apneadiving/google-maps-for-rails/trend.png" alt="Bitdeli Badge" />}[https://bitdeli.com/free]

Gmaps4rails is developed to simply create a Google Map with overlays (markers, infowindows...).
Yet it's backed on a very flexible codebase which could be prone to accept other map providers.

Use it with any Ruby app (I guess you could simply take the js anywhere if you like).

{Here is a quick tutorial on youtube}[http://www.youtube.com/watch?v=R0l-7en3dUw&feature=youtu.be].

== A note for < 2.x users

Google-Maps-for-Rails-2.0 is an important rewrite to keep the minimum code and features. If
you're migrating from previous versions, you may want to read the {rational about it}[https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Why-but-why%3F].

== Requirements

1) Gemfile

    gem 'gmaps4rails'

2) HTML

Add a div to bear your map, example:

    <div style='width: 800px;'>
      <div id="map" style='width: 800px; height: 400px;'></div>
    </div>

2) Javascript Dependencies:

Insert google scripts in your dom:

    <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>

You'll require underscore.js too, see here: {http://underscorejs.org/}[http://underscorejs.org/]

3) Javascript source code

If you have the asset pipeline, add this:

    //= require underscore
    //= require gmaps/google

If you don't have asset pipeline, you'll need to import the js OR coffee files:

    rails g gmaps4rails:copy_js

    rails g gmaps4rails:copy_coffee

4) Javascript code:

Create your map:

    handler = Gmaps.build('Google');
    handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
      markers = handler.addMarkers([
        {
          "lat": 0,
          "lng": 0,<commit_msg>add speaker deck presentation<commit_after>== Google Maps for Rails  {<img src="http://www.pledgie.com/campaigns/23367.png" alt="Endorse" />}[https://pledgie.com/campaigns/23367]

{<img src="https://secure.travis-ci.org/apneadiving/Google-Maps-for-Rails.png?branch=master" alt="Build Status" />}[http://travis-ci.org/apneadiving/Google-Maps-for-Rails]
{<img src="https://codeclimate.com/github/apneadiving/Google-Maps-for-Rails.png" />}[https://codeclimate.com/github/apneadiving/Google-Maps-for-Rails]
{<img src="https://badge.fury.io/rb/gmaps4rails.png" alt="Gem Version" />}[http://badge.fury.io/rb/gmaps4rails]
{<img src="http://api.coderwall.com/apneadiving/endorsecount.png" alt="Endorse" />}[http://coderwall.com/apneadiving]
{<img src="https://d2weczhvl823v0.cloudfront.net/apneadiving/google-maps-for-rails/trend.png" alt="Bitdeli Badge" />}[https://bitdeli.com/free]

Gmaps4rails is developed to simply create a Google Map with overlays (markers, infowindows...).
Yet it's backed on a very flexible codebase which could be prone to accept other map providers.

Use it with any Ruby app (I guess you could simply take the js anywhere if you like).

{Here is a quick tutorial on youtube}[http://www.youtube.com/watch?v=R0l-7en3dUw&feature=youtu.be].
{and my presentation on speaker deck}[https://speakerdeck.com/apneadiving/gmaps4rails].



== A note for < 2.x users

Google-Maps-for-Rails-2.0 is an important rewrite to keep the minimum code and features. If
you're migrating from previous versions, you may want to read the {rational about it}[https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Why-but-why%3F].

== Requirements

1) Gemfile

    gem 'gmaps4rails'

2) HTML

Add a div to bear your map, example:

    <div style='width: 800px;'>
      <div id="map" style='width: 800px; height: 400px;'></div>
    </div>

2) Javascript Dependencies:

Insert google scripts in your dom:

    <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>

You'll require underscore.js too, see here: {http://underscorejs.org/}[http://underscorejs.org/] (`lo-dash` is compatible too, your choice!).

3) Javascript source code

If you have the asset pipeline, add this:

    //= require underscore
    //= require gmaps/google

If you don't have asset pipeline, you'll need to import the js OR coffee files:

    rails g gmaps4rails:copy_js

    rails g gmaps4rails:copy_coffee

4) Javascript code:

Create your map:

    handler = Gmaps.build('Google');
    handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
      markers = handler.addMarkers([
        {
          "lat": 0,
          "lng": 0,
{'fraction_non_alphanumeric': 0.15180983252296057, 'fraction_numerical': 0.0189086980010805, 'mean_word_length': 4.2297551789077215, 'pattern_counts': {'":': 4, '<': 33, '<?xml version=': 0, '>': 31, 'https://': 17, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6758395', 'n_tokens_mistral': 2044, 'n_tokens_neox': 1922, 'n_words': 458}