Coder Social home page Coder Social logo

map.js's Introduction

#map.js Draw google map easily. No need to include Google Maps API, it is automatically included by the plugin.

##Dependency

  1. jQuery 1.4+

##Functions drawMap: Show an address at the specified location.

loadMarkers: Show a list of markers in the map.

getDirections: Show direction from one address to another.

##Usage

####Using jQuery

drawMap

$('.map-container').drawMap({
	address: "California, USA",
	markerContent: "California",
	mapType: "roadmap",
	zoom: 14
});

loadMarkers

$('.map-container').loadMarkers({
	markers: [{
		lat: "35.4949825",
		lng: "-116.1445962",
		title: "Los Angeles",
		markerContent:"Los Angeles, CA"
	},
	{
		lat: "25.790534",
		lng: "-80.206600",
		title: "Miami",
		markerContent:"Miami, FL"
	}]
});

getDirections

$('.map-container').getDirections({
	"from": "Sayedabad, Dhaka, Bangladesh",
	"to": "Kolatoli Rd, Cox's Bazar, Bangladesh",
	"directionsPane": "map_directions"
});

####Using data- attribute

drawMap

<div class="map-container"
	data-map="location"
	data-address="Dhaka, Bangladesh"
	data-marker-content="Dhaka"
	data-map-type="roadmap"
	data-zoom="14"
	data-street-view-control="true">
</div>

loadMarkers

<div class="map-container"
	data-map="pointers"
	data-markers='[{"lat":"35.4949825","lng":"-116.1445962","title":"Los Angeles","markerContent":"Los Angeles, CA"},
				{"lat":"25.790534","lng":"-80.206600","title":"Miami","markerContent":"Miami, FL"},
				{"lat":"40.721724","lng":"-73.997780","title":"NewYork","markerContent":"New York, NY"}]'>
</div>

getDirections

<div class="map-container"
	data-map="direction"
	data-from="Matuail, Jatrabari, Dhaka, Bangladesh"
	data-to="15 New Baily Road, Dhaka, Bangladesh"
	data-directions-pane="map_directions">
</div>

map.js's People

Contributors

shihabahmed avatar

Watchers

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.