GithubHelp home page GithubHelp logo

kikbal / geocoder_google_maps Goto Github PK

View Code? Open in Web Editor NEW

This project forked from equivalent/geocoder_google_maps

0.0 2.0 0.0 180 KB

Easiest possible implementation of google maps into geocoder gem (or just longitude latitude attributes)

License: MIT License

geocoder_google_maps's Introduction

GeocoderGoogleMaps

For the laziest developers. Simple gem/rails-engine that will easily make support for Google Maps working with your Longitude, Latitude coordinates

Geocoder gem isn't necessarily required

Install

add to Gemfile:

gem 'geocoder_google_maps', github: 'equivalent/geocoder_google_maps'

and run

bundle install

Prepare your app

app/controllers/application_controller.rb

class ApplicationController < ActionController::Base
  helper GeocoderGoogleMaps::Engine.helpers
  # ...

app/views/layouts/application.haml

%head
  ...
  = google_map_api
  ...

or

%head
  ...
  <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
  ...

app/assets/javascripts/application.js

//= require geocoder_google_maps/application

app/assets/stylesheets/application.css

@import 'geocoder_google_maps/application'

or

*= require 'geocoder_google_maps/application'

Usage

Gem is listening for div element with class geocoder-google-maps and its data attributes data-longitude, data-latitude and data-zoom

<div class="geocoder-google-maps" data-latitude="49.2247531" data-longitude="17.6727531" data-zoom="15"></div>

This div can be generated by a built in helper google_map_div(latitude, longitude)

= google_map_div("49.2247531", "17.6727531")
= google_map_div("49.2247531", "17.6727531", zoom: 11)

After this div is found, Google Maps API script will trigger and translate this div into map.

This project sucks, I mean rocks and uses MIT-LICENSE.

Contributing

as usual, fork, create branch with your changes, push and do pull request.

Where are tests ?

Seriously? Look at the code it's two one line helpers and piece of junkie JavaScript ๐Ÿ’ฉ

geocoder_google_maps's People

Contributors

equivalent avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.