leaflet-extra_markers-rails 1.0.1

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: f93dcb4e2f6325504b63669a989c0b7385df0687
4
+ data.tar.gz: 3f6309c58ebc1a601bee55fd664f1dd4f4e1465d
5
+ SHA512:
6
+ metadata.gz: f9e8a7e4d8c594bc17ed338a1ffb9adfef02b7b765bb835e4095755fc672f0bd4180f3d9435cb814459cd09575ccfe0ccfb2a87a6a366fab300849f8a226a8bf
7
+ data.tar.gz: c4319c540bcffb49a2521b17ef50dcc54d28d4ff4e33948d880636b8d1968fec0f4142063b0d09abaabb737d2f18bdd83e6750554bf19b45a36c5de4fa510c42
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /leaflet.extra_markers/
@@ -0,0 +1,3 @@
1
+ [submodule "leaflet.extra_markers"]
2
+ path = leaflet.extra_markers
3
+ url = git://github.com/coryasilva/Leaflet.ExtraMarkers.git
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.0
4
+ before_install: gem install bundler -v 1.10.4
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in leaflet-extra_markers-rails.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Thomas Kienlen
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.
@@ -0,0 +1,39 @@
1
+ # leaflet-extra_markers-rails
2
+
3
+ Leaflet.ExtraMarkers packaged to be use with Rails assets pipeline.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'leaflet-extra_markers-rails'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install leaflet-extra_markers-rails
20
+
21
+ ## Usage
22
+
23
+ Use this gem to include Leaflet.ExtraMarkers to your Rails project.
24
+
25
+ Include it into your assets files.
26
+
27
+ app/assets/stylesheets/application.css(.sass)
28
+ ```
29
+ //= require leaflet.extra-markers
30
+ ```
31
+
32
+ app/assets/javascripts/application.js(.coffee)
33
+ ```
34
+ //= require leaflet.extra-markers
35
+ ```
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,37 @@
1
+ require "bundler/gem_tasks"
2
+ require "fileutils"
3
+
4
+ desc "Update included Leaflet.ExtraMarkers sources"
5
+ task :update_from_source do |t, args|
6
+ current_directory = File.expand_path File.dirname(__FILE__)
7
+ source_directory = File.join current_directory, 'leaflet.extra_markers', 'src'
8
+ assets_directory = File.join current_directory, 'vendor', 'assets'
9
+
10
+ puts "Updating sources..."
11
+
12
+ `git submodule update`
13
+
14
+ puts "Trashing the old stuff..."
15
+
16
+ FileUtils.rm_r Dir.glob(File.join assets_directory, '*')
17
+
18
+ puts "Copying over other files..."
19
+
20
+ {
21
+ "images/*" => File.join(assets_directory, 'images'),
22
+ "*.css" => File.join(assets_directory, "stylesheets"),
23
+ "*.js" => File.join(assets_directory, "javascripts")
24
+ }.each do |source, destination|
25
+ FileUtils.mkdir_p destination
26
+ FileUtils.cp_r Dir.glob(File.join source_directory, source), destination
27
+ end
28
+
29
+ puts "Patching css for assets ..."
30
+
31
+ Dir.glob(File.join(assets_directory, "stylesheets", "*.css")).each do |css_file|
32
+ puts css_file
33
+ `sed -i -e "s/url('images/url('\\/assets/" #{css_file}`
34
+ end
35
+
36
+ puts "Done"
37
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "leaflet/extra_markers/rails"
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
@@ -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
@@ -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 'leaflet-extra_markers-rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "leaflet-extra_markers-rails"
8
+ spec.version = Leaflet::ExtraMarkers::Rails::VERSION
9
+ spec.authors = ["Thomas Kienlen"]
10
+ spec.email = ["kommander@laposte.net"]
11
+
12
+ spec.summary = %q{Leaflet.extra-markers library as a gem, ready for Rails asset pipeline}
13
+ spec.description = spec.summary
14
+ spec.homepage = "https://github.com/kmmndr/leaflet-extra_markers-rails"
15
+ spec.license = "MIT"
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,5 @@
1
+ require "leaflet-extra_markers-rails/version"
2
+
3
+ if defined?(Rails)
4
+ require "leaflet-extra_markers-rails/engine"
5
+ end
@@ -0,0 +1,18 @@
1
+ module Leaflet
2
+ module ExtraMarkers
3
+ module Rails
4
+ class Engine < ::Rails::Engine
5
+ initializer 'leaflet-extra_marker-rails' do |app|
6
+ app.config.assets.precompile += [
7
+ 'markers_default.png',
8
+ 'markers_default@2x.png',
9
+ 'markers_shadow.png',
10
+ 'markers_shadow@2x.png',
11
+ 'leaflet.extra-markers.css',
12
+ 'leaflet.extra-markers.js'
13
+ ]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ module Leaflet
2
+ module ExtraMarkers
3
+ module Rails
4
+ VERSION = "1.0.1"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,102 @@
1
+ /*
2
+ * Leaflet.ExtraMarkers is a near copy of Leaflet.AwesomeMarkers (c) 2012-2013, Lennard Voogdt, https://github.com/lvoogdt
3
+ * Making color changes and adding shapes are what drove me to make this copy and not a fork...
4
+ */
5
+
6
+ /*global L*/
7
+
8
+ (function (window, document, undefined) {
9
+ "use strict";
10
+
11
+ L.ExtraMarkers = {};
12
+
13
+ L.ExtraMarkers.version = '1.0.1';
14
+
15
+ L.ExtraMarkers.Icon = L.Icon.extend({
16
+ options: {
17
+ iconSize: [35, 45],
18
+ iconAnchor: [17, 42],
19
+ popupAnchor: [1, -32],
20
+ shadowAnchor: [10, 12],
21
+ shadowSize: [36, 16],
22
+ className: 'extra-marker',
23
+ prefix: '',
24
+ extraClasses: '',
25
+ shape: 'circle',
26
+ icon: '',
27
+ markerColor: 'red',
28
+ iconColor: '#fff'
29
+ },
30
+
31
+ initialize: function (options) {
32
+ options = L.Util.setOptions(this, options);
33
+ },
34
+
35
+ createIcon: function () {
36
+ var div = document.createElement('div'),
37
+ options = this.options;
38
+
39
+ if (options.icon) {
40
+ div.innerHTML = this._createInner();
41
+ }
42
+
43
+ if (options.bgPos) {
44
+ div.style.backgroundPosition =
45
+ (-options.bgPos.x) + 'px ' + (-options.bgPos.y) + 'px';
46
+ }
47
+
48
+ this._setIconStyles(div, options.shape + '-' + options.markerColor);
49
+ return div;
50
+ },
51
+
52
+ _createInner: function() {
53
+ var iconClass, iconSpinClass = "", iconColorClass = "", iconColorStyle = "", options = this.options;
54
+
55
+ if(options.iconColor) {
56
+ iconColorStyle = "style='color: " + options.iconColor + "' ";
57
+ }
58
+
59
+ return "<i " + iconColorStyle + "class='" + options.extraClasses + " " + options.prefix + " " + options.icon + "'></i>";
60
+ },
61
+
62
+ _setIconStyles: function (img, name) {
63
+ var options = this.options,
64
+ size = L.point(options[name === 'shadow' ? 'shadowSize' : 'iconSize']),
65
+ anchor;
66
+
67
+ if (name === 'shadow') {
68
+ anchor = L.point(options.shadowAnchor || options.iconAnchor);
69
+ } else {
70
+ anchor = L.point(options.iconAnchor);
71
+ }
72
+
73
+ if (!anchor && size) {
74
+ anchor = size.divideBy(2, true);
75
+ }
76
+
77
+ img.className = 'extra-marker-' + name + ' ' + options.className;
78
+
79
+ if (anchor) {
80
+ img.style.marginLeft = (-anchor.x) + 'px';
81
+ img.style.marginTop = (-anchor.y) + 'px';
82
+ }
83
+
84
+ if (size) {
85
+ img.style.width = size.x + 'px';
86
+ img.style.height = size.y + 'px';
87
+ }
88
+ },
89
+
90
+ createShadow: function () {
91
+ var div = document.createElement('div');
92
+
93
+ this._setIconStyles(div, 'shadow');
94
+ return div;
95
+ }
96
+ });
97
+
98
+ L.ExtraMarkers.icon = function (options) {
99
+ return new L.ExtraMarkers.Icon(options);
100
+ };
101
+
102
+ }(this, document));
@@ -0,0 +1,110 @@
1
+ /* Version 1.0.1 */
2
+ /* Marker setup */
3
+ .extra-marker {
4
+ background: url('/assets/markers_default.png') no-repeat 0 0;
5
+ width: 35px;
6
+ height: 46px;
7
+ position:absolute;
8
+ left:0;
9
+ top:0;
10
+ display: block;
11
+ text-align: center;
12
+ }
13
+
14
+ .extra-marker-shadow {
15
+ background: url('/assets/markers_shadow.png') no-repeat 0 0;
16
+ width: 36px;
17
+ height: 16px;
18
+ }
19
+
20
+ /* Retina displays */
21
+ @media (min--moz-device-pixel-ratio: 1.5),(-o-min-device-pixel-ratio: 3/2),
22
+ (-webkit-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5),(min-resolution: 1.5dppx) {
23
+ .extra-marker {
24
+ background-image: url('/assets/markers_default@2x.png');
25
+ background-size: 540px 184px;
26
+ }
27
+ .extra-marker-shadow {
28
+ background-image: url('/assets/markers_shadow@2x.png');
29
+ background-size: 35px 16px;
30
+ }
31
+ }
32
+
33
+ /* Icons */
34
+ .extra-marker i {
35
+ color: #fff;
36
+ margin-top: 10px;
37
+ display: inline-block;
38
+ font-size: 14px;
39
+ }
40
+
41
+ /* Semantic UI Fix */
42
+ .extra-marker i.icon {
43
+ margin-right: 0;
44
+ opacity: 1;
45
+ }
46
+
47
+ /* Sprites setup */
48
+ .extra-marker-circle-red { background-position: 0 0 }
49
+ .extra-marker-circle-orange-dark { background-position: -36px 0 }
50
+ .extra-marker-circle-orange { background-position: -72px 0 }
51
+ .extra-marker-circle-yellow { background-position: -108px 0 }
52
+ .extra-marker-circle-blue-dark { background-position: -144px 0 }
53
+ .extra-marker-circle-blue { background-position: -180px 0 }
54
+ .extra-marker-circle-cyan { background-position: -216px 0 }
55
+ .extra-marker-circle-purple { background-position: -252px 0 }
56
+ .extra-marker-circle-violet { background-position: -288px 0 }
57
+ .extra-marker-circle-pink { background-position: -324px 0 }
58
+ .extra-marker-circle-green-dark { background-position: -360px 0 }
59
+ .extra-marker-circle-green { background-position: -396px 0 }
60
+ .extra-marker-circle-green-light { background-position: -432px 0 }
61
+ .extra-marker-circle-black { background-position: -468px 0 }
62
+ .extra-marker-circle-white { background-position: -504px 0 }
63
+
64
+ .extra-marker-square-red { background-position: 0 -46px }
65
+ .extra-marker-square-orange-dark { background-position: -36px -46px }
66
+ .extra-marker-square-orange { background-position: -72px -46px }
67
+ .extra-marker-square-yellow { background-position: -108px -46px }
68
+ .extra-marker-square-blue-dark { background-position: -144px -46px }
69
+ .extra-marker-square-blue { background-position: -180px -46px }
70
+ .extra-marker-square-cyan { background-position: -216px -46px }
71
+ .extra-marker-square-purple { background-position: -252px -46px }
72
+ .extra-marker-square-violet { background-position: -288px -46px }
73
+ .extra-marker-square-pink { background-position: -324px -46px }
74
+ .extra-marker-square-green-dark { background-position: -360px -46px }
75
+ .extra-marker-square-green { background-position: -396px -46px }
76
+ .extra-marker-square-green-light { background-position: -432px -46px }
77
+ .extra-marker-square-black { background-position: -468px -46px }
78
+ .extra-marker-square-white { background-position: -504px -46px }
79
+
80
+ .extra-marker-star-red { background-position: 0 -92px }
81
+ .extra-marker-star-orange-dark { background-position: -36px -92px }
82
+ .extra-marker-star-orange { background-position: -72px -92px }
83
+ .extra-marker-star-yellow { background-position: -108px -92px }
84
+ .extra-marker-star-blue-dark { background-position: -144px -92px }
85
+ .extra-marker-star-blue { background-position: -180px -92px }
86
+ .extra-marker-star-cyan { background-position: -216px -92px }
87
+ .extra-marker-star-purple { background-position: -252px -92px }
88
+ .extra-marker-star-violet { background-position: -288px -92px }
89
+ .extra-marker-star-pink { background-position: -324px -92px }
90
+ .extra-marker-star-green-dark { background-position: -360px -92px }
91
+ .extra-marker-star-green { background-position: -396px -92px }
92
+ .extra-marker-star-green-light { background-position: -432px -92px }
93
+ .extra-marker-star-black { background-position: -468px -92px }
94
+ .extra-marker-star-white { background-position: -504px -92px }
95
+
96
+ .extra-marker-penta-red { background-position: 0 -138px }
97
+ .extra-marker-penta-orange-dark { background-position: -36px -138px }
98
+ .extra-marker-penta-orange { background-position: -72px -138px }
99
+ .extra-marker-penta-yellow { background-position: -108px -138px }
100
+ .extra-marker-penta-blue-dark { background-position: -144px -138px }
101
+ .extra-marker-penta-blue { background-position: -180px -138px }
102
+ .extra-marker-penta-cyan { background-position: -216px -138px }
103
+ .extra-marker-penta-purple { background-position: -252px -138px }
104
+ .extra-marker-penta-violet { background-position: -288px -138px }
105
+ .extra-marker-penta-pink { background-position: -324px -138px }
106
+ .extra-marker-penta-green-dark { background-position: -360px -138px }
107
+ .extra-marker-penta-green { background-position: -396px -138px }
108
+ .extra-marker-penta-green-light { background-position: -432px -138px }
109
+ .extra-marker-penta-black { background-position: -468px -138px }
110
+ .extra-marker-penta-white { background-position: -504px -138px }
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: leaflet-extra_markers-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Thomas Kienlen
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-07-10 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: Leaflet.extra-markers library as a gem, ready for Rails asset pipeline
42
+ email:
43
+ - kommander@laposte.net
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".gitmodules"
50
+ - ".travis.yml"
51
+ - Gemfile
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - bin/console
56
+ - bin/setup
57
+ - leaflet-extra_markers-rails.gemspec
58
+ - leaflet.extra_markers/.gitkeep
59
+ - lib/leaflet-extra_markers-rails.rb
60
+ - lib/leaflet-extra_markers-rails/engine.rb
61
+ - lib/leaflet-extra_markers-rails/version.rb
62
+ - vendor/assets/images/markers_default.png
63
+ - vendor/assets/images/markers_default@2x.png
64
+ - vendor/assets/images/markers_shadow.png
65
+ - vendor/assets/images/markers_shadow@2x.png
66
+ - vendor/assets/javascripts/leaflet.extra-markers.js
67
+ - vendor/assets/stylesheets/leaflet.extra-markers.css
68
+ homepage: https://github.com/kmmndr/leaflet-extra_markers-rails
69
+ licenses:
70
+ - MIT
71
+ metadata: {}
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubyforge_project:
88
+ rubygems_version: 2.4.5
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Leaflet.extra-markers library as a gem, ready for Rails asset pipeline
92
+ test_files: []