Coder Social home page Coder Social logo

jquery-findus's Introduction

jquery-findus

Create contact-maps easily.

A jquery-plugin that lets you quickly build a customizable map without hassling with google maps api.

Demo

Install

Include js dependencies

<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://maps.googleapis.com/maps/api/js"></script>
<script src="js/jquery.findus.min.js"></script>

Optionally include css

<link rel="stylesheet" href="css/jquery.findus.css">

Usage

Provide geocodeable content

<div class="findus">
  <h4>Find us here</h4>
  8411 Market Street<br/>
  San Francisco<br/>
  CA 94103<br/>
  USA
</div>

Initialize findus

$(function() {
  $('.findus').findus();
});

Examples

Provide location

You may also reverse-geocode an address from a location:

<div class="findus" data-latitude="37.77485730000001" data-longitude="-122.41962339999998"></div>
Provide location and content

To avoid the geocoding service completely, provide both, an location and some content to show up in the map's info-window.

<div class="findus" data-latitude="37.77485730000001" data-longitude="-122.41962339999998">
  <h4>Find us here</h4>
  <p>
    8411 Market Street<br/>
    San Francisco<br/>
    CA 94103<br/>
    USA
  </p>
</div>

Options

You can also use data-attributes to setup the component. Target subsets by using prefixes, such as 'marker-icon'.

NameDescription
addressA geocodeable address string
autoShowSpecifies whether to show info-window on render. Defaults to true.
bindResizeSpecifies whether to bind window resize. Defaults to true.
contentHTML content to be shown in info-window. A geocodeable string can be explicitly defined by containing it in an address-tag.
latitudeLocation coordinate latitude
longitudeLocation coordinate longitude
infoOptions passed to the info-window instance
mapOptions passed to the map instance. Defaults to
{
  zoom: 15,
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  disableDefaultUI: true,
  draggable: false,
  zoomControl: false,
  scrollwheel: false,
  disableDoubleClickZoom: true
}
markerOptions passed to the marker instance

Changelog

Master

  • Optimize content geocoding

v0.0.5

  • Added fix for map-icons

v0.0.4

  • Set map option 'draggable' to false by default

v0.0.3

  • Fixed too strict jquery dependency

v0.0.2

  • Added prefixed data-attributes.
  • Changed zoom default to 14.
  • Draggable map by default.

v0.0.1

  • Initial Release

jquery-findus's People

Contributors

rexblack avatar

Stargazers

Chiung-Hung Lai avatar Hiroki Tani avatar

Watchers

 avatar James Cloos 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.