gmapz 2.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.md +21 -0
- data/LICENSE.txt +22 -0
- data/README.md +83 -0
- data/Rakefile +2 -0
- data/gmapz.gemspec +23 -0
- data/lib/gmapz.rb +6 -0
- data/lib/gmapz/engine.rb +13 -0
- data/lib/gmapz/version.rb +3 -0
- data/src/css/gmapz-responsive.css +106 -0
- data/src/css/gmapz-sample-infobox.scss +125 -0
- data/src/img/gmapz/ic_clear_black_18px.svg +1 -0
- data/src/img/gmapz/pin-blue.png +0 -0
- data/src/img/gmapz/pin-cluster.png +0 -0
- data/src/img/gmapz/pin-green.png +0 -0
- data/src/img/gmapz/pin-orange.png +0 -0
- data/src/img/gmapz/pin-user-location.png +0 -0
- data/src/img/gmapz/pin.png +0 -0
- data/src/img/gmapz/scroll_disabled.svg +1 -0
- data/src/img/gmapz/scroll_enabled.svg +4 -0
- data/src/js/gmapz-dependencies/markerclusterer.js +1290 -0
- data/src/js/gmapz/gmapz.autocomplete.js +109 -0
- data/src/js/gmapz/gmapz.js +179 -0
- data/src/js/gmapz/gmapz.locations.js +474 -0
- data/src/js/gmapz/gmapz.map.js +789 -0
- data/src/js/gmapz/gmapz.pins.js +40 -0
- data/src/js/ready.js +389 -0
- metadata +102 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 68b8b8d046d4c6b5c576ded15e65bd9dae8cb20f
|
4
|
+
data.tar.gz: fbd7d34d021e234eaf0a1038c1fb2f1f213ab52c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 52e145f2efc1e3c0b266f1a35f9bd658a3dba878ed39df6767f62c1accfa006dd2b9cabca59d705e5b8172bb2636ac6cc3d44543fc1bc09228702002bf1c8055
|
7
|
+
data.tar.gz: a73666881d51e8371c4745de362d2cba0c533708d9b409054b12a19f79fe33b477dbdd03e00efc8a201c8668635a129408562fc14c1ddec8ac3aa350fec93867
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Carlos Cabo
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2016 carloscabo
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# GMapz v2.09
|
2
|
+
|
3
|
+
GMapz is yet another Google Maps JS library. It eases the creation of Google Maps, it's **responsive**, supports the creation of **multiple instances in the same page** (each one with its own settings), the creation of **custom styled infowindows**, and other useful helpers.
|
4
|
+
<br><br>
|
5
|
+
You can view the full documentation (WIP) and working samples at:<br>
|
6
|
+
**[http://carloscabo.github.io/gmapz](http://carloscabo.github.io/gmapz)**
|
7
|
+
<br><br>
|
8
|
+
There is Rails Gem version available ( thx! [@dreamingechoes](https://github.com/dreamingechoes) ):
|
9
|
+
**[https://rubygems.org/gems/gmapz_rails](https://rubygems.org/gems/gmapz_rails)**
|
10
|
+
|
11
|
+
# Installation
|
12
|
+
|
13
|
+
## 1a. Use as Rails gem
|
14
|
+
|
15
|
+
Simply include in your `gemfile`:
|
16
|
+
```
|
17
|
+
gem 'gmapz'
|
18
|
+
```
|
19
|
+
|
20
|
+
and run `bundle install`
|
21
|
+
|
22
|
+
Then add in your `application.js`
|
23
|
+
```
|
24
|
+
//= require gmapz
|
25
|
+
//= require gmapz.map
|
26
|
+
//= require gmapz.autocomplete
|
27
|
+
```
|
28
|
+
|
29
|
+
## 1b. Use _standalone_
|
30
|
+
|
31
|
+
If you want to add it to your project by hand, copy `src/js/gmapz/gmapz.js`, `src/js/gmapz/gmapz.map.js` and `src/js/gmapz/gmapz.autocomplete.js` (only if you need to add an autocomple input) in your project and be sure that its included in the pages **after JQuery**.
|
32
|
+
|
33
|
+
It's recommended that you give a look at: <http://carloscabo.github.io/gmapz/> for a more in deep explanation of the `pins`, and the `locations`. In this repository you have two sample files for both of them: `src/js/gmapz/gmapz.pins.js` and `src/js/gmapz/gmapz.locations.js`.
|
34
|
+
|
35
|
+
## 2. Include CSS
|
36
|
+
|
37
|
+
For the responsive features take a look to `src/css/gmapz-responsive.css` that is used in conjuction with [MQBE](https://github.com/carloscabo/MQBE).
|
38
|
+
|
39
|
+
If you want to customize the map **infobox windows** you can use `src/css/gmapz-sample-infobox.scss` as base for your own styles.
|
40
|
+
|
41
|
+
# TO-DO
|
42
|
+
|
43
|
+
1. Add sample with default Google Maps pins
|
44
|
+
2. Add static maps support
|
45
|
+
|
46
|
+
# Projects using GMapz
|
47
|
+
|
48
|
+
- http://latitude.to
|
49
|
+
|
50
|
+
# Changelog
|
51
|
+
|
52
|
+
- 2.09 (2016/07/15)
|
53
|
+
* Rails Gem
|
54
|
+
- 2.08 (2016/07/06)
|
55
|
+
* Fixed small bug when adding APIKey
|
56
|
+
- 2.07 (2016/05/31)
|
57
|
+
* Added Google Maps JS APIKEY support
|
58
|
+
* Set map language based on <html lang="XX">
|
59
|
+
* Improved scroll lock / unlock behavior
|
60
|
+
* Updated Lock / unlock control styles
|
61
|
+
* Added sample with map initially blocked
|
62
|
+
* Fixed prettify.js CDN url in demos
|
63
|
+
* Several documentation improvements
|
64
|
+
- 2.06
|
65
|
+
* Small fix on deleteAllMarkers(); method
|
66
|
+
* Fix maps initialization with 'bounds' parameter
|
67
|
+
- 2.05
|
68
|
+
* Now maps are initialized immediately if Google Maps API is ready
|
69
|
+
* Changed infowindows parameters object
|
70
|
+
* Added offsetPosition to the standard infowindow
|
71
|
+
* Added custom class inside map to style infowindows
|
72
|
+
* New sample of standard infowindows on the side of the markers
|
73
|
+
* GMapz inside lightbox sample
|
74
|
+
|
75
|
+
- 2.02
|
76
|
+
* Removed deprecated sensor param in Google Maps API initialization
|
77
|
+
* Fixed bug when using "Nearest location", more than once
|
78
|
+
|
79
|
+
- 2.01
|
80
|
+
+ Fixed small bug with on 'idle' event
|
81
|
+
+ Now SingleMarkerZoom event applies once
|
82
|
+
+ Added setSingleMarkerZoom method
|
83
|
+
+ Changed names of the samples
|
data/Rakefile
ADDED
data/gmapz.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gmapz/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "gmapz"
|
8
|
+
spec.version = GMapz::VERSION
|
9
|
+
spec.authors = ["carloscabo"]
|
10
|
+
spec.email = ["carlos.cabo@gmail.com"]
|
11
|
+
spec.summary = "GMapz is yet another Google Maps JS library."
|
12
|
+
spec.description = "It eases the creation of Google Maps, it's responsive, supports the creation of multiple instances in the same page (each one with its own settings), the creation of custom styled infowindows, and other useful helpers."
|
13
|
+
spec.homepage = "https://github.com/carloscabo/gmapz"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
data/lib/gmapz.rb
ADDED
data/lib/gmapz/engine.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
module GMapz
|
2
|
+
module Rails
|
3
|
+
class Engine < ::Rails::Engine
|
4
|
+
initializer 'gmapz' do | app |
|
5
|
+
gmapz_path = File.expand_path("../../../src/js/gmapz", __FILE__)
|
6
|
+
app.config.assets.paths << gmapz_path
|
7
|
+
gmapz_dependencies_path = File.expand_path("../../../src/js/gmapz-dependencies", __FILE__)
|
8
|
+
app.config.assets.paths << gmapz_dependencies_path
|
9
|
+
app.middleware.use ::ActionDispatch::Static, "#{root}/dist"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
@media only screen and (max-width: 767px) {
|
2
|
+
.gmapz-scroll-control {
|
3
|
+
display: block !important;
|
4
|
+
}
|
5
|
+
/* Hide satellite control */
|
6
|
+
/*.gm-style-mtc {
|
7
|
+
display: none !important;
|
8
|
+
}*/
|
9
|
+
}
|
10
|
+
|
11
|
+
.gmapz-scroll-control {
|
12
|
+
display: block;
|
13
|
+
margin: 10px;
|
14
|
+
left: 0 !important;
|
15
|
+
background: #fff;
|
16
|
+
border: 2px solid #fff;
|
17
|
+
border-radius: 3px;
|
18
|
+
|
19
|
+
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.3);
|
20
|
+
box-shadow: 0 2px 6px rgba(0,0,0,.3);
|
21
|
+
|
22
|
+
cursor: pointer;
|
23
|
+
text-align: center;
|
24
|
+
}
|
25
|
+
|
26
|
+
.gmapz-scroll-control .content {
|
27
|
+
font-family: Roboto, Arial, sans-serif;
|
28
|
+
color: rgb(25,25,25);
|
29
|
+
font-size: 11px;
|
30
|
+
line-height: 150%;
|
31
|
+
padding: 8px 8px 8px 4px;
|
32
|
+
color: #000;
|
33
|
+
}
|
34
|
+
|
35
|
+
.gmapz-scroll-control .content:before {
|
36
|
+
content: ' ';
|
37
|
+
display: inline-block;
|
38
|
+
width: 16px;
|
39
|
+
height: 16px;
|
40
|
+
margin: -2px 3px 0 0;
|
41
|
+
vertical-align: middle;
|
42
|
+
background: url('data:image/svg+xml;utf8,<svg fill="%23000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"/></svg>') center center no-repeat;
|
43
|
+
/*background: #fff url(../img/gmapz/scroll_enabled.svg) center center no-repeat;*/
|
44
|
+
-webkit-background-size: cover;
|
45
|
+
-o-background-size: cover;
|
46
|
+
background-size: cover;
|
47
|
+
}
|
48
|
+
|
49
|
+
/* Disabled */
|
50
|
+
|
51
|
+
.gmapz-scroll-control.locked {
|
52
|
+
background: #FF9B00; /* Orange */
|
53
|
+
border: 2px solid #FF9B00; /* Orange */
|
54
|
+
}
|
55
|
+
|
56
|
+
.gmapz-scroll-control.locked .content {
|
57
|
+
color: #000;
|
58
|
+
}
|
59
|
+
|
60
|
+
.gmapz-scroll-control.locked .content:before {
|
61
|
+
content: '';
|
62
|
+
background-image: url('data:image/svg+xml;utf8,<svg fill="%23000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/></svg>');
|
63
|
+
/*background-image: url(../img/gmapz/scroll_disabled.svg);*/
|
64
|
+
}
|
65
|
+
|
66
|
+
/* Locales */
|
67
|
+
|
68
|
+
/* Default */
|
69
|
+
.gmapz-scroll-control .content:after {
|
70
|
+
content: 'Disable scroll';
|
71
|
+
}
|
72
|
+
html[lang='es'] .gmapz-scroll-control .content:after {
|
73
|
+
content: 'Desactivar scroll';
|
74
|
+
}
|
75
|
+
html[lang='fr'] .gmapz-scroll-control .content:after {
|
76
|
+
content: 'Désactiver scroll';
|
77
|
+
}
|
78
|
+
html[lang='pt'] .gmapz-scroll-control .content:after {
|
79
|
+
content: 'Desativar scroll';
|
80
|
+
}
|
81
|
+
html[lang='it'] .gmapz-scroll-control .content:after {
|
82
|
+
content: 'Disabilita scroll';
|
83
|
+
}
|
84
|
+
html[lang='de'] .gmapz-scroll-control .content:after {
|
85
|
+
content: 'Deaktivieren scroll';
|
86
|
+
}
|
87
|
+
|
88
|
+
/* Default */
|
89
|
+
.gmapz-scroll-control.locked .content:after {
|
90
|
+
content: 'Enable scroll';
|
91
|
+
}
|
92
|
+
html[lang='es'] .gmapz-scroll-control.locked .content:after {
|
93
|
+
content: 'Activar scroll';
|
94
|
+
}
|
95
|
+
html[lang='fr'] .gmapz-scroll-control.locked .content:after {
|
96
|
+
content: 'Activer scroll';
|
97
|
+
}
|
98
|
+
html[lang='pt'] .gmapz-scroll-control.locked .content:after {
|
99
|
+
content: 'Ativar scroll';
|
100
|
+
}
|
101
|
+
html[lang='it'] .gmapz-scroll-control.locked .content:after {
|
102
|
+
content: 'Abilita scroll';
|
103
|
+
}
|
104
|
+
html[lang='de'] .gmapz-scroll-control.locked .content:after {
|
105
|
+
content: 'Aktivieren scroll';
|
106
|
+
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
//
|
2
|
+
// Side infowindow sample
|
3
|
+
// #map-sample-6A
|
4
|
+
//
|
5
|
+
#map-sample-6A {
|
6
|
+
|
7
|
+
.gmapz-infowindow {
|
8
|
+
width: 200px;
|
9
|
+
// background-color: pink; // Debug
|
10
|
+
}
|
11
|
+
|
12
|
+
.gm-style-iw-container {
|
13
|
+
// Custom arrow
|
14
|
+
&:after {
|
15
|
+
right: 100%;
|
16
|
+
bottom: 46px;
|
17
|
+
border: solid transparent;
|
18
|
+
content: " ";
|
19
|
+
height: 0;
|
20
|
+
width: 0;
|
21
|
+
position: absolute;
|
22
|
+
pointer-events: none;
|
23
|
+
border-color: transparent;
|
24
|
+
border-right-color: #777;
|
25
|
+
border-width: 10px;
|
26
|
+
}
|
27
|
+
&:before {
|
28
|
+
left: -19px;
|
29
|
+
bottom: 46px;
|
30
|
+
border: solid transparent;
|
31
|
+
content: " ";
|
32
|
+
height: 0;
|
33
|
+
width: 0;
|
34
|
+
position: absolute;
|
35
|
+
pointer-events: none;
|
36
|
+
border-color: transparent;
|
37
|
+
border-right-color: #fff;
|
38
|
+
border-width: 10px;
|
39
|
+
z-index: 1;
|
40
|
+
}
|
41
|
+
|
42
|
+
> div {
|
43
|
+
// Arrow shadow
|
44
|
+
> div:first-child {
|
45
|
+
border-top-color: transparent !important; // Disable / hidden
|
46
|
+
}
|
47
|
+
// Box shadow
|
48
|
+
> div:nth-child(2) {
|
49
|
+
// background-color: cyan !important;
|
50
|
+
// box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px !important;
|
51
|
+
}
|
52
|
+
// Arrow image
|
53
|
+
> div:nth-child(3) {
|
54
|
+
display: none !important;
|
55
|
+
// transform: rotate(90deg);
|
56
|
+
// left: 0 !important;
|
57
|
+
// top: auto !important;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
//
|
65
|
+
// Advanced infoBox
|
66
|
+
// #map-sample-6B
|
67
|
+
//
|
68
|
+
.gmapz-ibx {
|
69
|
+
width: 120px;
|
70
|
+
height: 120px;
|
71
|
+
padding: 20px;
|
72
|
+
position: relative;
|
73
|
+
border-radius: 50%;
|
74
|
+
margin-top: 8px;
|
75
|
+
background-color: coral;
|
76
|
+
box-shadow: 0 8px 8px rgba(0,0,0,0.25);
|
77
|
+
}
|
78
|
+
|
79
|
+
.gmapz-ibx:after {
|
80
|
+
left: 96%;
|
81
|
+
top: 50%;
|
82
|
+
border: solid transparent;
|
83
|
+
content: ' ';
|
84
|
+
height: 0;
|
85
|
+
width: 0;
|
86
|
+
position: absolute;
|
87
|
+
pointer-events: none;
|
88
|
+
border-color: transparent;
|
89
|
+
border-left-color: coral;
|
90
|
+
border-width: 16px;
|
91
|
+
margin-top: -16px;
|
92
|
+
|
93
|
+
animation-duration: 0.5s;
|
94
|
+
animation-name: movearrow;
|
95
|
+
animation-iteration-count: infinite;
|
96
|
+
animation-direction: alternate;
|
97
|
+
}
|
98
|
+
|
99
|
+
.gmapz-ibx-content {
|
100
|
+
font-size: 16px;
|
101
|
+
line-height: 80px;
|
102
|
+
text-align: center;
|
103
|
+
color: #fff;
|
104
|
+
}
|
105
|
+
|
106
|
+
.gmapz-ibx-close {
|
107
|
+
position: absolute;
|
108
|
+
left: 4px;
|
109
|
+
top: 4px;
|
110
|
+
width: 32px;
|
111
|
+
height: 32px;
|
112
|
+
border-radius: 50%;
|
113
|
+
background: black url('data:image/svg+xml;utf8,<svg height="18" viewBox="0 0 24 24" width="18" fill="#ffffff" xmlns="http://www.w3.org/2000/svg"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/><path d="M0 0h24v24H0z" fill="none"/></svg>') center center no-repeat;
|
114
|
+
box-shadow: 0 4px 8px rgba(0,0,0,0.25);
|
115
|
+
cursor: pointer;
|
116
|
+
}
|
117
|
+
|
118
|
+
@keyframes movearrow {
|
119
|
+
from {
|
120
|
+
left: 96%;
|
121
|
+
}
|
122
|
+
to {
|
123
|
+
left: 90%;
|
124
|
+
}
|
125
|
+
}
|