Skip to content

Commit

Permalink
Merge pull request #598 from Esri/leaflet-1.0
Browse files Browse the repository at this point in the history
Esri Leaflet 2.0.0 (Leaflet 1.0 compat)
  • Loading branch information
patrickarlt committed Jul 20, 2015
2 parents f3c55f2 + 838456f commit c625e5d
Show file tree
Hide file tree
Showing 58 changed files with 2,522 additions and 2,585 deletions.
1 change: 1 addition & 0 deletions .travis.yml
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"
156 changes: 109 additions & 47 deletions CHANGELOG.md

Large diffs are not rendered by default.

281 changes: 6 additions & 275 deletions Gruntfile.js
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'],
Expand All @@ -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
}
Expand All @@ -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: {
Expand Down Expand Up @@ -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']});
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esri-leaflet",
"version": "v1.0.0",
"version": "v2.0.0-beta.1",
"main": "dist/esri-leaflet.js",
"ignore": [
"**/.*",
Expand Down
28 changes: 28 additions & 0 deletions index.js
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';
Loading

0 comments on commit c625e5d

Please sign in to comment.