leaflet-makimarkers-rails 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a7666b6776f604b72fd574c7a68318eb23477e48
4
+ data.tar.gz: 3d5c39d8956567758bd4b971964ad2a50376ae0d
5
+ SHA512:
6
+ metadata.gz: 32d6a6e00511f6b4889f0f084b874c0e3b35e4efdffa4a61772646d5ec8bc19ae3436007509969f7c310386563e5313c7df7010a6831edb2fb73c95019510483
7
+ data.tar.gz: b040c9cb8b6dc3c6e2366458b8c45744e4c4d0ad9b410ef28899d39d0ecc20417942481e88bf45f448a0adb68119bacace4e27706cf6889479bb24d1c51ff49f
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Volker Wiegand
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.
@@ -0,0 +1,32 @@
1
+ # Leaflet.MakiMarkers for Rails
2
+
3
+ Engine wrapper for the Leaflet MakiMarkers library by @jseppi.
4
+
5
+ *Requires Leaflet 0.5.0 or newer.*
6
+
7
+ https://github.com/jseppi/Leaflet.MakiMarkers
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ gem 'leaflet-makimarkers-rails'
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install leaflet-makimarkers-rails
22
+
23
+ ## Usage
24
+
25
+ Provides the following assets:
26
+
27
+ leaflet.makimarkers.js
28
+
29
+ ## License
30
+ MIT License, full text of license see [here][License]
31
+
32
+ [License]: https://github.com/jseppi/Leaflet.MakiMarkers/blob/master/LICENSE "LICENSE"
@@ -0,0 +1,10 @@
1
+ require "leaflet/makimarkers/rails/version"
2
+
3
+ module Leaflet
4
+ module Makimarkers
5
+ module Rails
6
+ class Engine < ::Rails::Engine
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ module Leaflet
2
+ module Makimarkers
3
+ module Rails
4
+ VERSION = "0.5.0"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,108 @@
1
+ /*
2
+ * Leaflet plugin to create map icons using Maki Icons from MapBox.
3
+ *
4
+ * References:
5
+ * Maki Icons: https://www.mapbox.com/maki/
6
+ * MapBox Marker API: https://www.mapbox.com/developers/api/static/#markers
7
+ *
8
+ * Usage:
9
+ * var icon = L.MakiMarkers.icon({icon: "rocket", color: "#b0b", size: "m"});
10
+ *
11
+ * License:
12
+ * MIT: http://jseppi.mit-license.org/
13
+ */
14
+ /*global L:false */
15
+ (function () {
16
+ "use strict";
17
+ L.MakiMarkers = {
18
+ // Available Maki Icons
19
+ icons: ["airfield","airport","alcohol-shop","america-football","art-gallery","bakery","bank","bar",
20
+ "baseball","basketball","beer","bicycle","building","bus","cafe","camera","campsite","car",
21
+ "cemetery","chemist","cinema","circle-stroked","circle","city","clothing-store","college",
22
+ "commercial","cricket","cross","dam","danger","disability","dog-park","embassy",
23
+ "emergency-telephone","entrance","farm","fast-food","ferry","fire-station","fuel","garden",
24
+ "golf","grocery","hairdresser","harbor","heart","heliport","hospital","industrial",
25
+ "land-use","laundry","library","lighthouse","lodging","logging","london-underground",
26
+ "marker-stroked","marker","minefield","mobilephone","monument","museum","music","oil-well",
27
+ "park2","park","parking-garage","parking","pharmacy","pitch","place-of-worship",
28
+ "playground","police","polling-place","post","prison","rail-above","rail-light",
29
+ "rail-metro","rail-underground","rail","religious-christian","religious-jewish",
30
+ "religious-muslim","restaurant","roadblock","rocket","school","scooter","shop","skiing",
31
+ "slaughterhouse","soccer","square-stroked","square","star-stroked","star","suitcase",
32
+ "swimming","telephone","tennis","theatre","toilets","town-hall","town","triangle-stroked",
33
+ "triangle","village","warehouse","waste-basket","water","wetland","zoo"
34
+ ],
35
+ defaultColor: "#0a0",
36
+ defaultIcon: "circle-stroked",
37
+ defaultSize: "m",
38
+ apiUrl: "https://api.tiles.mapbox.com/v3/marker/",
39
+ smallOptions: {
40
+ iconSize: [20, 50],
41
+ popupAnchor: [0,-20]
42
+ },
43
+ mediumOptions: {
44
+ iconSize: [30,70],
45
+ popupAnchor: [0,-30]
46
+ },
47
+ largeOptions: {
48
+ iconSize: [36,90],
49
+ popupAnchor: [0,-40]
50
+ }
51
+ };
52
+
53
+ L.MakiMarkers.Icon = L.Icon.extend({
54
+ options: {
55
+ //Maki icon: any from https://www.mapbox.com/maki/ (ref: L.MakiMarkers.icons)
56
+ icon: L.MakiMarkers.defaultIcon,
57
+ //Marker color: short or long form hex color code
58
+ color: L.MakiMarkers.defaultColor,
59
+ //Marker size: "s" (small), "m" (medium), or "l" (large)
60
+ size: L.MakiMarkers.defaultSize,
61
+ shadowAnchor: null,
62
+ shadowSize: null,
63
+ shadowUrl: null,
64
+ className: "maki-marker"
65
+ },
66
+
67
+ initialize: function(options) {
68
+ var pin;
69
+
70
+ options = L.setOptions(this, options);
71
+
72
+ switch (options.size) {
73
+ case "s":
74
+ L.extend(options, L.MakiMarkers.smallOptions);
75
+ break;
76
+ case "l":
77
+ L.extend(options, L.MakiMarkers.largeOptions);
78
+ break;
79
+ default:
80
+ options.size = "m";
81
+ L.extend(options, L.MakiMarkers.mediumOptions);
82
+ break;
83
+ }
84
+
85
+
86
+ pin = "pin-" + options.size;
87
+
88
+ if (options.icon !== null) {
89
+ pin += "-" + options.icon;
90
+ }
91
+
92
+ if (options.color !== null) {
93
+ if (options.color.charAt(0) === "#") {
94
+ options.color = options.color.substr(1);
95
+ }
96
+
97
+ pin += "+" + options.color;
98
+ }
99
+
100
+ options.iconUrl = "" + L.MakiMarkers.apiUrl + pin + ".png";
101
+ options.iconRetinaUrl = L.MakiMarkers.apiUrl + pin + "@2x.png";
102
+ }
103
+ });
104
+
105
+ L.MakiMarkers.icon = function(options) {
106
+ return new L.MakiMarkers.Icon(options);
107
+ };
108
+ })();
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: leaflet-makimarkers-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ platform: ruby
6
+ authors:
7
+ - Volker Wiegand
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ description: Rails engine for the Leaflet.MakiMarkers code
28
+ email:
29
+ - volker.wiegand@cvw.de
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - LICENSE.txt
35
+ - README.md
36
+ - lib/leaflet/makimarkers/rails.rb
37
+ - lib/leaflet/makimarkers/rails/version.rb
38
+ - vendor/assets/javascripts/leaflet.makimarkers.js
39
+ homepage: https://github.com/volkerwiegand/leaflet-makimarkers-rails
40
+ licenses:
41
+ - MIT
42
+ metadata: {}
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project:
59
+ rubygems_version: 2.4.2
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: Leaflet plugin to create map icons using Maki Icons from MapBox.
63
+ test_files: []