gmapjs 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 281d27a0eec9fea889e1b1caebe55074971918e7
4
+ data.tar.gz: 1f30a99739528a02dd2e6d6ea7ca9cc09371f514
5
+ SHA512:
6
+ metadata.gz: a20bc914ed9b817b6636ec2cc492b1d563a24d0f4c697b8eea2588661178bde5bb4054dce1a325e370233947e9c72540cfaeb04e280e140184610b44b7db38b9
7
+ data.tar.gz: 421b82f7eb62b895650b53090b511f7977a9e25c66b22c67078b1e7d02194028997555c2948a1eb990230729059360f37ac8e4a85142f3568edb81e526eb2795
data/.DS_Store ADDED
Binary file
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.1
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in gmapjs.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Luke Davitt
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.
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ ```
2
+ google_map_with_markers({
3
+ element: "map-canvas", // required: id or dom element object to turn into map
4
+ center: 'auto', // required: 'auto' or an array of 2 floats e.x. [69.114, -86.2154]
5
+ zoom: 'auto', // required: 'auto' or an integer zoom level
6
+ icon: 'pin.png', // optional: url/location of icon to use for all markers
7
+ markers: [ // array of marker objects
8
+ {
9
+ title: 'Marker Title', // optional: title used for hover text of pin
10
+ position: [39.1450, -86.1120], // required: array with 2 values representing lat and lng
11
+ info: '<div>Some stuff here</div>', // optional: string or dom element object you want for the onclick info window
12
+ icon: 'pin2.png' // optional: url of a marker-specific pin to use, overrides default
13
+ }
14
+ ],
15
+ callback: function(gmap) { // optional: anything you want to run after markers are placed.
16
+ // ...
17
+ }
18
+ });
19
+ ```
20
+
21
+
22
+
23
+
24
+ Sample usage
25
+
26
+ (in any javascript file)
27
+
28
+ var loadLocation = function(){
29
+ var i, locations, location, options, marker, map, icon;
30
+
31
+ map = document.getElementById("map-canvas");
32
+
33
+ options = {
34
+ dev: false,
35
+ element: map,
36
+ center: 'auto',
37
+ zoom: '14',
38
+ theme: 'neutral-blue',
39
+ markers: [],
40
+ callback: function(gmap) {
41
+ }
42
+ };
43
+
44
+ marker = {};
45
+ marker.position = [39.978048,-86.126871];
46
+ options.markers.push(marker);
47
+ options.icon = map.getAttribute('data-marker-icon');
48
+
49
+ gmap_with_markers(options);
50
+ };
51
+
52
+
53
+ This gem owes all its credit to Alex Howard.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "gmapjs"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
data/gmapjs.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'gmapjs/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "gmapjs"
8
+ spec.version = Gmapjs::VERSION
9
+ spec.authors = ["Luke Davitt"]
10
+ spec.email = ["luke.davitt1@gmail.com"]
11
+
12
+ spec.summary = %q{Write a short summary, because Rubygems requires one.}
13
+ spec.description = %q{Write a longer description or delete this line.}
14
+ spec.license = "MIT"
15
+
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ end
@@ -0,0 +1,3 @@
1
+ module Gmapjs
2
+ VERSION = "0.1.0"
3
+ end
data/lib/gmapjs.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "gmapjs/version"
2
+
3
+ module Gmapjs
4
+ class Engine < ::Rails::Engine; end
5
+ end
data/vendor/.DS_Store ADDED
Binary file
Binary file
@@ -0,0 +1,287 @@
1
+ //= require ./themes
2
+ //= require_directory ./themes
3
+ //= require_self
4
+
5
+ function gmap_with_markers(options) {
6
+ var self = {
7
+ dev: false,
8
+ map: null,
9
+ markers: [],
10
+ latlngs: [],
11
+ windows: [],
12
+ multi_window: false,
13
+ marker_icon: null,
14
+ map_options: {
15
+ center: null,
16
+ zoom: null,
17
+ disableDefaultUI: true,
18
+ scrollwheel: false,
19
+ zoomControl: true,
20
+ panControl: false,
21
+ zoomControlOptions: {
22
+ position: google.maps.ControlPosition.LEFT_CENTER
23
+ }
24
+ },
25
+ themes: null
26
+ };
27
+
28
+ self.warn = function(message) {
29
+ if (self.dev) {
30
+ console.warn(message);
31
+ }
32
+ };
33
+
34
+ self.info = function(message) {
35
+ if (self.dev) {
36
+ console.info(message);
37
+ }
38
+ };
39
+
40
+ self.test_options = function(opt) {
41
+ if (typeof opt !== 'object') {
42
+ self.warn('Options was not set or was undefined.');
43
+ return false;
44
+ }
45
+
46
+ if (!opt.hasOwnProperty('element')) {
47
+ self.warn('Options must have an "element" property.');
48
+ return false;
49
+ }
50
+
51
+ if (!(typeof opt.element.appendChild === 'function' ||
52
+ (typeof opt.element === 'string' && document.getElementById(opt.element)))) {
53
+ self.warn('Element must be an HTML element or the ID of one.');
54
+ return false;
55
+ }
56
+
57
+ if (!opt.hasOwnProperty('center')) {
58
+ self.warn('Options must have a "center" property.');
59
+ return false;
60
+ }
61
+
62
+ if (!((typeof opt.center === 'string' && opt.center === 'auto') ||
63
+ (typeof opt.center === 'object' && opt.center.hasOwnProperty('length')))) {
64
+ self.warn('Center must be "auto" or an array.');
65
+ return false;
66
+ }
67
+
68
+ if (typeof opt.center !== 'string') {
69
+ if (opt.center.length !== 2) {
70
+ self.warn('Center must only have two values.');
71
+ return false;
72
+ }
73
+
74
+ if (isNaN(opt.center[0]) || isNaN(opt.center[1])) {
75
+ self.warn('Center lat and lng must be numerical.');
76
+ return false;
77
+ }
78
+ }
79
+
80
+ if (!opt.hasOwnProperty('zoom')) {
81
+ self.warn('Options must have "zoom" property.');
82
+ return false;
83
+ }
84
+
85
+ if (!((typeof opt.zoom == 'string' && opt.zoom === 'auto') || !isNaN(opt.zoom))) {
86
+ self.warn('Zoom must be "auto" or numerical.');
87
+ return false;
88
+ }
89
+
90
+ if (opt.hasOwnProperty('theme')) {
91
+ if (!(typeof opt.theme === 'string' ||
92
+ (typeof opt.theme === 'object' && opt.theme.hasOwnProperty('length')))) {
93
+ self.warn('Theme must either be a string or an array!');
94
+ }
95
+ }
96
+
97
+ return true;
98
+ };
99
+
100
+ self.test_marker = function(marker) {
101
+ if (!marker.hasOwnProperty('position')) {
102
+ self.warn('Marker must have a "position" property.');
103
+ return false;
104
+ }
105
+
106
+ if (typeof marker.position !== 'object' || !marker.position.hasOwnProperty('length')) {
107
+ self.warn('Marker position must be an array.');
108
+ return false;
109
+ }
110
+
111
+ if (marker.position.length !== 2) {
112
+ self.warn('Marker postion must have only 2 values.');
113
+ return false;
114
+ }
115
+
116
+ if (isNaN(marker.position[0]) || isNaN(marker.position[1])) {
117
+ self.warn('Marker lat and lng must be numerical');
118
+ return false;
119
+ }
120
+
121
+ return true;
122
+ };
123
+
124
+ self.create_marker = function(markerData) {
125
+ var marker, infowindow, markerOpts, pos;
126
+
127
+ pos = new google.maps.LatLng(markerData.position[0], markerData.position[1]);
128
+
129
+ self.latlngs.push(pos);
130
+
131
+ markerOpts = {
132
+ map: self.map,
133
+ position: pos,
134
+ animation: google.maps.Animation.DROP
135
+ };
136
+
137
+ if (self.marker_icon !== null) {
138
+ markerOpts.icon = self.marker_icon;
139
+ }
140
+
141
+ if (self.marker_shape !== null) {
142
+ markerOpts.shape = self.marker_shape;
143
+ }
144
+
145
+ if (markerData.hasOwnProperty('title') && typeof markerData.title === 'string') {
146
+ markerOpts.title = markerData.title;
147
+ }
148
+
149
+ if (markerData.hasOwnProperty('icon') && (typeof markerData.icon === 'string' ||
150
+ (typeof markerData.icon === 'object' && markerData.icon.hasOwnProperty('url')))) {
151
+ markerOpts.icon = markerData.icon;
152
+ }
153
+
154
+ if (markerData.hasOwnProperty('shape') && typeof markerData.shape === "object" &&
155
+ markerData.shape.hasOwnProperty('coords') && markerData.shape.hasOwnProperty('type')) {
156
+ markerOpts.shape = markerData.shape;
157
+ }
158
+
159
+ if (markerData.hasOwnProperty('title') && typeof markerData.title === 'string') {
160
+ markerOpts.title = markerData.title;
161
+ }
162
+
163
+ marker = new google.maps.Marker(markerOpts);
164
+ self.markers.push(marker);
165
+
166
+ if (markerData.hasOwnProperty('info') && (typeof markerData.info == 'string' ||
167
+ (typeof markerData.info === 'object' && typeof markerData.info.appendChild === 'function'))) {
168
+
169
+ infowindow = new google.maps.InfoWindow({
170
+ content: markerData.info
171
+ });
172
+
173
+ google.maps.event.addListener(marker, 'click', function() {
174
+
175
+ if (!self.multi_window) {
176
+ self.close_windows();
177
+ }
178
+
179
+ infowindow.open(self.map, marker);
180
+ });
181
+
182
+ self.windows.push(infowindow);
183
+ }
184
+ };
185
+
186
+ self.close_windows = function() {
187
+ var i;
188
+ for (i = 0; i < self.windows.length; i++) {
189
+ self.windows[i].close();
190
+ }
191
+ };
192
+
193
+ self.process_markers = function(options) {
194
+ var i, marker;
195
+
196
+ if (options.hasOwnProperty('markers')) {
197
+ if (typeof options.markers !== 'object' || !options.markers.hasOwnProperty('length')) {
198
+ self.warn('Markers property exists, but not an array!');
199
+ return false;
200
+ }
201
+
202
+ for (i = 0; i < options.markers.length; i++) {
203
+ self.info('Processing marker ' + (i + 1));
204
+ marker = options.markers[i];
205
+ if (self.test_marker(marker)) {
206
+ self.create_marker(marker);
207
+ }
208
+ }
209
+ }
210
+ };
211
+
212
+ self.auto_adjust = function() {
213
+ var i, bounds = new google.maps.LatLngBounds();
214
+
215
+ for (i = 0; i < self.latlngs.length; i++) {
216
+ bounds.extend(self.latlngs[i]);
217
+ }
218
+
219
+ if (options.zoom === 'auto') {
220
+ self.map.fitBounds(bounds);
221
+ google.maps.event.addListenerOnce(self.map, 'bounds_changed', function(event) {
222
+ self.map.setZoom(self.map.getZoom() - 1);
223
+ });
224
+ }
225
+
226
+ if (options.center === 'auto') {
227
+ self.map.setCenter(bounds.getCenter());
228
+ }
229
+ };
230
+
231
+ self.map_init = function() {
232
+ // luke's own options for this specific map
233
+ //self.map_options.disableDefaultUI = true;
234
+
235
+ self.map_options.zoomControlOptions.style = google.maps.ZoomControlStyle.LARGE;
236
+ self.map = new google.maps.Map(document.getElementById('map-canvas'), self.map_options);
237
+ self.process_markers(options);
238
+
239
+ if (options.center === 'auto' || options.zoom === 'auto') {
240
+ self.auto_adjust(options);
241
+ }
242
+
243
+ if (typeof options.callback === 'function') {
244
+ options.callback(self);
245
+ }
246
+ };
247
+
248
+ if (typeof gmap_themes !== 'undefined') {
249
+ if (options.hasOwnProperty('theme')) {
250
+ if (typeof options.theme === 'string' && gmap_themes.themeExists(options.theme)) {
251
+ self.map_options.styles = gmap_themes.getTheme(options.theme);
252
+ } else if (typeof options.theme === 'object' && options.theme.hasOwnProperty('length')) {
253
+ self.map_options.styles = options.theme;
254
+ }
255
+ }
256
+ }
257
+
258
+ if (options.hasOwnProperty('dev') && options.dev) {
259
+ self.dev = true;
260
+ }
261
+
262
+ if (options.hasOwnProperty('multi_window') && options.multi_window) {
263
+ self.multi_window = true;
264
+ }
265
+
266
+ if (options.hasOwnProperty('icon') && (typeof options.icon === 'string' ||
267
+ (typeof options.icon === "object" && options.icon.hasOwnProperty('url')))) {
268
+ self.marker_icon = options.icon;
269
+ }
270
+
271
+ if (options.hasOwnProperty('shape') && typeof options.shape === "object" &&
272
+ options.shape.hasOwnProperty('coords') && options.shape.hasOwnProperty('type')) {
273
+ markerOpts.marker_shape = options.shape;
274
+ }
275
+
276
+ if (self.test_options(options)) {
277
+ self.map_options.center = typeof options.center === 'string' ?
278
+ new google.maps.LatLng(39.50, -98.35) :
279
+ new google.maps.LatLng(parseFloat(options.center[0]), parseFloat(options.center[1]));
280
+
281
+ self.map_options.zoom = isNaN(options.zoom) ? 4 : parseInt(options.zoom);
282
+
283
+ google.maps.event.addDomListener(window, 'load', self.map_init);
284
+
285
+ }
286
+ return self;
287
+ }
@@ -0,0 +1,19 @@
1
+ ```
2
+ google_map_with_markers({
3
+ element: "map-canvas", // required: id or dom element object to turn into map
4
+ center: 'auto', // required: 'auto' or an array of 2 floats e.x. [69.114, -86.2154]
5
+ zoom: 'auto', // required: 'auto' or an integer zoom level
6
+ icon: 'pin.png', // optional: url/location of icon to use for all markers
7
+ markers: [ // array of marker objects
8
+ {
9
+ title: 'Marker Title', // optional: title used for hover text of pin
10
+ position: [39.1450, -86.1120], // required: array with 2 values representing lat and lng
11
+ info: '<div>Some stuff here</div>', // optional: string or dom element object you want for the onclick info window
12
+ icon: 'pin2.png' // optional: url of a marker-specific pin to use, overrides default
13
+ }
14
+ ],
15
+ callback: function(gmap) { // optional: anything you want to run after markers are placed.
16
+ // ...
17
+ }
18
+ });
19
+ ```
@@ -0,0 +1,90 @@
1
+ gmap_themes.createTheme('apple-maps-esque', [{
2
+ "featureType": "water",
3
+ "elementType": "geometry",
4
+ "stylers": [{
5
+ "color": "#a2daf2"
6
+ }]
7
+ }, {
8
+ "featureType": "landscape.man_made",
9
+ "elementType": "geometry",
10
+ "stylers": [{
11
+ "color": "#f7f1df"
12
+ }]
13
+ }, {
14
+ "featureType": "landscape.natural",
15
+ "elementType": "geometry",
16
+ "stylers": [{
17
+ "color": "#d0e3b4"
18
+ }]
19
+ }, {
20
+ "featureType": "landscape.natural.terrain",
21
+ "elementType": "geometry",
22
+ "stylers": [{
23
+ "visibility": "off"
24
+ }]
25
+ }, {
26
+ "featureType": "poi.park",
27
+ "elementType": "geometry",
28
+ "stylers": [{
29
+ "color": "#bde6ab"
30
+ }]
31
+ }, {
32
+ "featureType": "poi",
33
+ "elementType": "labels",
34
+ "stylers": [{
35
+ "visibility": "off"
36
+ }]
37
+ }, {
38
+ "featureType": "poi.medical",
39
+ "elementType": "geometry",
40
+ "stylers": [{
41
+ "color": "#fbd3da"
42
+ }]
43
+ }, {
44
+ "featureType": "poi.business",
45
+ "stylers": [{
46
+ "visibility": "off"
47
+ }]
48
+ }, {
49
+ "featureType": "road",
50
+ "elementType": "geometry.stroke",
51
+ "stylers": [{
52
+ "visibility": "off"
53
+ }]
54
+ }, {
55
+ "featureType": "road",
56
+ "elementType": "labels",
57
+ "stylers": [{
58
+ "visibility": "off"
59
+ }]
60
+ }, {
61
+ "featureType": "road.highway",
62
+ "elementType": "geometry.fill",
63
+ "stylers": [{
64
+ "color": "#ffe15f"
65
+ }]
66
+ }, {
67
+ "featureType": "road.highway",
68
+ "elementType": "geometry.stroke",
69
+ "stylers": [{
70
+ "color": "#efd151"
71
+ }]
72
+ }, {
73
+ "featureType": "road.arterial",
74
+ "elementType": "geometry.fill",
75
+ "stylers": [{
76
+ "color": "#ffffff"
77
+ }]
78
+ }, {
79
+ "featureType": "road.local",
80
+ "elementType": "geometry.fill",
81
+ "stylers": [{
82
+ "color": "black"
83
+ }]
84
+ }, {
85
+ "featureType": "transit.station.airport",
86
+ "elementType": "geometry.fill",
87
+ "stylers": [{
88
+ "color": "#cfb2db"
89
+ }]
90
+ }]);
@@ -0,0 +1,47 @@
1
+ gmap_themes.createTheme('blue-water', [{
2
+ "featureType": "water",
3
+ "stylers": [{
4
+ "color": "#46bcec"
5
+ }, {
6
+ "visibility": "on"
7
+ }]
8
+ }, {
9
+ "featureType": "landscape",
10
+ "stylers": [{
11
+ "color": "#f2f2f2"
12
+ }]
13
+ }, {
14
+ "featureType": "road",
15
+ "stylers": [{
16
+ "saturation": -100
17
+ }, {
18
+ "lightness": 45
19
+ }]
20
+ }, {
21
+ "featureType": "road.highway",
22
+ "stylers": [{
23
+ "visibility": "simplified"
24
+ }]
25
+ }, {
26
+ "featureType": "road.arterial",
27
+ "elementType": "labels.icon",
28
+ "stylers": [{
29
+ "visibility": "off"
30
+ }]
31
+ }, {
32
+ "featureType": "administrative",
33
+ "elementType": "labels.text.fill",
34
+ "stylers": [{
35
+ "color": "#444444"
36
+ }]
37
+ }, {
38
+ "featureType": "transit",
39
+ "stylers": [{
40
+ "visibility": "off"
41
+ }]
42
+ }, {
43
+ "featureType": "poi",
44
+ "stylers": [{
45
+ "visibility": "off"
46
+ }]
47
+ }]);
@@ -0,0 +1,109 @@
1
+ gmap_themes.createTheme('light-monochrome', [{
2
+ "featureType": "water",
3
+ "elementType": "all",
4
+ "stylers": [{
5
+ "hue": "#e9ebed"
6
+ }, {
7
+ "saturation": -78
8
+ }, {
9
+ "lightness": 67
10
+ }, {
11
+ "visibility": "simplified"
12
+ }]
13
+ }, {
14
+ "featureType": "landscape",
15
+ "elementType": "all",
16
+ "stylers": [{
17
+ "hue": "#ffffff"
18
+ }, {
19
+ "saturation": -100
20
+ }, {
21
+ "lightness": 100
22
+ }, {
23
+ "visibility": "simplified"
24
+ }]
25
+ }, {
26
+ "featureType": "road",
27
+ "elementType": "geometry",
28
+ "stylers": [{
29
+ "hue": "#bbc0c4"
30
+ }, {
31
+ "saturation": -93
32
+ }, {
33
+ "lightness": 31
34
+ }, {
35
+ "visibility": "simplified"
36
+ }]
37
+ }, {
38
+ "featureType": "poi",
39
+ "elementType": "all",
40
+ "stylers": [{
41
+ "hue": "#ffffff"
42
+ }, {
43
+ "saturation": -100
44
+ }, {
45
+ "lightness": 100
46
+ }, {
47
+ "visibility": "off"
48
+ }]
49
+ }, {
50
+ "featureType": "road.local",
51
+ "elementType": "geometry",
52
+ "stylers": [{
53
+ "hue": "#e9ebed"
54
+ }, {
55
+ "saturation": -90
56
+ }, {
57
+ "lightness": -8
58
+ }, {
59
+ "visibility": "simplified"
60
+ }]
61
+ }, {
62
+ "featureType": "transit",
63
+ "elementType": "all",
64
+ "stylers": [{
65
+ "hue": "#e9ebed"
66
+ }, {
67
+ "saturation": 10
68
+ }, {
69
+ "lightness": 69
70
+ }, {
71
+ "visibility": "on"
72
+ }]
73
+ }, {
74
+ "featureType": "administrative.locality",
75
+ "elementType": "all",
76
+ "stylers": [{
77
+ "hue": "#2c2e33"
78
+ }, {
79
+ "saturation": 7
80
+ }, {
81
+ "lightness": 19
82
+ }, {
83
+ "visibility": "on"
84
+ }]
85
+ }, {
86
+ "featureType": "road",
87
+ "elementType": "labels",
88
+ "stylers": [{
89
+ "hue": "#bbc0c4"
90
+ }, {
91
+ "saturation": -93
92
+ }, {
93
+ "lightness": 31
94
+ }, {
95
+ "visibility": "on"
96
+ }]
97
+ }, {
98
+ "featureType": "road.arterial",
99
+ "elementType": "labels",
100
+ "stylers": [{
101
+ "hue": "#bbc0c4"
102
+ }, {
103
+ "saturation": -93
104
+ }, {
105
+ "lightness": -2
106
+ }, {
107
+ "visibility": "simplified"
108
+ }]
109
+ }]);
@@ -0,0 +1 @@
1
+ gmap_themes.createTheme('neutral-blue',[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#193341"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#2c5a71"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#29768a"},{"lightness":-37}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#3e606f"},{"weight":2},{"gamma":0.84}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"weight":0.6},{"color":"#1a3541"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#2c5a71"}]}]);
@@ -0,0 +1,59 @@
1
+ gmap_themes.createTheme('pale-dawn', [{
2
+ "featureType": "water",
3
+ "stylers": [{
4
+ "visibility": "on"
5
+ }, {
6
+ "color": "#acbcc9"
7
+ }]
8
+ }, {
9
+ "featureType": "landscape",
10
+ "stylers": [{
11
+ "color": "#f2e5d4"
12
+ }]
13
+ }, {
14
+ "featureType": "road.highway",
15
+ "elementType": "geometry",
16
+ "stylers": [{
17
+ "color": "#c5c6c6"
18
+ }]
19
+ }, {
20
+ "featureType": "road.arterial",
21
+ "elementType": "geometry",
22
+ "stylers": [{
23
+ "color": "#e4d7c6"
24
+ }]
25
+ }, {
26
+ "featureType": "road.local",
27
+ "elementType": "geometry",
28
+ "stylers": [{
29
+ "color": "#fbfaf7"
30
+ }]
31
+ }, {
32
+ "featureType": "poi.park",
33
+ "elementType": "geometry",
34
+ "stylers": [{
35
+ "color": "#c5dac6"
36
+ }]
37
+ }, {
38
+ "featureType": "administrative",
39
+ "stylers": [{
40
+ "visibility": "on"
41
+ }, {
42
+ "lightness": 33
43
+ }]
44
+ }, {
45
+ "featureType": "road"
46
+ }, {
47
+ "featureType": "poi.park",
48
+ "elementType": "labels",
49
+ "stylers": [{
50
+ "visibility": "on"
51
+ }, {
52
+ "lightness": 20
53
+ }]
54
+ }, {}, {
55
+ "featureType": "road",
56
+ "stylers": [{
57
+ "lightness": 20
58
+ }]
59
+ }]);
@@ -0,0 +1,81 @@
1
+ gmap_themes.createTheme('paper', [{
2
+ "featureType": "administrative",
3
+ "stylers": [{
4
+ "visibility": "off"
5
+ }]
6
+ }, {
7
+ "featureType": "poi",
8
+ "stylers": [{
9
+ "visibility": "simplified"
10
+ }]
11
+ }, {
12
+ "featureType": "road",
13
+ "stylers": [{
14
+ "visibility": "simplified"
15
+ }]
16
+ }, {
17
+ "featureType": "water",
18
+ "stylers": [{
19
+ "visibility": "simplified"
20
+ }]
21
+ }, {
22
+ "featureType": "transit",
23
+ "stylers": [{
24
+ "visibility": "simplified"
25
+ }]
26
+ }, {
27
+ "featureType": "landscape",
28
+ "stylers": [{
29
+ "visibility": "simplified"
30
+ }]
31
+ }, {
32
+ "featureType": "road.highway",
33
+ "stylers": [{
34
+ "visibility": "off"
35
+ }]
36
+ }, {
37
+ "featureType": "road.local",
38
+ "stylers": [{
39
+ "visibility": "on"
40
+ }]
41
+ }, {
42
+ "featureType": "road.highway",
43
+ "elementType": "geometry",
44
+ "stylers": [{
45
+ "visibility": "on"
46
+ }]
47
+ }, {
48
+ "featureType": "road.arterial",
49
+ "stylers": [{
50
+ "visibility": "off"
51
+ }]
52
+ }, {
53
+ "featureType": "water",
54
+ "stylers": [{
55
+ "color": "#5f94ff"
56
+ }, {
57
+ "lightness": 26
58
+ }, {
59
+ "gamma": 5.86
60
+ }]
61
+ }, {}, {
62
+ "featureType": "road.highway",
63
+ "stylers": [{
64
+ "weight": 0.6
65
+ }, {
66
+ "saturation": -85
67
+ }, {
68
+ "lightness": 61
69
+ }]
70
+ }, {
71
+ "featureType": "road"
72
+ }, {}, {
73
+ "featureType": "landscape",
74
+ "stylers": [{
75
+ "hue": "#0066ff"
76
+ }, {
77
+ "saturation": 74
78
+ }, {
79
+ "lightness": 100
80
+ }]
81
+ }]);
@@ -0,0 +1,76 @@
1
+ gmap_themes.createTheme('subtle-grayscale', [{
2
+ "featureType": "landscape",
3
+ "stylers": [{
4
+ "saturation": -100
5
+ }, {
6
+ "lightness": 65
7
+ }, {
8
+ "visibility": "on"
9
+ }]
10
+ }, {
11
+ "featureType": "poi",
12
+ "stylers": [{
13
+ "saturation": -100
14
+ }, {
15
+ "lightness": 51
16
+ }, {
17
+ "visibility": "simplified"
18
+ }]
19
+ }, {
20
+ "featureType": "road.highway",
21
+ "stylers": [{
22
+ "saturation": -100
23
+ }, {
24
+ "visibility": "simplified"
25
+ }]
26
+ }, {
27
+ "featureType": "road.arterial",
28
+ "stylers": [{
29
+ "saturation": -100
30
+ }, {
31
+ "lightness": 30
32
+ }, {
33
+ "visibility": "on"
34
+ }]
35
+ }, {
36
+ "featureType": "road.local",
37
+ "stylers": [{
38
+ "saturation": -100
39
+ }, {
40
+ "lightness": 40
41
+ }, {
42
+ "visibility": "on"
43
+ }]
44
+ }, {
45
+ "featureType": "transit",
46
+ "stylers": [{
47
+ "saturation": -100
48
+ }, {
49
+ "visibility": "simplified"
50
+ }]
51
+ }, {
52
+ "featureType": "administrative.province",
53
+ "stylers": [{
54
+ "visibility": "off"
55
+ }]
56
+ }, {
57
+ "featureType": "water",
58
+ "elementType": "labels",
59
+ "stylers": [{
60
+ "visibility": "on"
61
+ }, {
62
+ "lightness": -25
63
+ }, {
64
+ "saturation": -100
65
+ }]
66
+ }, {
67
+ "featureType": "water",
68
+ "elementType": "geometry",
69
+ "stylers": [{
70
+ "hue": "#ffff00"
71
+ }, {
72
+ "lightness": -25
73
+ }, {
74
+ "saturation": -97
75
+ }]
76
+ }]);
@@ -0,0 +1,26 @@
1
+ var gmap_themes = (function() {
2
+ var self = {
3
+ themes: {}
4
+ };
5
+
6
+ self.themeExists = function(theme) {
7
+ theme = theme.replace('/-/g', '_');
8
+ return self.themes.hasOwnProperty(theme);
9
+ };
10
+
11
+ self.getTheme = function(theme) {
12
+ theme = theme.replace('/-/g', '_');
13
+ if (self.themeExists(theme)) {
14
+ return self.themes[theme];
15
+ }
16
+ };
17
+
18
+ self.createTheme = function(name, theme) {
19
+ name = name.replace('/-/g', '_');
20
+ if (!self.themeExists(name)) {
21
+ self.themes[name] = theme;
22
+ }
23
+ };
24
+
25
+ return self;
26
+ })();
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gmapjs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Luke Davitt
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-11-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Write a longer description or delete this line.
42
+ email:
43
+ - luke.davitt1@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".DS_Store"
49
+ - ".gitignore"
50
+ - ".travis.yml"
51
+ - CODE_OF_CONDUCT.md
52
+ - Gemfile
53
+ - LICENSE.txt
54
+ - README.md
55
+ - Rakefile
56
+ - bin/console
57
+ - bin/setup
58
+ - gmapjs.gemspec
59
+ - lib/gmapjs.rb
60
+ - lib/gmapjs/version.rb
61
+ - vendor/.DS_Store
62
+ - vendor/assets/.DS_Store
63
+ - vendor/assets/javascripts/google_map.js
64
+ - vendor/assets/javascripts/readme.md
65
+ - vendor/assets/javascripts/themes.js
66
+ - vendor/assets/javascripts/themes/apple-maps-esque.js
67
+ - vendor/assets/javascripts/themes/blue-water.js
68
+ - vendor/assets/javascripts/themes/light-monochrome.js
69
+ - vendor/assets/javascripts/themes/neutral-blue.js
70
+ - vendor/assets/javascripts/themes/pale-dawn.js
71
+ - vendor/assets/javascripts/themes/paper.js
72
+ - vendor/assets/javascripts/themes/subtle-grayscale.js
73
+ homepage:
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.4.8
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Write a short summary, because Rubygems requires one.
97
+ test_files: []