├── .bowerrc
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .jshintrc
├── .travis.yml
├── CONTRIBUTING.md
├── Gruntfile.js
├── LICENSE
├── README.md
├── app
├── .buildignore
├── .htaccess
├── 404.html
├── angular-leaflet-directive.min.js
├── favicon.ico
├── humans.txt
├── images
│ ├── astrodigital.png
│ ├── logo_horizontal_white.png
│ ├── ndvi.png
│ ├── noun_17256.png
│ ├── noun_17256_w.png
│ ├── noun_2019_cc_noattr.png
│ ├── noun_2019_cc_noattr_w.png
│ ├── noun_24967.png
│ ├── noun_24967_down.png
│ ├── noun_24967_up.png
│ ├── noun_24967_w.png
│ ├── noun_52713_cc.png
│ ├── noun_52713_cc_noattr_w.png
│ ├── noun_88350_cc_noattr.png
│ ├── noun_88350_cc_noattr_w.png
│ ├── noun_88351_cc_noattr.png
│ ├── noun_88351_cc_noattr_w.png
│ ├── satellite.gif
│ ├── truecolor.png
│ ├── urban.png
│ └── yeoman.png
├── index.html
├── jquery.nouislider.all.min.js
├── jquery.nouislider.min.css
├── jquery.nouislider.min.js
├── jquery.nouislider.pips.min.css
├── robots.txt
├── scripts
│ ├── app.js
│ ├── controllers
│ │ ├── advanced.js
│ │ └── main.js
│ └── filters
│ │ └── suffix.js
├── styles
│ └── main.scss
└── views
│ ├── advanced.html
│ ├── main.html
│ └── modal.html
├── attributions.md
├── bower.json
├── package.json
└── test
├── .jshintrc
├── karma.conf.js
├── mock
└── landsatAPI.json
└── spec
└── controllers
└── main.js
/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "bower_components"
3 | }
4 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 |
8 | [*]
9 |
10 | # Change these settings to your own preference
11 | indent_style = space
12 | indent_size = 2
13 |
14 | # We recommend you to keep these unchanged
15 | end_of_line = lf
16 | charset = utf-8
17 | trim_trailing_whitespace = true
18 | insert_final_newline = true
19 |
20 | [*.md]
21 | trim_trailing_whitespace = false
22 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .tmp
3 | .sass-cache
4 | bower_components
5 | .project
6 | .resources/
7 | dist
8 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "node": true,
3 | "browser": true,
4 | "esnext": true,
5 | "bitwise": true,
6 | "camelcase": true,
7 | "curly": true,
8 | "eqeqeq": true,
9 | "immed": true,
10 | "indent": 2,
11 | "latedef": true,
12 | "newcap": true,
13 | "noarg": true,
14 | "quotmark": "single",
15 | "undef": true,
16 | "unused": true,
17 | "strict": true,
18 | "trailing": true,
19 | "smarttabs": true,
20 | "globals": {
21 | "angular": false,
22 | "d3": false,
23 | "jQuery": false,
24 | "Spinner": false
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '0.12'
4 |
5 | env:
6 | global:
7 | - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
8 |
9 | before_script:
10 | - npm install -g bower grunt-cli
11 | - bower install
12 | - gem install sass --version "=3.4.9"
13 | - gem install compass --version "=1.0.1"
14 |
15 | script: grunt build
16 |
17 | deploy:
18 | provider: s3
19 | access_key_id: AKIAJR4CUXWRKZDB6RAA
20 | secret_access_key:
21 | secure: cYYpx+LVDFLQqMGDuUNODU6kqEFsr4C58wSah4gmHjnK5FrZIcNF6E7A4qEu/yVI3sch6+hZBT4ckprQF0rGQd4EB2graXjmd47hALjSF3srXlOmg2BpOYai/yC08Bj48mzjwQGEW2rBhWSu3aFDgzCuq/K9CMuGXep1AaUWGTM=
22 | bucket: libra.developmentseed.org
23 | local-dir: dist
24 | skip_cleanup: true
25 | acl: public_read
26 | on:
27 | repo: AstroDigital/libra
28 | branch: master
29 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | #Contribution guidelines
2 |
3 | There are many ways to contribute to a project, below are some examples:
4 |
5 | - Report bugs, ideas, requests for features by creating “Issues” in the project repository.
6 | - Fork the code and play with it, whether you later choose to make a pull request or not.
7 | - Create pull requests of changes that you think are laudatory. From typos to major design flaws, you will find a target-rich environment for improvements.
8 |
9 | ## Style
10 | There is no set style for this project, but please try to match existing coding styles as closely as possible.
11 |
12 | ## Tests
13 | If you're going to add new features, please make sure they come along with tests to make sure everything works as expected. Outside minor changes, Pull Requests will not be accepted without associated tests.
14 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | // Generated on 2015-01-05 using generator-angular 0.10.0
2 | 'use strict';
3 |
4 | // # Globbing
5 | // for performance reasons we're only matching one level down:
6 | // 'test/spec/{,*/}*.js'
7 | // use this if you want to recursively match all subfolders:
8 | // 'test/spec/**/*.js'
9 |
10 | module.exports = function (grunt) {
11 |
12 | // Load grunt tasks automatically
13 | require('load-grunt-tasks')(grunt);
14 |
15 | // Time how long tasks take. Can help when optimizing build times
16 | require('time-grunt')(grunt);
17 |
18 | // Configurable paths for the application
19 | var appConfig = {
20 | app: require('./bower.json').appPath || 'app',
21 | dist: 'dist'
22 | };
23 |
24 | // Define the configuration for all the tasks
25 | grunt.initConfig({
26 |
27 | // Project settings
28 | yeoman: appConfig,
29 |
30 | // Watches files for changes and runs tasks based on the changed files
31 | watch: {
32 | bower: {
33 | files: ['bower.json'],
34 | tasks: ['wiredep']
35 | },
36 | js: {
37 | files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
38 | tasks: ['newer:jshint:all'],
39 | options: {
40 | livereload: '<%= connect.options.livereload %>'
41 | }
42 | },
43 | jsTest: {
44 | files: ['test/spec/{,*/}*.js'],
45 | tasks: ['newer:jshint:test', 'karma']
46 | },
47 | compass: {
48 | files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
49 | tasks: ['compass:server', 'autoprefixer']
50 | },
51 | gruntfile: {
52 | files: ['Gruntfile.js']
53 | },
54 | livereload: {
55 | options: {
56 | livereload: '<%= connect.options.livereload %>'
57 | },
58 | files: [
59 | '<%= yeoman.app %>/{,*/}*.html',
60 | '.tmp/styles/{,*/}*.css',
61 | '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
62 | ]
63 | }
64 | },
65 |
66 | // The actual grunt server settings
67 | connect: {
68 | options: {
69 | port: 9090,
70 | // Change this to '0.0.0.0' to access the server from outside.
71 | hostname: 'localhost',
72 | livereload: 35729
73 | },
74 | livereload: {
75 | options: {
76 | open: true,
77 | middleware: function (connect) {
78 | return [
79 | connect.static('.tmp'),
80 | connect().use(
81 | '/bower_components',
82 | connect.static('./bower_components')
83 | ),
84 | connect.static(appConfig.app)
85 | ];
86 | }
87 | }
88 | },
89 | test: {
90 | options: {
91 | port: 9001,
92 | middleware: function (connect) {
93 | return [
94 | connect.static('.tmp'),
95 | connect.static('test'),
96 | connect().use(
97 | '/bower_components',
98 | connect.static('./bower_components')
99 | ),
100 | connect.static(appConfig.app)
101 | ];
102 | }
103 | }
104 | },
105 | dist: {
106 | options: {
107 | open: true,
108 | base: '<%= yeoman.dist %>'
109 | }
110 | }
111 | },
112 |
113 | // Make sure code styles are up to par and there are no obvious mistakes
114 | jshint: {
115 | options: {
116 | jshintrc: '.jshintrc',
117 | reporter: require('jshint-stylish')
118 | },
119 | all: {
120 | src: [
121 | 'Gruntfile.js',
122 | '<%= yeoman.app %>/scripts/{,*/}*.js'
123 | ]
124 | },
125 | test: {
126 | options: {
127 | jshintrc: 'test/.jshintrc'
128 | },
129 | src: ['test/spec/{,*/}*.js']
130 | }
131 | },
132 |
133 | // Empties folders to start fresh
134 | clean: {
135 | dist: {
136 | files: [{
137 | dot: true,
138 | src: [
139 | '.tmp',
140 | '<%= yeoman.dist %>/{,*/}*',
141 | '!<%= yeoman.dist %>/.git{,*/}*'
142 | ]
143 | }]
144 | },
145 | server: '.tmp'
146 | },
147 |
148 | // Add vendor prefixed styles
149 | autoprefixer: {
150 | options: {
151 | browsers: ['last 1 version']
152 | },
153 | dist: {
154 | files: [{
155 | expand: true,
156 | cwd: '.tmp/styles/',
157 | src: '{,*/}*.css',
158 | dest: '.tmp/styles/'
159 | }]
160 | }
161 | },
162 |
163 | // Automatically inject Bower components into the app
164 | wiredep: {
165 | app: {
166 | src: ['<%= yeoman.app %>/index.html'],
167 | ignorePath: /\.\.\//
168 | },
169 | sass: {
170 | src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
171 | ignorePath: /(\.\.\/){1,2}bower_components\//
172 | }
173 | },
174 |
175 | // Compiles Sass to CSS and generates necessary files if requested
176 | compass: {
177 | options: {
178 | sassDir: '<%= yeoman.app %>/styles',
179 | cssDir: '.tmp/styles',
180 | generatedImagesDir: '.tmp/images/generated',
181 | imagesDir: '<%= yeoman.app %>/images',
182 | javascriptsDir: '<%= yeoman.app %>/scripts',
183 | fontsDir: '<%= yeoman.app %>/styles/fonts',
184 | importPath: './bower_components',
185 | httpImagesPath: '/images',
186 | httpGeneratedImagesPath: '/images/generated',
187 | httpFontsPath: '/styles/fonts',
188 | relativeAssets: false,
189 | assetCacheBuster: false,
190 | raw: 'Sass::Script::Number.precision = 10\n'
191 | },
192 | dist: {
193 | options: {
194 | generatedImagesDir: '<%= yeoman.dist %>/images/generated'
195 | }
196 | },
197 | server: {
198 | options: {
199 | debugInfo: true
200 | }
201 | }
202 | },
203 |
204 | // Renames files for browser caching purposes
205 | filerev: {
206 | dist: {
207 | src: [
208 | '<%= yeoman.dist %>/scripts/{,*/}*.js',
209 | '<%= yeoman.dist %>/styles/{,*/}*.css',
210 | '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
211 | '<%= yeoman.dist %>/styles/fonts/*'
212 | ]
213 | }
214 | },
215 |
216 | // Reads HTML for usemin blocks to enable smart builds that automatically
217 | // concat, minify and revision files. Creates configurations in memory so
218 | // additional tasks can operate on them
219 | useminPrepare: {
220 | html: '<%= yeoman.app %>/index.html',
221 | options: {
222 | dest: '<%= yeoman.dist %>',
223 | flow: {
224 | html: {
225 | steps: {
226 | js: ['concat', 'uglifyjs'],
227 | css: ['cssmin']
228 | },
229 | post: {}
230 | }
231 | }
232 | }
233 | },
234 |
235 | // Performs rewrites based on filerev and the useminPrepare configuration
236 | usemin: {
237 | html: ['<%= yeoman.dist %>/{,*/}*.html'],
238 | css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
239 | options: {
240 | assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images']
241 | }
242 | },
243 |
244 | // The following *-min tasks will produce minified files in the dist folder
245 | // By default, your `index.html`'s will take care of
246 | // minification. These next options are pre-configured if you do not wish
247 | // to use the Usemin blocks.
248 | // cssmin: {
249 | // dist: {
250 | // files: {
251 | // '<%= yeoman.dist %>/styles/main.css': [
252 | // '.tmp/styles/{,*/}*.css'
253 | // ]
254 | // }
255 | // }
256 | // },
257 | // uglify: {
258 | // dist: {
259 | // files: {
260 | // '<%= yeoman.dist %>/scripts/scripts.js': [
261 | // '<%= yeoman.dist %>/scripts/scripts.js'
262 | // ]
263 | // }
264 | // }
265 | // },
266 | // concat: {
267 | // dist: {}
268 | // },
269 |
270 | imagemin: {
271 | dist: {
272 | files: [{
273 | expand: true,
274 | cwd: '<%= yeoman.app %>/images',
275 | src: '{,*/}*.{png,jpg,jpeg,gif}',
276 | dest: '<%= yeoman.dist %>/images'
277 | }]
278 | }
279 | },
280 |
281 | svgmin: {
282 | dist: {
283 | files: [{
284 | expand: true,
285 | cwd: '<%= yeoman.app %>/images',
286 | src: '{,*/}*.svg',
287 | dest: '<%= yeoman.dist %>/images'
288 | }]
289 | }
290 | },
291 |
292 | htmlmin: {
293 | dist: {
294 | options: {
295 | collapseWhitespace: true,
296 | conservativeCollapse: true,
297 | collapseBooleanAttributes: true,
298 | removeCommentsFromCDATA: true,
299 | removeOptionalTags: true
300 | },
301 | files: [{
302 | expand: true,
303 | cwd: '<%= yeoman.dist %>',
304 | src: ['*.html', 'views/{,*/}*.html'],
305 | dest: '<%= yeoman.dist %>'
306 | }]
307 | }
308 | },
309 |
310 | // ng-annotate tries to make the code safe for minification automatically
311 | // by using the Angular long form for dependency injection.
312 | ngAnnotate: {
313 | dist: {
314 | files: [{
315 | expand: true,
316 | cwd: '.tmp/concat/scripts',
317 | src: ['*.js', '!oldieshim.js'],
318 | dest: '.tmp/concat/scripts'
319 | }]
320 | }
321 | },
322 |
323 | // Replace Google CDN references
324 | cdnify: {
325 | dist: {
326 | html: ['<%= yeoman.dist %>/*.html']
327 | }
328 | },
329 |
330 | // Copies remaining files to places other tasks can use
331 | copy: {
332 | dist: {
333 | files: [{
334 | expand: true,
335 | dot: true,
336 | cwd: '<%= yeoman.app %>',
337 | dest: '<%= yeoman.dist %>',
338 | src: [
339 | '*.{ico,png,txt}',
340 | '.htaccess',
341 | '*.html',
342 | 'views/{,*/}*.html',
343 | 'images/{,*/}*.{webp}',
344 | 'fonts/{,*/}*.*'
345 | ]
346 | }, {
347 | expand: true,
348 | cwd: '.tmp/images',
349 | dest: '<%= yeoman.dist %>/images',
350 | src: ['generated/*']
351 | }, {
352 | expand: true,
353 | cwd: '.',
354 | src: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/*',
355 | dest: '<%= yeoman.dist %>'
356 | }]
357 | },
358 | styles: {
359 | expand: true,
360 | cwd: '<%= yeoman.app %>/styles',
361 | dest: '.tmp/styles/',
362 | src: '{,*/}*.css'
363 | }
364 | },
365 |
366 | // Run some tasks in parallel to speed up the build process
367 | concurrent: {
368 | server: [
369 | 'compass:server'
370 | ],
371 | test: [
372 | 'compass'
373 | ],
374 | dist: [
375 | 'compass:dist',
376 | 'imagemin',
377 | 'svgmin'
378 | ]
379 | },
380 |
381 | // Test settings
382 | karma: {
383 | unit: {
384 | configFile: 'test/karma.conf.js',
385 | singleRun: true
386 | }
387 | }
388 | });
389 |
390 |
391 | grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
392 | if (target === 'dist') {
393 | return grunt.task.run(['build', 'connect:dist:keepalive']);
394 | }
395 |
396 | grunt.task.run([
397 | 'clean:server',
398 | 'wiredep',
399 | 'concurrent:server',
400 | 'autoprefixer',
401 | 'connect:livereload',
402 | 'watch'
403 | ]);
404 | });
405 |
406 | grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
407 | grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
408 | grunt.task.run(['serve:' + target]);
409 | });
410 |
411 | grunt.registerTask('test', [
412 | 'clean:server',
413 | 'concurrent:test',
414 | 'autoprefixer',
415 | 'connect:test',
416 | 'karma'
417 | ]);
418 |
419 | grunt.registerTask('build', [
420 | 'clean:dist',
421 | 'wiredep',
422 | 'useminPrepare',
423 | 'concurrent:dist',
424 | 'autoprefixer',
425 | 'concat',
426 | 'ngAnnotate',
427 | 'copy:dist',
428 | 'cdnify',
429 | 'cssmin',
430 | 'uglify',
431 | 'filerev',
432 | 'usemin',
433 | 'htmlmin'
434 | ]);
435 |
436 | grunt.registerTask('default', [
437 | 'newer:jshint',
438 | 'test',
439 | 'build'
440 | ]);
441 | };
442 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015, Development Seed
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5 |
6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 |
8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9 |
10 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11 |
12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Libra [](https://travis-ci.org/AstroDigital/libra)
2 |
3 | ## Overview
4 |
5 | Libra is an open-source, Landsat-8 imagery browser. It relies on [landsat-api](https://github.com/developmentseed/landsat-api) and an [AngularJS](https://angularjs.org/)-designed GUI to allow users to browse, sort, and download more than 275 Terabytes of open Landsat imagery.
6 |
7 | See [here](https://developmentseed.org/blog/2015/01/15/astro-digital-image-search/),
8 | [here](https://medium.com/@astrodigital/browsing-large-sets-of-satellite-imagery-7096db1a807f), and [here](https://developmentseed.org/blog/2015/01/22/announcing-libra/) for more information.
9 |
10 | ## Setting up your development environment
11 | To set up the development environment for this app, you'll need to install the following on your system:
12 |
13 | - [npm](https://www.npmjs.com/)
14 | - [Compass](http://compass-style.org/) & [Sass](http://sass-lang.com/)
15 | - [Grunt](http://gruntjs.com/) ( $ npm install -g grunt-cli )
16 | - [Bower](http://bower.io/) ($ npm install -g bower)
17 |
18 | After these basic requirements are met, run the following commands in the root project folder:
19 | ```
20 | $ npm install
21 | $ bower install
22 | ```
23 |
24 | ## Running the app
25 | To start the app running, run the following command in the root project folder.
26 |
27 | ```
28 | $ grunt serve
29 | ```
30 | Serves the site at: `http://localhost:9090` (should automatically open in
31 | your browser)
32 |
33 | ## Deploying the app
34 | To deploy the app, run the command below to create a `dist` directory in your project root
35 |
36 | ```
37 | $ grunt build
38 | ```
39 |
40 | `dist` is a directory of static HTML, CSS and JS files and can be served via any traditional web-serving mechanism.
41 |
42 | ## Future improvements
43 | - Determine a good way to show the total number of results being displayed
44 | - Add animations where applicable
45 | - When switching into the single result pane
46 | - When the top filters drop down
47 | - Make the scroll bar look a bit nicer
48 | - Add a way to toggle between various basemaps
49 | - Implement lazy loading for the results pane so not all images are loaded at
50 | the same time
51 | - Place name search
52 | - Different cluster sizes at different zoom levels
53 | - Client side caching of results (TBD)
54 | - Improved stack icons (2-3 circles for multiple results)
55 |
56 | ## Known issues
57 |
58 | - Histograms disappear when opening modal (close filters on modal open for now)
59 | - Date filter clicks back one day when opening for the first time
60 | - When over water where no scenes are returned, error message says '...you zoomed in too much' which isn't technically the exact error
61 | - We currently have an issue when drawing the histograms where we get the dreaded ```Error: $digest already in progress``` in the console. While this doesn't cause any visual issues, it does mean we can't run the test suite.
62 |
63 | ## Where to go from here?
64 |
65 | Now that you have access to all this wonderful imagery, you may be wondering what do next. There are a number of open-source tools you can use to dive into the imagery on a deeper level. A few of them are listed below:
66 |
67 | - [landsat-util](https://github.com/developmentseed/landsat-util)
68 | - [GDAL](http://www.gdal.org/) [[Landsat-8 specific tutorial](https://www.mapbox.com/blog/processing-landsat-8/)]
69 | - [QGIS](http://qgis.org) [[Tutorials](http://www.qgistutorials.com)]
70 | - [rasterio](https://github.com/mapbox/rasterio)
71 | - [Mapbox guide](https://www.mapbox.com/guides/processing-satellite-imagery/)
72 |
--------------------------------------------------------------------------------
/app/.buildignore:
--------------------------------------------------------------------------------
1 | *.coffee
--------------------------------------------------------------------------------
/app/.htaccess:
--------------------------------------------------------------------------------
1 | # Apache Configuration File
2 |
3 | # (!) Using `.htaccess` files slows down Apache, therefore, if you have access
4 | # to the main server config file (usually called `httpd.conf`), you should add
5 | # this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
6 |
7 | # ##############################################################################
8 | # # CROSS-ORIGIN RESOURCE SHARING (CORS) #
9 | # ##############################################################################
10 |
11 | # ------------------------------------------------------------------------------
12 | # | Cross-domain AJAX requests |
13 | # ------------------------------------------------------------------------------
14 |
15 | # Enable cross-origin AJAX requests.
16 | # http://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
17 | # http://enable-cors.org/
18 |
19 | #
20 | # Header set Access-Control-Allow-Origin "*"
21 | #
22 |
23 | # ------------------------------------------------------------------------------
24 | # | CORS-enabled images |
25 | # ------------------------------------------------------------------------------
26 |
27 | # Send the CORS header for images when browsers request it.
28 | # https://developer.mozilla.org/en/CORS_Enabled_Image
29 | # http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
30 | # http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
31 |
32 |
33 |
34 |
35 | SetEnvIf Origin ":" IS_CORS
36 | Header set Access-Control-Allow-Origin "*" env=IS_CORS
37 |
38 |
39 |
40 |
41 | # ------------------------------------------------------------------------------
42 | # | Web fonts access |
43 | # ------------------------------------------------------------------------------
44 |
45 | # Allow access from all domains for web fonts
46 |
47 |
48 |
49 | Header set Access-Control-Allow-Origin "*"
50 |
51 |
52 |
53 |
54 | # ##############################################################################
55 | # # ERRORS #
56 | # ##############################################################################
57 |
58 | # ------------------------------------------------------------------------------
59 | # | 404 error prevention for non-existing redirected folders |
60 | # ------------------------------------------------------------------------------
61 |
62 | # Prevent Apache from returning a 404 error for a rewrite if a directory
63 | # with the same name does not exist.
64 | # http://httpd.apache.org/docs/current/content-negotiation.html#multiviews
65 | # http://www.webmasterworld.com/apache/3808792.htm
66 |
67 | Options -MultiViews
68 |
69 | # ------------------------------------------------------------------------------
70 | # | Custom error messages / pages |
71 | # ------------------------------------------------------------------------------
72 |
73 | # You can customize what Apache returns to the client in case of an error (see
74 | # http://httpd.apache.org/docs/current/mod/core.html#errordocument), e.g.:
75 |
76 | ErrorDocument 404 /404.html
77 |
78 |
79 | # ##############################################################################
80 | # # INTERNET EXPLORER #
81 | # ##############################################################################
82 |
83 | # ------------------------------------------------------------------------------
84 | # | Better website experience |
85 | # ------------------------------------------------------------------------------
86 |
87 | # Force IE to render pages in the highest available mode in the various
88 | # cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf.
89 |
90 |
91 | Header set X-UA-Compatible "IE=edge"
92 | # `mod_headers` can't match based on the content-type, however, we only
93 | # want to send this header for HTML pages and not for the other resources
94 |
95 | Header unset X-UA-Compatible
96 |
97 |
98 |
99 | # ------------------------------------------------------------------------------
100 | # | Cookie setting from iframes |
101 | # ------------------------------------------------------------------------------
102 |
103 | # Allow cookies to be set from iframes in IE.
104 |
105 | #
106 | # Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
107 | #
108 |
109 | # ------------------------------------------------------------------------------
110 | # | Screen flicker |
111 | # ------------------------------------------------------------------------------
112 |
113 | # Stop screen flicker in IE on CSS rollovers (this only works in
114 | # combination with the `ExpiresByType` directives for images from below).
115 |
116 | # BrowserMatch "MSIE" brokenvary=1
117 | # BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
118 | # BrowserMatch "Opera" !brokenvary
119 | # SetEnvIf brokenvary 1 force-no-vary
120 |
121 |
122 | # ##############################################################################
123 | # # MIME TYPES AND ENCODING #
124 | # ##############################################################################
125 |
126 | # ------------------------------------------------------------------------------
127 | # | Proper MIME types for all files |
128 | # ------------------------------------------------------------------------------
129 |
130 |
131 |
132 | # Audio
133 | AddType audio/mp4 m4a f4a f4b
134 | AddType audio/ogg oga ogg
135 |
136 | # JavaScript
137 | # Normalize to standard type (it's sniffed in IE anyways):
138 | # http://tools.ietf.org/html/rfc4329#section-7.2
139 | AddType application/javascript js jsonp
140 | AddType application/json json
141 |
142 | # Video
143 | AddType video/mp4 mp4 m4v f4v f4p
144 | AddType video/ogg ogv
145 | AddType video/webm webm
146 | AddType video/x-flv flv
147 |
148 | # Web fonts
149 | AddType application/font-woff woff
150 | AddType application/vnd.ms-fontobject eot
151 |
152 | # Browsers usually ignore the font MIME types and sniff the content,
153 | # however, Chrome shows a warning if other MIME types are used for the
154 | # following fonts.
155 | AddType application/x-font-ttf ttc ttf
156 | AddType font/opentype otf
157 |
158 | # Make SVGZ fonts work on iPad:
159 | # https://twitter.com/FontSquirrel/status/14855840545
160 | AddType image/svg+xml svg svgz
161 | AddEncoding gzip svgz
162 |
163 | # Other
164 | AddType application/octet-stream safariextz
165 | AddType application/x-chrome-extension crx
166 | AddType application/x-opera-extension oex
167 | AddType application/x-shockwave-flash swf
168 | AddType application/x-web-app-manifest+json webapp
169 | AddType application/x-xpinstall xpi
170 | AddType application/xml atom rdf rss xml
171 | AddType image/webp webp
172 | AddType image/x-icon ico
173 | AddType text/cache-manifest appcache manifest
174 | AddType text/vtt vtt
175 | AddType text/x-component htc
176 | AddType text/x-vcard vcf
177 |
178 |
179 |
180 | # ------------------------------------------------------------------------------
181 | # | UTF-8 encoding |
182 | # ------------------------------------------------------------------------------
183 |
184 | # Use UTF-8 encoding for anything served as `text/html` or `text/plain`.
185 | AddDefaultCharset utf-8
186 |
187 | # Force UTF-8 for certain file formats.
188 |
189 | AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml
190 |
191 |
192 |
193 | # ##############################################################################
194 | # # URL REWRITES #
195 | # ##############################################################################
196 |
197 | # ------------------------------------------------------------------------------
198 | # | Rewrite engine |
199 | # ------------------------------------------------------------------------------
200 |
201 | # Turning on the rewrite engine and enabling the `FollowSymLinks` option is
202 | # necessary for the following directives to work.
203 |
204 | # If your web host doesn't allow the `FollowSymlinks` option, you may need to
205 | # comment it out and use `Options +SymLinksIfOwnerMatch` but, be aware of the
206 | # performance impact: http://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
207 |
208 | # Also, some cloud hosting services require `RewriteBase` to be set:
209 | # http://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-mod-rewrite-not-working-on-my-site
210 |
211 |
212 | Options +FollowSymlinks
213 | # Options +SymLinksIfOwnerMatch
214 | RewriteEngine On
215 | # RewriteBase /
216 |
217 |
218 | # ------------------------------------------------------------------------------
219 | # | Suppressing / Forcing the "www." at the beginning of URLs |
220 | # ------------------------------------------------------------------------------
221 |
222 | # The same content should never be available under two different URLs especially
223 | # not with and without "www." at the beginning. This can cause SEO problems
224 | # (duplicate content), therefore, you should choose one of the alternatives and
225 | # redirect the other one.
226 |
227 | # By default option 1 (no "www.") is activated:
228 | # http://no-www.org/faq.php?q=class_b
229 |
230 | # If you'd prefer to use option 2, just comment out all the lines from option 1
231 | # and uncomment the ones from option 2.
232 |
233 | # IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
234 |
235 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
236 |
237 | # Option 1: rewrite www.example.com → example.com
238 |
239 |
240 | RewriteCond %{HTTPS} !=on
241 | RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
242 | RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
243 |
244 |
245 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
246 |
247 | # Option 2: rewrite example.com → www.example.com
248 |
249 | # Be aware that the following might not be a good idea if you use "real"
250 | # subdomains for certain parts of your website.
251 |
252 | #
253 | # RewriteCond %{HTTPS} !=on
254 | # RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
255 | # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
256 | #
257 |
258 |
259 | # ##############################################################################
260 | # # SECURITY #
261 | # ##############################################################################
262 |
263 | # ------------------------------------------------------------------------------
264 | # | Content Security Policy (CSP) |
265 | # ------------------------------------------------------------------------------
266 |
267 | # You can mitigate the risk of cross-site scripting and other content-injection
268 | # attacks by setting a Content Security Policy which whitelists trusted sources
269 | # of content for your site.
270 |
271 | # The example header below allows ONLY scripts that are loaded from the current
272 | # site's origin (no inline scripts, no CDN, etc). This almost certainly won't
273 | # work as-is for your site!
274 |
275 | # To get all the details you'll need to craft a reasonable policy for your site,
276 | # read: http://html5rocks.com/en/tutorials/security/content-security-policy (or
277 | # see the specification: http://w3.org/TR/CSP).
278 |
279 | #
280 | # Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
281 | #
282 | # Header unset Content-Security-Policy
283 | #
284 | #
285 |
286 | # ------------------------------------------------------------------------------
287 | # | File access |
288 | # ------------------------------------------------------------------------------
289 |
290 | # Block access to directories without a default document.
291 | # Usually you should leave this uncommented because you shouldn't allow anyone
292 | # to surf through every directory on your server (which may includes rather
293 | # private places like the CMS's directories).
294 |
295 |
296 | Options -Indexes
297 |
298 |
299 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
300 |
301 | # Block access to hidden files and directories.
302 | # This includes directories used by version control systems such as Git and SVN.
303 |
304 |
305 | RewriteCond %{SCRIPT_FILENAME} -d [OR]
306 | RewriteCond %{SCRIPT_FILENAME} -f
307 | RewriteRule "(^|/)\." - [F]
308 |
309 |
310 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
311 |
312 | # Block access to backup and source files.
313 | # These files may be left by some text editors and can pose a great security
314 | # danger when anyone has access to them.
315 |
316 |
317 | Order allow,deny
318 | Deny from all
319 | Satisfy All
320 |
321 |
322 | # ------------------------------------------------------------------------------
323 | # | Secure Sockets Layer (SSL) |
324 | # ------------------------------------------------------------------------------
325 |
326 | # Rewrite secure requests properly to prevent SSL certificate warnings, e.g.:
327 | # prevent `https://www.example.com` when your certificate only allows
328 | # `https://secure.example.com`.
329 |
330 | #
331 | # RewriteCond %{SERVER_PORT} !^443
332 | # RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
333 | #
334 |
335 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
336 |
337 | # Force client-side SSL redirection.
338 |
339 | # If a user types "example.com" in his browser, the above rule will redirect him
340 | # to the secure version of the site. That still leaves a window of opportunity
341 | # (the initial HTTP connection) for an attacker to downgrade or redirect the
342 | # request. The following header ensures that browser will ONLY connect to your
343 | # server via HTTPS, regardless of what the users type in the address bar.
344 | # http://www.html5rocks.com/en/tutorials/security/transport-layer-security/
345 |
346 | #
347 | # Header set Strict-Transport-Security max-age=16070400;
348 | #
349 |
350 | # ------------------------------------------------------------------------------
351 | # | Server software information |
352 | # ------------------------------------------------------------------------------
353 |
354 | # Avoid displaying the exact Apache version number, the description of the
355 | # generic OS-type and the information about Apache's compiled-in modules.
356 |
357 | # ADD THIS DIRECTIVE IN THE `httpd.conf` AS IT WILL NOT WORK IN THE `.htaccess`!
358 |
359 | # ServerTokens Prod
360 |
361 |
362 | # ##############################################################################
363 | # # WEB PERFORMANCE #
364 | # ##############################################################################
365 |
366 | # ------------------------------------------------------------------------------
367 | # | Compression |
368 | # ------------------------------------------------------------------------------
369 |
370 |
371 |
372 | # Force compression for mangled headers.
373 | # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
374 |
375 |
376 | SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
377 | RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
378 |
379 |
380 |
381 | # Compress all output labeled with one of the following MIME-types
382 | # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
383 | # and can remove the `` and `` lines
384 | # as `AddOutputFilterByType` is still in the core directives).
385 |
386 | AddOutputFilterByType DEFLATE application/atom+xml \
387 | application/javascript \
388 | application/json \
389 | application/rss+xml \
390 | application/vnd.ms-fontobject \
391 | application/x-font-ttf \
392 | application/x-web-app-manifest+json \
393 | application/xhtml+xml \
394 | application/xml \
395 | font/opentype \
396 | image/svg+xml \
397 | image/x-icon \
398 | text/css \
399 | text/html \
400 | text/plain \
401 | text/x-component \
402 | text/xml
403 |
404 |
405 |
406 |
407 | # ------------------------------------------------------------------------------
408 | # | Content transformations |
409 | # ------------------------------------------------------------------------------
410 |
411 | # Prevent some of the mobile network providers from modifying the content of
412 | # your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5.
413 |
414 | #
415 | # Header set Cache-Control "no-transform"
416 | #
417 |
418 | # ------------------------------------------------------------------------------
419 | # | ETag removal |
420 | # ------------------------------------------------------------------------------
421 |
422 | # Since we're sending far-future expires headers (see below), ETags can
423 | # be removed: http://developer.yahoo.com/performance/rules.html#etags.
424 |
425 | # `FileETag None` is not enough for every server.
426 |
427 | Header unset ETag
428 |
429 |
430 | FileETag None
431 |
432 | # ------------------------------------------------------------------------------
433 | # | Expires headers (for better cache control) |
434 | # ------------------------------------------------------------------------------
435 |
436 | # The following expires headers are set pretty far in the future. If you don't
437 | # control versioning with filename-based cache busting, consider lowering the
438 | # cache time for resources like CSS and JS to something like 1 week.
439 |
440 |
441 |
442 | ExpiresActive on
443 | ExpiresDefault "access plus 1 month"
444 |
445 | # CSS
446 | ExpiresByType text/css "access plus 1 year"
447 |
448 | # Data interchange
449 | ExpiresByType application/json "access plus 0 seconds"
450 | ExpiresByType application/xml "access plus 0 seconds"
451 | ExpiresByType text/xml "access plus 0 seconds"
452 |
453 | # Favicon (cannot be renamed!)
454 | ExpiresByType image/x-icon "access plus 1 week"
455 |
456 | # HTML components (HTCs)
457 | ExpiresByType text/x-component "access plus 1 month"
458 |
459 | # HTML
460 | ExpiresByType text/html "access plus 0 seconds"
461 |
462 | # JavaScript
463 | ExpiresByType application/javascript "access plus 1 year"
464 |
465 | # Manifest files
466 | ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
467 | ExpiresByType text/cache-manifest "access plus 0 seconds"
468 |
469 | # Media
470 | ExpiresByType audio/ogg "access plus 1 month"
471 | ExpiresByType image/gif "access plus 1 month"
472 | ExpiresByType image/jpeg "access plus 1 month"
473 | ExpiresByType image/png "access plus 1 month"
474 | ExpiresByType video/mp4 "access plus 1 month"
475 | ExpiresByType video/ogg "access plus 1 month"
476 | ExpiresByType video/webm "access plus 1 month"
477 |
478 | # Web feeds
479 | ExpiresByType application/atom+xml "access plus 1 hour"
480 | ExpiresByType application/rss+xml "access plus 1 hour"
481 |
482 | # Web fonts
483 | ExpiresByType application/font-woff "access plus 1 month"
484 | ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
485 | ExpiresByType application/x-font-ttf "access plus 1 month"
486 | ExpiresByType font/opentype "access plus 1 month"
487 | ExpiresByType image/svg+xml "access plus 1 month"
488 |
489 |
490 |
491 | # ------------------------------------------------------------------------------
492 | # | Filename-based cache busting |
493 | # ------------------------------------------------------------------------------
494 |
495 | # If you're not using a build process to manage your filename version revving,
496 | # you might want to consider enabling the following directives to route all
497 | # requests such as `/css/style.12345.css` to `/css/style.css`.
498 |
499 | # To understand why this is important and a better idea than `*.css?v231`, read:
500 | # http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring
501 |
502 | #
503 | # RewriteCond %{REQUEST_FILENAME} !-f
504 | # RewriteCond %{REQUEST_FILENAME} !-d
505 | # RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
506 | #
507 |
508 | # ------------------------------------------------------------------------------
509 | # | File concatenation |
510 | # ------------------------------------------------------------------------------
511 |
512 | # Allow concatenation from within specific CSS and JS files, e.g.:
513 | # Inside of `script.combined.js` you could have
514 | #
515 | #
516 | # and they would be included into this single file.
517 |
518 | #
519 | #
520 | # Options +Includes
521 | # AddOutputFilterByType INCLUDES application/javascript application/json
522 | # SetOutputFilter INCLUDES
523 | #
524 | #
525 | # Options +Includes
526 | # AddOutputFilterByType INCLUDES text/css
527 | # SetOutputFilter INCLUDES
528 | #
529 | #
530 |
531 | # ------------------------------------------------------------------------------
532 | # | Persistent connections |
533 | # ------------------------------------------------------------------------------
534 |
535 | # Allow multiple requests to be sent over the same TCP connection:
536 | # http://httpd.apache.org/docs/current/en/mod/core.html#keepalive.
537 |
538 | # Enable if you serve a lot of static content but, be aware of the
539 | # possible disadvantages!
540 |
541 | #
542 | # Header set Connection Keep-Alive
543 | #
544 |
--------------------------------------------------------------------------------
/app/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Not Found :(
6 |
141 |
142 |
143 |
144 |
Not found :(
145 |
Sorry, but the page you were trying to view does not exist.
146 |
It looks like this was the result of either:
147 |
148 |
a mistyped address
149 |
an out-of-date link
150 |
151 |
154 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/app/angular-leaflet-directive.min.js:
--------------------------------------------------------------------------------
1 | /**!
2 | * The MIT License
3 | *
4 | * Copyright (c) 2013 the angular-leaflet-directive Team, http://tombatossals.github.io/angular-leaflet-directive
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | *
24 | * angular-leaflet-directive
25 | * https://github.com/tombatossals/angular-leaflet-directive
26 | *
27 | * @authors https://github.com/tombatossals/angular-leaflet-directive/graphs/contributors
28 | */
29 |
30 | /*! angular-leaflet-directive 29-12-2014 */
31 | !function(){"use strict";angular.module("leaflet-directive",[]).directive("leaflet",["$q","leafletData","leafletMapDefaults","leafletHelpers","leafletEvents",function(a,b,c,d,e){var f;return{restrict:"EA",replace:!0,scope:{center:"=",defaults:"=",maxbounds:"=",bounds:"=",markers:"=",legend:"=",geojson:"=",paths:"=",tiles:"=",layers:"=",controls:"=",decorations:"=",eventBroadcast:"="},transclude:!0,template:'
',controller:["$scope",function(b){f=a.defer(),this.getMap=function(){return f.promise},this.getLeafletScope=function(){return b}}],link:function(a,g,h){function i(){isNaN(h.width)?g.css("width",h.width):g.css("width",h.width+"px")}function j(){isNaN(h.height)?g.css("height",h.height):g.css("height",h.height+"px")}var k=d.isDefined,l=c.setDefaults(a.defaults,h.id),m=e.genDispatchMapEvent,n=e.getAvailableMapEvents();k(h.width)&&(i(),a.$watch(function(){return g[0].getAttribute("width")},function(){i(),o.invalidateSize()})),k(h.height)&&(j(),a.$watch(function(){return g[0].getAttribute("height")},function(){j(),o.invalidateSize()}));var o=new L.Map(g[0],c.getMapCreationDefaults(h.id));if(f.resolve(o),k(h.center)||o.setView([l.center.lat,l.center.lng],l.center.zoom),!k(h.tiles)&&!k(h.layers)){var p=L.tileLayer(l.tileLayer,l.tileLayerOptions);p.addTo(o),b.setTiles(p,h.id)}if(k(o.zoomControl)&&k(l.zoomControlPosition)&&o.zoomControl.setPosition(l.zoomControlPosition),k(o.zoomControl)&&l.zoomControl===!1&&o.zoomControl.removeFrom(o),k(o.zoomsliderControl)&&k(l.zoomsliderControl)&&l.zoomsliderControl===!1&&o.zoomsliderControl.removeFrom(o),!k(h.eventBroadcast))for(var q="broadcast",r=0;rp.center.zoom?{setView:!0,maxZoom:b.zoom}:j(p.maxZoom)?{setView:!0,maxZoom:p.maxZoom}:{setView:!0})):void(u&&l(b,f)||(r.settingCenterFromScope=!0,f.setView([b.lat,b.lng],b.zoom),h.notifyCenterChangedToBounds(r,f),d(function(){r.settingCenterFromScope=!1}))):void a.warn("[AngularJS - Leaflet] invalid 'center'")},!0),f.whenReady(function(){u=!0}),f.on("moveend",function(){i.resolve(),h.notifyCenterUrlHashChanged(r,f,o,c.search()),l(s,f)||b.settingCenterFromScope||m(r,function(a){r.settingCenterFromScope||(a.center={lat:f.getCenter().lat,lng:f.getCenter().lng,zoom:f.getZoom(),autoDiscover:!1}),h.notifyCenterChangedToBounds(r,f)})}),s.autoDiscover===!0&&f.on("locationerror",function(){a.warn("[AngularJS - Leaflet] The Geolocation API is unauthorized on this page."),n(s)?(f.setView([s.lat,s.lng],s.zoom),h.notifyCenterChangedToBounds(r,f)):(f.setView([p.center.lat,p.center.lng],p.center.zoom),h.notifyCenterChangedToBounds(r,f))})})}}}]),angular.module("leaflet-directive").directive("tiles",["$log","leafletData","leafletMapDefaults","leafletHelpers",function(a,b,c,d){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(e,f,g,h){var i=d.isDefined,j=h.getLeafletScope(),k=j.tiles;return i(k)||i(k.url)?void h.getMap().then(function(a){var d,e=c.getDefaults(g.id);j.$watch("tiles",function(c){var f=e.tileLayerOptions,h=e.tileLayer;return!i(c.url)&&i(d)?void a.removeLayer(d):i(d)?i(c.url)&&i(c.options)&&!angular.equals(c.options,f)?(a.removeLayer(d),f=e.tileLayerOptions,angular.copy(c.options,f),h=c.url,d=L.tileLayer(h,f),d.addTo(a),void b.setTiles(d,g.id)):void(i(c.url)&&d.setUrl(c.url)):(i(c.options)&&angular.copy(c.options,f),i(c.url)&&(h=c.url),d=L.tileLayer(h,f),d.addTo(a),void b.setTiles(d,g.id))},!0)}):void a.warn("[AngularJS - Leaflet] The 'tiles' definition doesn't have the 'url' property.")}}}]),angular.module("leaflet-directive").directive("legend",["$log","$http","leafletHelpers","leafletLegendHelpers",function(a,b,c,d){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(e,f,g,h){var i,j,k,l,m=c.isArray,n=c.isDefined,o=c.isFunction,p=h.getLeafletScope(),q=p.legend;p.$watch("legend",function(a){n(a)&&(i=a.legendClass?a.legendClass:"legend",j=a.position||"bottomright",l=a.type||"arcgis")},!0),h.getMap().then(function(c){p.$watch("legend",function(b){return n(b)?n(b.url)||"arcgis"!==l||m(b.colors)&&m(b.labels)&&b.colors.length===b.labels.length?n(b.url)?void a.info("[AngularJS - Leaflet] loading legend service."):(n(k)&&(k.removeFrom(c),k=null),k=L.control({position:j}),"arcgis"===l&&(k.onAdd=d.getOnAddArrayLegend(b,i)),void k.addTo(c)):void a.warn("[AngularJS - Leaflet] legend.colors and legend.labels must be set."):void(n(k)&&(k.removeFrom(c),k=null))}),p.$watch("legend.url",function(e){n(e)&&b.get(e).success(function(a){n(k)?d.updateLegend(k.getContainer(),a,l,e):(k=L.control({position:j}),k.onAdd=d.getOnAddLegend(a,i,l,e),k.addTo(c)),n(q.loadedData)&&o(q.loadedData)&&q.loadedData()}).error(function(){a.warn("[AngularJS - Leaflet] legend.url not loaded.")})})})}}}]),angular.module("leaflet-directive").directive("geojson",["$log","$rootScope","leafletData","leafletHelpers",function(a,b,c,d){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(a,e,f,g){var h=d.safeApply,i=d.isDefined,j=g.getLeafletScope(),k={};g.getMap().then(function(a){j.$watch("geojson",function(e){if(i(k)&&a.hasLayer(k)&&a.removeLayer(k),i(e)&&i(e.data)){var g,l=e.resetStyleOnMouseout;g=e.onEachFeature?e.onEachFeature:function(a,c){d.LabelPlugin.isLoaded()&&i(e.label)&&c.bindLabel(a.properties.description),c.on({mouseover:function(c){h(j,function(){b.$broadcast("leafletDirectiveMap.geojsonMouseover",a,c)})},mouseout:function(a){l&&k.resetStyle(a.target),h(j,function(){b.$broadcast("leafletDirectiveMap.geojsonMouseout",a)})},click:function(c){h(j,function(){b.$broadcast("leafletDirectiveMap.geojsonClick",a,c)})}})},e.options={style:e.style,filter:e.filter,onEachFeature:g,pointToLayer:e.pointToLayer},k=L.geoJson(e.data,e.options),c.setGeoJSON(k,f.id),k.addTo(a)}},!0)})}}}]),angular.module("leaflet-directive").directive("layers",["$log","$q","leafletData","leafletHelpers","leafletLayerHelpers","leafletControlHelpers",function(a,b,c,d,e,f){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",controller:["$scope",function(a){a._leafletLayers=b.defer(),this.getLayers=function(){return a._leafletLayers.promise}}],link:function(a,b,g,h){var i=d.isDefined,j={},k=h.getLeafletScope(),l=k.layers,m=e.createLayer,n=f.updateLayersControl,o=!1;h.getMap().then(function(b){a._leafletLayers.resolve(j),c.setLayers(j,g.id),j.baselayers={},j.overlays={};var d=g.id,e=!1;for(var f in l.baselayers){var h=m(l.baselayers[f]);i(h)?(j.baselayers[f]=h,l.baselayers[f].top===!0&&(b.addLayer(j.baselayers[f]),e=!0)):delete l.baselayers[f]}!e&&Object.keys(j.baselayers).length>0&&b.addLayer(j.baselayers[Object.keys(l.baselayers)[0]]);for(f in l.overlays){"cartodb"===l.overlays[f].type;var p=m(l.overlays[f]);i(p)?(j.overlays[f]=p,l.overlays[f].visible===!0&&b.addLayer(j.overlays[f])):delete l.overlays[f]}k.$watch("layers.baselayers",function(a){for(var c in j.baselayers)i(a[c])||(b.hasLayer(j.baselayers[c])&&b.removeLayer(j.baselayers[c]),delete j.baselayers[c]);for(var e in a)if(i(j.baselayers[e]))a[e].top!==!0||b.hasLayer(j.baselayers[e])?a[e].top===!1&&b.hasLayer(j.baselayers[e])&&b.removeLayer(j.baselayers[e]):b.addLayer(j.baselayers[e]);else{var f=m(a[e]);i(f)&&(j.baselayers[e]=f,a[e].top===!0&&b.addLayer(j.baselayers[e]))}var g=!1;for(var h in j.baselayers)if(b.hasLayer(j.baselayers[h])){g=!0;break}!g&&Object.keys(l.baselayers).length>0&&b.addLayer(j.baselayers[Object.keys(l.baselayers)[0]]),o=n(b,d,o,a,l.overlays,j)},!0),k.$watch("layers.overlays",function(a){for(var c in j.overlays)i(a[c])||(b.hasLayer(j.overlays[c])&&b.removeLayer(j.overlays[c]),delete j.overlays[c]);for(var e in a){if(!i(j.overlays[e])){var f=m(a[e]);i(f)&&(j.overlays[e]=f,a[e].visible===!0&&b.addLayer(j.overlays[e]))}a[e].visible&&!b.hasLayer(j.overlays[e])?b.addLayer(j.overlays[e]):a[e].visible===!1&&b.hasLayer(j.overlays[e])&&b.removeLayer(j.overlays[e]),a[e].visible&&b._loaded&&a[e].data&&"heatmap"===a[e].type&&(j.overlays[e].setData(a[e].data),j.overlays[e].update())}o=n(b,d,o,l.baselayers,a,j)},!0)})}}}]),angular.module("leaflet-directive").directive("bounds",["$log","$timeout","leafletHelpers","leafletBoundsHelpers",function(a,b,c,d){return{restrict:"A",scope:!1,replace:!1,require:["leaflet","center"],link:function(e,f,g,h){var i=c.isDefined,j=d.createLeafletBounds,k=h[0].getLeafletScope(),l=h[0],m=function(a){return 0===a._southWest.lat&&0===a._southWest.lng&&0===a._northEast.lat&&0===a._northEast.lng};l.getMap().then(function(c){k.$on("boundsChanged",function(a){var b=a.currentScope,d=c.getBounds();if(!m(d)&&!b.settingBoundsFromScope){var e={northEast:{lat:d._northEast.lat,lng:d._northEast.lng},southWest:{lat:d._southWest.lat,lng:d._southWest.lng}};angular.equals(b.bounds,e)||(b.bounds=e)}}),k.$watch("bounds",function(d){if(!i(d))return void a.error("[AngularJS - Leaflet] Invalid bounds");var f=j(d);f&&!c.getBounds().equals(f)&&(e.settingBoundsFromScope=!0,c.fitBounds(f),b(function(){e.settingBoundsFromScope=!1}))},!0)})}}}]),angular.module("leaflet-directive").directive("markers",["$log","$rootScope","$q","leafletData","leafletHelpers","leafletMapDefaults","leafletMarkersHelpers","leafletEvents",function(a,b,c,d,e,f,g,h){return{restrict:"A",scope:!1,replace:!1,require:["leaflet","?layers"],link:function(b,f,i,j){var k=j[0],l=e,m=e.isDefined,n=e.isString,o=k.getLeafletScope(),p=g.deleteMarker,q=g.addMarkerWatcher,r=g.listenMarkerEvents,s=g.addMarkerToGroup,t=h.bindMarkerEvents,u=g.createMarker;k.getMap().then(function(b){var e,f={};e=m(j[1])?j[1].getLayers:function(){var a=c.defer();return a.resolve(),a.promise},e().then(function(c){d.setMarkers(f,i.id),o.$watch("markers",function(d){for(var e in f)m(d)&&m(d[e])||(p(f[e],b,c),delete f[e]);for(var h in d)if(-1===h.search("-")){var j=!m(i.watchMarkers)||"true"===i.watchMarkers;if(!m(f[h])){var k=d[h],v=u(k);if(!m(v)){a.error("[AngularJS - Leaflet] Received invalid data on the marker "+h+".");continue}if(f[h]=v,m(k.message)&&v.bindPopup(k.message,k.popupOptions),m(k.group)){var w=m(k.groupOption)?k.groupOption:null;s(v,k.group,w,b)}if(l.LabelPlugin.isLoaded()&&m(k.label)&&m(k.label.message)&&v.bindLabel(k.label.message,k.label.options),m(k)&&m(k.layer)){if(!n(k.layer)){a.error("[AngularJS - Leaflet] A layername must be a string");continue}if(!m(c)){a.error("[AngularJS - Leaflet] You must add layers to the directive if the markers are going to use this functionality.");continue}if(!m(c.overlays)||!m(c.overlays[k.layer])){a.error('[AngularJS - Leaflet] A marker can only be added to a layer of type "group"');continue}var x=c.overlays[k.layer];if(!(x instanceof L.LayerGroup||x instanceof L.FeatureGroup)){a.error('[AngularJS - Leaflet] Adding a marker to an overlay needs a overlay of the type "group" or "featureGroup"');continue}x.addLayer(v),!j&&b.hasLayer(v)&&k.focus===!0&&g.manageOpenPopup(v,k)}else m(k.group)||(b.addLayer(v),j||k.focus!==!0||g.manageOpenPopup(v,k));j&&(q(v,h,o,c,b),r(v,k,o)),t(v,h,k,o)}}else a.error('The marker can\'t use a "-" on his key name: "'+h+'".')},!0)})})}}}]),angular.module("leaflet-directive").directive("paths",["$log","$q","leafletData","leafletMapDefaults","leafletHelpers","leafletPathsHelpers","leafletEvents",function(a,b,c,d,e,f,g){return{restrict:"A",scope:!1,replace:!1,require:["leaflet","?layers"],link:function(h,i,j,k){var l=k[0],m=e.isDefined,n=e.isString,o=l.getLeafletScope(),p=o.paths,q=f.createPath,r=g.bindPathEvents,s=f.setPathOptions;l.getMap().then(function(f){var g,h=d.getDefaults(j.id);g=m(k[1])?k[1].getLayers:function(){var a=b.defer();return a.resolve(),a.promise},m(p)&&g().then(function(b){var d={};c.setPaths(d,j.id);var g=function(a,c){var d=o.$watch("paths."+c,function(c,e){if(!m(c)){if(m(e.layer))for(var g in b.overlays){var h=b.overlays[g];h.removeLayer(a)}return f.removeLayer(a),void d()}s(a,c.type,c)},!0)};o.$watch("paths",function(c){for(var i in d)m(c[i])||delete d[i];for(var j in c)if(0!==j.search("\\$"))if(-1===j.search("-")){if(!m(d[j])){var k=c[j],l=q(j,c[j],h);if(m(l)&&m(k.message)&&l.bindPopup(k.message),e.LabelPlugin.isLoaded()&&m(k.label)&&m(k.label.message)&&l.bindLabel(k.label.message,k.label.options),m(k)&&m(k.layer)){if(!n(k.layer)){a.error("[AngularJS - Leaflet] A layername must be a string");continue}if(!m(b)){a.error("[AngularJS - Leaflet] You must add layers to the directive if the markers are going to use this functionality.");continue}if(!m(b.overlays)||!m(b.overlays[k.layer])){a.error('[AngularJS - Leaflet] A marker can only be added to a layer of type "group"');continue}var p=b.overlays[k.layer];if(!(p instanceof L.LayerGroup||p instanceof L.FeatureGroup)){a.error('[AngularJS - Leaflet] Adding a marker to an overlay needs a overlay of the type "group" or "featureGroup"');continue}d[j]=l,p.addLayer(l),g(l,j)}else m(l)&&(d[j]=l,f.addLayer(l),g(l,j));r(l,j,k,o)}}else a.error('[AngularJS - Leaflet] The path name "'+j+'" is not valid. It must not include "-" and a number.')},!0)})})}}}]),angular.module("leaflet-directive").directive("controls",["$log","leafletHelpers",function(a,b){return{restrict:"A",scope:!1,replace:!1,require:"?^leaflet",link:function(a,c,d,e){if(e){var f=b.isDefined,g=e.getLeafletScope(),h=g.controls;e.getMap().then(function(a){if(f(L.Control.Draw)&&f(h.draw)){f(h.edit)||(h.edit={featureGroup:new L.FeatureGroup},a.addLayer(h.edit.featureGroup));var b=new L.Control.Draw(h);a.addControl(b)}if(f(h.custom))for(var c in h.custom)a.addControl(h.custom[c])})}}}}]),angular.module("leaflet-directive").directive("eventBroadcast",["$log","$rootScope","leafletHelpers","leafletEvents",function(a,b,c,d){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(b,e,f,g){var h=c.isObject,i=g.getLeafletScope(),j=i.eventBroadcast,k=d.getAvailableMapEvents(),l=d.genDispatchMapEvent;g.getMap().then(function(b){var c,d,e=[],f="broadcast";if(h(j)){if(void 0===j.map||null===j.map)e=k;else if("object"!=typeof j.map)a.warn("[AngularJS - Leaflet] event-broadcast.map must be an object check your model.");else{void 0!==j.map.logic&&null!==j.map.logic&&("emit"!==j.map.logic&&"broadcast"!==j.map.logic?a.warn("[AngularJS - Leaflet] Available event propagation logic are: 'emit' or 'broadcast'."):"emit"===j.map.logic&&(f="emit"));var g=!1,m=!1;if(void 0!==j.map.enable&&null!==j.map.enable&&"object"==typeof j.map.enable&&(g=!0),void 0!==j.map.disable&&null!==j.map.disable&&"object"==typeof j.map.disable&&(m=!0),g&&m)a.warn("[AngularJS - Leaflet] can not enable and disable events at the time");else if(g||m)if(g)for(c=0;c=1+e&&b<=d.overlaysArray.length+e){var f;for(var h in d.layers.overlays)if(d.layers.overlays[h].index===b){f=d.layers.overlays[h];break}f&&g(d,function(){f.index=a.index,a.index=b})}c.stopPropagation(),c.preventDefault()},initIndex:function(a,b){var c=Object.keys(d.layers.baselayers).length;a.index=h(a.index)?a.index:b+c+1},toggleOpacity:function(b,c){if(a.debug("Event",b),c.visible){var e=angular.element(b.currentTarget);e.toggleClass(d.icons.close+" "+d.icons.open),e=e.parents(".lf-row").find(".lf-opacity"),e.toggle("fast",function(){g(d,function(){c.opacityControl=!c.opacityControl})})}b.stopPropagation(),b.preventDefault()},unsafeHTML:function(a){return f.trustAsHtml(a)}});var i=e.get(0);L.Browser.touch?L.DomEvent.on(i,"click",L.DomEvent.stopPropagation):(L.DomEvent.disableClickPropagation(i),L.DomEvent.on(i,"mousewheel",L.DomEvent.stopPropagation))}],template:'
Libra is a browser for open Landsat 8 satellite imagery. Use it to browse, filter, sort, and download images.
6 |
Each circle on the map represents the number of available images at that location. Filters at the top of the map can be used to select a new date range, cloud cover percentage, and sun azimuth angle.