Skip to content

Commit 534e9af

Browse files
committed
start
0 parents  commit 534e9af

17 files changed

+6649
-0
lines changed

.babelrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["es2015"],
3+
"plugins": ["add-module-exports"]
4+
}

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintrc

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parser": "babel-eslint",
3+
"plugins": [
4+
"babel"
5+
],
6+
"rules": {
7+
"strict": 0,
8+
"babel/generator-star-spacing": 1,
9+
"babel/new-cap": 1,
10+
"babel/object-shorthand": 1,
11+
"babel/arrow-parens": 1,
12+
"array-bracket-spacing": [2, "never"],
13+
"block-scoped-var": 2,
14+
"brace-style": [2, "1tbs"],
15+
"camelcase": 1,
16+
"curly": 2,
17+
"eol-last": 2,
18+
"eqeqeq": [2, "smart"],
19+
"indent": [2, 2, { "SwitchCase": 1 }],
20+
"max-depth": [1, 3],
21+
"max-len": [1, 80],
22+
"max-statements": [1, 15],
23+
"new-cap": 1,
24+
"no-extend-native": 2,
25+
"no-mixed-spaces-and-tabs": 2,
26+
"no-trailing-spaces": 2,
27+
"no-unused-vars": 1,
28+
"no-use-before-define": [2, "nofunc"],
29+
"object-curly-spacing": [1, "always"],
30+
"quotes": [2, "single", "avoid-escape"],
31+
"semi": [2, "always"],
32+
"space-after-keywords": [2, "always"],
33+
"space-unary-ops": 2
34+
}
35+
}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
coverage
3+
npm-debug.log

.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
sudo: false
2+
language: node_js
3+
cache:
4+
directories:
5+
- node_modules
6+
notifications:
7+
email: false
8+
node_js:
9+
- 'stable'
10+
- v4
11+
- '0.12'
12+
branches:
13+
except:
14+
- "/^v\\d+\\.\\d+\\.\\d+$/"
15+
after_script:
16+
- npm run coveralls

dist/easygooglemaps.js

+2,834
Large diffs are not rendered by default.

dist/easygooglemaps.min.js

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/example.js

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
let map = new EasyGoogleMaps({
2+
infobox: {
3+
class: 'awesome-infobox',
4+
style: {
5+
width: '300px'
6+
},
7+
position: {
8+
y: "center",
9+
x: "left"
10+
},
11+
closeButton: '.js-infobox-close'
12+
},
13+
onlyOneBox: true,
14+
template: '#infobox',
15+
container: '.js-map',
16+
options: {
17+
center: {lat: -34.097, lng: 150.644},
18+
zoom: 8
19+
},
20+
markers: {
21+
// url: 'data-file',
22+
items: [
23+
{
24+
"content": {
25+
"title": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore, consequatur."
26+
},
27+
"marker": {
28+
"position": {
29+
"lat": -34.397,
30+
"lng": 150.644
31+
},
32+
"icon": {
33+
"default": "/img/markerDefault.png",
34+
"active": "/img/markerActive.png",
35+
"size": {
36+
"x": 20,
37+
"y": 30
38+
},
39+
"centering": {
40+
"x": 10,
41+
"y": 30
42+
}
43+
}
44+
}
45+
},
46+
{
47+
"content": {
48+
"title": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore, consequatur."
49+
},
50+
"marker": {
51+
"position": {
52+
"lat": -34.597,
53+
"lng": 150.644
54+
},
55+
"icon": {
56+
"default": "/img/markerDefault.png",
57+
"active": "/img/markerActive.png",
58+
"size": {
59+
"x": 20,
60+
"y": 30
61+
},
62+
"centering": {
63+
"x": 10,
64+
"y": 30
65+
}
66+
}
67+
}
68+
}
69+
]
70+
}
71+
});
72+
73+
map.init();

example/index.html

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
<!doctype html>
3+
<html>
4+
5+
<head>
6+
<meta charset="utf-8">
7+
<title>Index page</title>
8+
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
9+
<meta name="viewport" content="width=device-width, initial-scale=1">
10+
<meta name="theme-color" content="#fff">
11+
<meta name="format-detection" content="telephone=no">
12+
<style>
13+
.map {
14+
height: 400px;
15+
}
16+
17+
.awesome-infobox {
18+
padding: 10px;
19+
}
20+
21+
.map-content {
22+
position: relative;
23+
padding: 20px;
24+
border-radius: 5px;
25+
background: #fff;
26+
box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.1);
27+
}
28+
29+
.btn-close {
30+
position: absolute;
31+
z-index: 10;
32+
top: 0;
33+
right: 0;
34+
width: 30px;
35+
height: 30px;
36+
background: none;
37+
}
38+
39+
.btn-close:before, .btn-close:after {
40+
content: "";
41+
position: absolute;
42+
top: 10px;
43+
height: 12px;
44+
border-left: 1px solid #000;
45+
}
46+
47+
.btn-close:before {
48+
left: 11px;
49+
-webkit-transform: rotate(-45deg);
50+
-ms-transform: rotate(-45deg);
51+
transform: rotate(-45deg);
52+
-webkit-transform-origin: top left;
53+
-ms-transform-origin: top left;
54+
transform-origin: top left;
55+
}
56+
57+
.btn-close:after {
58+
right: 10px;
59+
-webkit-transform: rotate(45deg);
60+
-ms-transform: rotate(45deg);
61+
transform: rotate(45deg);
62+
-webkit-transform-origin: top right;
63+
-ms-transform-origin: top right;
64+
transform-origin: top right;
65+
}
66+
67+
</style>
68+
</head>
69+
<body>
70+
<!-- BEGIN content -->
71+
<div class="out">
72+
<div class="js-map map" data-file="json/items.json"></div>
73+
<script type="text/underscorejs" id="infobox">
74+
<div class="map-content"> <button class="btn-close js-infobox-close"></button>
75+
<div className="map-content__info">
76+
<%= title %>
77+
</div>
78+
</div>
79+
</script>
80+
</div>
81+
<!-- END content -->
82+
<!-- BEGIN scripts -->
83+
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDMWIxCN9ijYRfiH7bmQN-LNRDtoboLZqY"></script>
84+
<script type="text/javascript" src="../dist/easygooglemaps.js"></script>
85+
<script type="text/javascript" src="example.js"></script>
86+
<!-- END scripts -->
87+
</body>
88+
89+
</html>

