-
Notifications
You must be signed in to change notification settings - Fork 797
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #598 from Esri/leaflet-1.0
Esri Leaflet 2.0.0 (Leaflet 1.0 compat)
- Loading branch information
Showing
58 changed files
with
2,522 additions
and
2,585 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
language: node_js | ||
before_install: npm install -g grunt-cli | ||
sudo: false | ||
node_js: | ||
- "0.10" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,166 +1,10 @@ | ||
var fs = require('fs'); | ||
module.exports = function (grunt) { | ||
|
||
module.exports = function(grunt) { | ||
var browsers = grunt.option('browser') ? grunt.option('browser').split(',') : ['PhantomJS']; | ||
|
||
var copyright = '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today(\'yyyy-mm-dd\') %>\n' + | ||
'* Copyright (c) <%= grunt.template.today(\'yyyy\') %> Environmental Systems Research Institute, Inc.\n' + | ||
'* Apache License' + | ||
'*/\n'; | ||
|
||
var umdHeader = '(function (factory) {\n' + | ||
' //define an AMD module that relies on \'leaflet\'\n' + | ||
' if (typeof define === \'function\' && define.amd) {\n' + | ||
' define([\'leaflet\'], function (L) {\n' + | ||
' return factory(L);\n' + | ||
' });\n' + | ||
' //define a common js module that relies on \'leaflet\'\n' + | ||
' } else if (typeof module === \'object\' && typeof module.exports === \'object\') {\n' + | ||
' module.exports = factory(require(\'leaflet\'));\n' + | ||
' }\n\n' + | ||
' if(typeof window !== \'undefined\' && window.L){\n' + | ||
' factory(window.L);\n' + | ||
' }\n' + | ||
'}(function (L) {\n'; | ||
|
||
var umdFooter = '\n\n return EsriLeaflet;\n' + | ||
'}));'; | ||
|
||
var complete = [ | ||
'src/EsriLeaflet.js', | ||
'src/Util.js', | ||
'src/Request.js', | ||
'src/Services/Service.js', | ||
'src/Services/FeatureLayerService.js', | ||
'src/Services/MapService.js', | ||
'src/Services/ImageService.js', | ||
'src/Tasks/Task.js', | ||
'src/Tasks/Query.js', | ||
'src/Tasks/Find.js', | ||
'src/Tasks/Identify.js', | ||
'src/Tasks/IdentifyImage.js', | ||
'src/Tasks/IdentifyFeatures.js', | ||
'src/Layers/BasemapLayer.js', | ||
'src/Layers/RasterLayer.js', | ||
'src/Layers/DynamicMapLayer.js', | ||
'src/Layers/ImageMapLayer.js', | ||
'src/Layers/TiledMapLayer.js', | ||
'src/Layers/FeatureLayer/FeatureGrid.js', | ||
'src/Layers/FeatureLayer/FeatureManager.js', | ||
'src/Layers/FeatureLayer/FeatureLayer.js', | ||
'src/Controls/Logo.js' | ||
]; | ||
|
||
var core = [ | ||
'src/EsriLeaflet.js', | ||
'src/Util.js', | ||
'src/Request.js', | ||
'src/Tasks/Task.js', | ||
'src/Services/Service.js' | ||
]; | ||
|
||
var basemaps = [ | ||
'src/EsriLeaflet.js', | ||
'src/Request.js', | ||
'src/Layers/BasemapLayer.js', | ||
'src/Controls/Logo.js' | ||
]; | ||
|
||
var mapservice = [ | ||
'src/EsriLeaflet.js', | ||
'src/Util.js', | ||
'src/Request.js', | ||
'src/Services/Service.js', | ||
'src/Services/MapService.js', | ||
'src/Tasks/Task.js', | ||
'src/Tasks/Identify.js', | ||
'src/Tasks/IdentifyFeatures.js', | ||
'src/Tasks/Query.js', | ||
'src/Tasks/Find.js', | ||
'src/Layers/RasterLayer.js', | ||
'src/Layers/DynamicMapLayer.js', | ||
'src/Layers/TiledMapLayer.js' | ||
]; | ||
|
||
var imageservice = [ | ||
'src/EsriLeaflet.js', | ||
'src/Util.js', | ||
'src/Request.js', | ||
'src/Services/Service.js', | ||
'src/Services/ImageService.js', | ||
'src/Tasks/Task.js', | ||
'src/Tasks/Query.js', | ||
'src/Tasks/Identify.js', | ||
'src/Tasks/Identify/IdentifyImage.js', | ||
'src/Layers/RasterLayer.js', | ||
'src/Layers/ImageMapLayer.js' | ||
]; | ||
|
||
var featureservice = [ | ||
'src/EsriLeaflet.js', | ||
'src/Util.js', | ||
'src/Request.js', | ||
'src/Services/Service.js', | ||
'src/Services/FeatureLayerService.js', | ||
'src/Tasks/Task.js', | ||
'src/Tasks/Query.js', | ||
'src/Layers/FeatureLayer/FeatureGrid.js', | ||
'src/Layers/FeatureLayer/FeatureManager.js', | ||
'src/Layers/FeatureLayer/FeatureLayer.js' | ||
]; | ||
|
||
var customLaunchers = { | ||
sl_chrome: { | ||
base: 'SauceLabs', | ||
browserName: 'chrome', | ||
platform: 'Windows 7', | ||
version: '35' | ||
}, | ||
sl_firefox: { | ||
base: 'SauceLabs', | ||
browserName: 'firefox', | ||
version: '30' | ||
}, | ||
sl_ios_safari: { | ||
base: 'SauceLabs', | ||
browserName: 'iphone', | ||
platform: 'OS X 10.9', | ||
version: '7.1' | ||
}, | ||
sl_ie_11: { | ||
base: 'SauceLabs', | ||
browserName: 'internet explorer', | ||
platform: 'Windows 8.1', | ||
version: '11' | ||
} | ||
}; | ||
|
||
// Project configuration. | ||
// Project configuration | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
|
||
jshint: { | ||
options: { | ||
jshintrc: '.jshintrc' | ||
}, | ||
all: { | ||
src: [ | ||
'src/**/*.js' | ||
] | ||
} | ||
}, | ||
|
||
watch: { | ||
scripts: { | ||
files: [ | ||
'src/**/*.js', | ||
'spec/**/*.js' | ||
], | ||
tasks: ['jshint'], | ||
options: { | ||
spawn: false | ||
} | ||
}, | ||
'docs-sass': { | ||
files: ['site/source/scss/**/*.scss'], | ||
tasks: ['sass'], | ||
|
@@ -170,7 +14,7 @@ module.exports = function(grunt) { | |
}, | ||
'docs-js': { | ||
files: ['site/source/**/*.js'], | ||
tasks: ['concat', 'uglify', 'copy:assemble'], | ||
tasks: ['copy:assemble'], | ||
options: { | ||
nospawn: true | ||
} | ||
|
@@ -192,103 +36,6 @@ module.exports = function(grunt) { | |
} | ||
}, | ||
|
||
concurrent: { | ||
options: { | ||
logConcurrentOutput: true | ||
}, | ||
dev: ['watch:scripts', 'karma:watch', 'docs'] | ||
}, | ||
|
||
concat: { | ||
options: { | ||
sourceMap: true, | ||
separator: '\n\n', | ||
banner: copyright + umdHeader, | ||
footer: umdFooter, | ||
}, | ||
complete: { | ||
src: complete, | ||
dest: 'dist/esri-leaflet-src.js' | ||
}, | ||
core: { | ||
src: core, | ||
dest: 'dist/builds/core/esri-leaflet-core-src.js' | ||
}, | ||
basemaps: { | ||
src: basemaps, | ||
dest: 'dist/builds/basemaps/esri-leaflet-basemaps-src.js' | ||
}, | ||
mapservice: { | ||
src: mapservice, | ||
dest: 'dist/builds/map-service/esri-leaflet-map-service-src.js' | ||
}, | ||
imageservice: { | ||
src: imageservice, | ||
dest: 'dist/builds/image-service/esri-leaflet-image-service-src.js' | ||
}, | ||
featureservice: { | ||
src: featureservice, | ||
dest: 'dist/builds/feature-layer/esri-leaflet-feature-layer-src.js' | ||
} | ||
}, | ||
|
||
uglify: { | ||
options: { | ||
sourceMap: true, | ||
sourceMapIncludeSources: true, | ||
wrap: false, | ||
mangle: { | ||
except: ['L'] | ||
}, | ||
preserveComments: 'some', | ||
report: 'gzip', | ||
banner: copyright + umdHeader, | ||
footer: umdFooter, | ||
}, | ||
dist: { | ||
files: { | ||
'dist/esri-leaflet.js': complete, | ||
'dist/builds/core/esri-leaflet-core.js': core, | ||
'dist/builds/basemaps/esri-leaflet-basemaps.js': basemaps, | ||
'dist/builds/map-service/esri-leaflet-map-service.js': mapservice, | ||
'dist/builds/image-service/esri-leaflet-image-service.js': imageservice, | ||
'dist/builds/feature-layer/esri-leaflet-feature-layer.js': featureservice | ||
} | ||
} | ||
}, | ||
|
||
karma: { | ||
options: { | ||
configFile: 'karma.conf.js' | ||
}, | ||
run: { | ||
reporters: ['progress'], | ||
browsers: browsers, | ||
logLevel: 'ERROR' | ||
}, | ||
coverage: { | ||
reporters: ['progress', 'coverage'], | ||
browsers: browsers, | ||
preprocessors: { | ||
'src/**/*.js': 'coverage' | ||
} | ||
}, | ||
watch: { | ||
singleRun: false, | ||
autoWatch: true, | ||
browsers: browsers | ||
}, | ||
sauce: { | ||
sauceLabs: { | ||
testName: 'Esri Leaflet Unit Tests' | ||
}, | ||
customLaunchers: customLaunchers, | ||
browsers: Object.keys(customLaunchers), | ||
reporters: ['progress', 'saucelabs'], | ||
singleRun: true | ||
} | ||
}, | ||
|
||
connect: { | ||
server: { | ||
options: { | ||
|
@@ -372,33 +119,17 @@ module.exports = function(grunt) { | |
repo: '[email protected]:Esri/esri-leaflet.git' | ||
}, | ||
src: ['**'] | ||
}, | ||
|
||
releaseable: { | ||
release: { | ||
options: { | ||
remote: 'upstream', | ||
dryRun: grunt.option('dryRun') ? grunt.option('dryRun') : false, | ||
silent: false | ||
}, | ||
src: [ 'dist/**/*.js','dist/**/*.map' ] | ||
} | ||
} | ||
}); | ||
|
||
// Development Tasks | ||
grunt.registerTask('default', ['concurrent:dev']); | ||
grunt.registerTask('build', ['jshint', 'karma:coverage', 'concat', 'uglify']); | ||
grunt.registerTask('test', ['jshint', 'karma:run']); | ||
grunt.registerTask('prepublish', ['concat', 'uglify']); | ||
grunt.registerTask('release', ['releaseable']); | ||
grunt.registerTask('test:sauce', ['karma:sauce']); | ||
grunt.registerTask('default', ['docs']); | ||
|
||
// Documentation Site Tasks | ||
grunt.registerTask('docs', ['assemble:dev', 'concat', 'uglify', 'sass', 'copy', 'connect:docs', 'watch']); | ||
grunt.registerTask('docs', ['assemble:dev', 'sass', 'copy', 'connect:docs', 'watch']); | ||
|
||
// Documentation Site Tasks | ||
grunt.registerTask('docs:build', ['assemble:build', 'copy', 'imagemin','sass', 'gh-pages']); | ||
grunt.registerTask('docs:build', ['assemble:build', 'copy', 'imagemin', 'sass', 'gh-pages']); | ||
|
||
// Require all grunt modules | ||
require('load-grunt-tasks')(grunt, {pattern: ['grunt-*', 'assemble']}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// import base | ||
export { Support, cors, pointerEvents } from './src/Support'; | ||
export { Util, shallowClone, warn, cleanUrl, isArcgisOnline, geojsonTypeToArcGIS, responseToFeatureCollection, geojsonToArcGIS, arcgisToGeojson, boundsToExtent, extentToBounds } from './src/Util'; | ||
export { Request, get, post, request } from './src/Request'; | ||
|
||
// export tasks | ||
export { Task, task } from './src/Tasks/Task'; | ||
export { Query, query } from './src/Tasks/Query'; | ||
export { Find, find } from './src/Tasks/Find'; | ||
export { Identify, identify } from './src/Tasks/Identify'; | ||
export { IdentifyFeatures, identifyFeatures } from './src/Tasks/IdentifyFeatures'; | ||
export { IdentifyImage, identifyImage } from './src/Tasks/IdentifyImage'; | ||
|
||
// export services | ||
export { Service, service } from './src/Services/Service'; | ||
export { MapService, mapService } from './src/Services/MapService'; | ||
export { ImageService, imageService } from './src/Services/ImageService'; | ||
export { FeatureLayerService, featureLayerService } from './src/Services/FeatureLayerService'; | ||
|
||
// export layers | ||
export { BasemapLayer, basemapLayer } from './src/Layers/BasemapLayer'; | ||
export { TiledMapLayer, tiledMapLayer } from './src/Layers/TiledMapLayer'; | ||
export { RasterLayer } from './src/Layers/RasterLayer'; | ||
export { ImageMapLayer, imageMapLayer } from './src/Layers/ImageMapLayer'; | ||
export { DynamicMapLayer, dynamicMapLayer } from './src/Layers/DynamicMapLayer'; | ||
export { FeatureGrid } from './src/Layers/FeatureLayer/FeatureGrid'; | ||
export { FeatureManager } from './src/Layers/FeatureLayer/FeatureManager'; | ||
export { FeatureLayer, featureLayer } from './src/Layers/FeatureLayer/FeatureLayer'; |
Oops, something went wrong.