All Projects → coderiver → EasyGoogleMaps

coderiver / EasyGoogleMaps

Licence: MIT license
No description or website provided.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to EasyGoogleMaps

flutter google maps
A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web.
Stars: ✭ 86 (+244%)
Mutual labels:  google-maps
Google-Maps-BottomSheet
A BottomSheetBehavior framework mirroring Google Maps'
Stars: ✭ 75 (+200%)
Mutual labels:  google-maps
mapzap.github.io
Build custom responsive web mapping applications without any coding!
Stars: ✭ 22 (-12%)
Mutual labels:  google-maps
gpedal
Virtually ride indoors with Google Street View and bluetooth bike power meters (Web Bluetooth API)
Stars: ✭ 83 (+232%)
Mutual labels:  google-maps
trackanimation
Track Animation is a Python 2 and 3 library that provides an easy and user-adjustable way of creating visualizations from GPS data.
Stars: ✭ 74 (+196%)
Mutual labels:  google-maps
django-treasuremap
django-treasuremap app, makes it easy to store and display the location on the map using different providers (Google, Yandex).
Stars: ✭ 21 (-16%)
Mutual labels:  google-maps
virtual-reality-tour
📍 Virtual reality travel in Google Street View.
Stars: ✭ 34 (+36%)
Mutual labels:  google-maps
GeoGuess
GeoGuess is an open-source geography game with Google Map StreetView. You can play solo or with your friends simultaneously.
Stars: ✭ 174 (+596%)
Mutual labels:  google-maps
jquery.geocomplete
A simple plugin for Google Maps Autocomplete.
Stars: ✭ 15 (-40%)
Mutual labels:  google-maps
location-picker
An open source location picker plugin using Google Maps v3 that works with all JavaScript flavors!
Stars: ✭ 59 (+136%)
Mutual labels:  google-maps
Directions
Directions app for pebble
Stars: ✭ 15 (-40%)
Mutual labels:  google-maps
ember-cli-g-maps
Deprecated Google Maps Addon
Stars: ✭ 58 (+132%)
Mutual labels:  google-maps
gmaps-geofence
create area geofencing in google map using react js
Stars: ✭ 34 (+36%)
Mutual labels:  google-maps
project sunroof india
Analyzed Google Satellite images to generate a report on individual house rooftop's solar power potential
Stars: ✭ 74 (+196%)
Mutual labels:  google-maps
Kml.swift
Simple kml parser for swift
Stars: ✭ 33 (+32%)
Mutual labels:  google-maps
chowist
Great places are chosen by great chowists
Stars: ✭ 13 (-48%)
Mutual labels:  google-maps
Geolocator-2
Learn how to find and work with locations in Django, the Yelp API, and Google Maps api.
Stars: ✭ 24 (-4%)
Mutual labels:  google-maps
ZoomMarker
A jQuery plugin for scrolling and zooming in and out of the image
Stars: ✭ 81 (+224%)
Mutual labels:  marker
custom-styled-maps-android
Demonstration project with an example of Google Map custom map styling on Android.
Stars: ✭ 30 (+20%)
Mutual labels:  google-maps
activeadmin-latlng
Active Admin plugin for setting up latitude and longitude
Stars: ✭ 34 (+36%)
Mutual labels:  google-maps

npm version Dependency Status

Simple layer over Google Maps API to create expandable baloons(infoboxes) on the map. See example. We are tired of google maps syntax, infobox and whatever. Simple and straightforward syntax to do common job like this:

Module usage example

Installation

$ npm install --save easygooglemaps

Usage

Webpack

var EasyGoogleMaps = require('easygooglemaps');
// run module here

Old school files way (example.html):

<script type="text/javascript" src="easygooglemaps.js"></script>
<script type="text/javascript" src="RUN_MODULE_HERE.js"></script>

Running

var MyMap = new EasyGoogleMaps(_options_);
// options reference in next section

MyMap.init();

Parameters (options)

{
	// map options
	map: {
		APIKEY: 'YOUR_GOOGLEMAPS_API_KEY',
		container: '.js-map', // DOM element, where to put map
		options: {
			center: {lat: -34.097, lng: 150.644},
			zoom: 8
		}
	},

	// baloon specific options
	infobox: {
		class: 'awesome-infobox',
		template: '#infobox', // html template for baloon
		closeButton: '.js-infobox-close',
		onlyOneBox: true, // single baloon visible
		// baloon relative to marker position
		position: {
			x: "left",
			y: "center"	
		}
	},
	
	// Array of data (markers,baloons,infoboxes,whatever) to put on the map
	// Might be added at any time by .add method described below
	markers: {
		items: [
			{
				"content": {
					// this is {{=baloon.title}} in html template
					"title": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore, consequatur."
				},
				"marker": {
					"position": {
						"lat": -34.397,
						"lng": 150.644
					},
					"icon": {
						"default": "img/markerDefault.png",
						"active": "img/markerActive.png",
						// for retina icon should be 40x60 pixels
						"size": {
							"x": 20,
							"y": 30
						},
						"centering": {
							"x": 10,
							"y": 30
						}
					}
				}
			}
		]
	}
}

And also HTML template (doT template engine) for infobox should be specified:

<script type="text/template" id="infobox">
	<div class="baloon">
		<button class="baloon__close js-infobox-close"></button>
		<div className="baloon__content">
			{{=baloon.title}}
		</div>
	</div>
</script>

Methods

Load (callback)

MyMap.onload(function() {
 	// show map with animation, once it is loaded
});

Add marker

// this method also accepts array of markers
MyMap.add({
	"content": {
		"title": "Lorem ipsum"
	},
	"marker": {
		"id": 5, // optional, only if you need to show-hide it later
		"position": {
			"lat": -34.397,
			"lng": 152.244
		},
		"icon": {
			"default": "img/markerDefault.png",
			"active": "img/markerActive.png", // optional
			"size": {
				"x": 41,
				"y": 58
			},
			"centering": {
				"x": 20,
				"y": 58
			}
		}
	}
});

Show-Hide by id

MyMap.show(2); // shows all markers (one or many) with id equal 2
MyMap.hide(2); // same, but hides

Google Map Object

Though our script wraps most of the use cases with map and infoboxes. You can still do whatever you want, because you have access to original Google Maps API:

MyMap.realmap; // returns Google Maps map object

Development

  • npm run build - Build task that generates both minified and non-minified scripts,
  • npm run watch - watch changes, build only minified version;

Authors:

Valentin ‘Whats0n’ Dorosh

Yuri akella Artiukh

License

MIT © Coderiver

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].