karma.conf.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
var webpackConf = require('./webpack.config.js');
2+
module.exports = function(config) {
3+
config.set({
4+
files: [
5+
// Each file acts as entry point for the webpack configuration
6+
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
7+
'test/client/**/*.js'
8+
],
9+
frameworks: ['mocha', 'chai'],
10+
preprocessors: {
11+
'test/client/**/*.js': ['webpack']
12+
},
13+
webpack: {
14+
module: webpackConf.module
15+
},
16+
webpackMiddleware: {
17+
noInfo: true
18+
},
19+
browsers: ['PhantomJS'],
20+
plugins: [
21+
require('karma-webpack'),
22+
require('karma-mocha'),
23+
require('karma-chai'),
24+
require('karma-phantomjs-launcher'),
25+
26+
27+
require('karma-spec-reporter')
28+
],
29+
});
30+
};

license.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

mocha.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* eslint-disable */
2+
global.chai = require('chai');
3+
global.expect = global.chai.expect;
4+
5+

package.json

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "easygooglemaps",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "dist/easygooglemaps.js",
6+
"scripts": {
7+
"precommit": "npm run build",
8+
"build": "rimraf dist && webpack --no-minimize && webpack",
9+
"coverage": "babel-node node_modules/isparta/bin/isparta cover node_modules/mocha/bin/_mocha --report lcovonly -- -R spec",
10+
"coveralls": "npm run coverage && coveralls < coverage/lcov.info && rimraf coverage",
11+
"test": "npm run test-server && npm run test-browser",
12+
"test-server": "mocha test/server --recursive --bail --require babel-core/register mocha.config.js",
13+
"test-browser": "karma start --single-run",
14+
"tdd": "npm run test-server -- --watch",
15+
"tdd-browser": "karma start"
16+
},
17+
"repository": "coderiver/easygooglemaps",
18+
"keywords": [],
19+
"files": [
20+
"dist",
21+
"src"
22+
],
23+
"devDependencies": {
24+
"babel-core": "^6.4.5",
25+
"babel-eslint": "^4.1.4",
26+
"babel-loader": "^6.2.2",
27+
"babel-plugin-add-module-exports": "^0.1.2",
28+
"babel-preset-es2015": "^6.3.13",
29+
"eslint": "^1.4.1",
30+
"eslint-plugin-babel": "^3.1.0",
31+
"husky": "^0.10.1",
32+
"mocha-lcov-reporter": "^1.0.0",
33+
"rimraf": "^2.4.3",
34+
"webpack": "^1.12.2"
35+
},
36+
"author": {
37+
"name": "",
38+
"email": "whats0n@mail.ru"
39+
},
40+
"engines": {
41+
"node": ">=0.12.0"
42+
},
43+
"license": "MIT",
44+
"dependencies": {
45+
"google-maps-infobox": "^1.1.14",
46+
"underscore": "^1.8.3"
47+
}
48+
}

readme.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# easygooglemaps
2+
[![Build Status][travis-image]][travis-url]
3+
[![Coveralls Status][coveralls-image]][coveralls-url]
4+
[![Dependency Status][depstat-image]][depstat-url]
5+
6+
> Description
7+
8+
## Installation
9+
10+
```
11+
$ npm install --save easygooglemaps
12+
```
13+
14+
## Usage
15+
```js
16+
var EasyGoogleMaps = require('easygooglemaps');
17+
```
18+
19+
## API
20+
21+
### `EasyGoogleMaps(data, [options])`
22+
Description
23+
24+
#### Parameters
25+
- **Array** `data`: An array of data
26+
- **Object** `options`: An object containing the following fields:
27+
28+
#### Return
29+
- **Array** - Result
30+
31+
## Development
32+
- `npm run build` - Build task that generates both minified and non-minified scripts;
33+
34+
35+
## License
36+
MIT © [](http://github.com/akella)
37+
38+
[travis-url]: https://travis-ci.org/akella/easygooglemaps
39+
[travis-image]: https://img.shields.io/travis/akella/easygooglemaps.svg?style=flat-square
40+
41+
[coveralls-url]: https://coveralls.io/r/akella/easygooglemaps
42+
[coveralls-image]: https://img.shields.io/coveralls/akella/easygooglemaps.svg?style=flat-square
43+
44+
[depstat-url]: https://david-dm.org/akella/easygooglemaps
45+
[depstat-image]: https://david-dm.org/akella/easygooglemaps.svg?style=flat-square

0 commit comments

Comments
 (0)