Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More cleanup and port to OpenLayers master #3811

Merged
merged 4 commits into from
Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc-es6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ rules:
# http://eslint.org/docs/rules/no-this-before-super
no-this-before-super: error

no-unused-vars: warn
no-unused-vars: error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sshouldn't we rename this file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily, since it contains essentially rules relevant to ES6 coding style.
Since we already have a .eslintrc.yaml it may be fine to keep it as-is.


# disallow useless computed property keys
# http://eslint.org/docs/rules/no-useless-computed-key
Expand Down
11 changes: 0 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
script:
- make eof-newline
- make lint
- make check-ngeox
- make git-attributes
- make check-examples-checker
- if [ "`git grep @fileoverview src contribs`" != "" ]; then echo "Using @fileoverview breaks the documentation main page"; false; fi
Expand All @@ -84,25 +83,15 @@ jobs:
- JOB=webpack
script:
- npm install
- git add -A # for git-attributes
- if [ "${TRAVIS_PULL_REQUEST}" == false ]; then export NODE_ENV=prod; else export NODE_ENV=dev; fi
- TARGET=ngeo-examples node_modules/.bin/webpack --profile
- TARGET=gmf-examples node_modules/.bin/webpack --profile
# - TARGET=gmf-apps node_modules/.bin/webpack --profile
- export CHROME_BIN=/opt/google/chrome/chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- ./node_modules/karma/bin/karma start karma-conf.js --single-run
- make lint
- make check-examples-webpack
- if [ ${IS_HOME} = TRUE ]; then JOB=publish-examples buildtools/deploy.sh; fi
- gem install jgrep
- export PACKAGE_VERSION=`jgrep --simple=version --input=package.json`
- echo "_auth = ${NPM_AUTH}" > ~/.npmrc
- echo "email = [email protected]" >> ~/.npmrc
after_success:
- cat .build/coverage/lcov.info | node ./node_modules/coveralls/bin/coveralls.js
- if [ "${PACKAGE_VERSION}" = "${TRAVIS_TAG}" ]; then npm publish; fi

- stage: Build
env:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ANGULAR_VERSION := $(shell grep '"angular"' package.json | cut -d\" -f4)
SRC_JS_FILES := $(shell find src -type f -name '*.js')
TEST_JS_FILES := $(shell find test -type f -name '*.js')
ESLINT_CONFIG_FILES := $(shell find * -not -path 'node_modules/*' -type f -name '.eslintrc*')
Expand Down Expand Up @@ -669,10 +670,9 @@ contribs/gmf/fonts/fontawesome-webfont.%: node_modules/font-awesome/fonts/fontaw
mkdir -p $(dir $@)
cp $< $@


contribs/gmf/build/angular-locale_%.js: github_versions
contribs/gmf/build/angular-locale_%.js: package.json
mkdir -p $(dir $@)
wget -O $@ https://raw.githubusercontent.com/angular/angular.js/`grep ^angular.js= $< | cut -d = -f 2`/src/ngLocale/angular-locale_$*.js
wget -O $@ https://raw.githubusercontent.com/angular/angular.js/v$(ANGULAR_VERSION)/src/ngLocale/angular-locale_$*.js

.build/python-venv:
mkdir -p $(dir $@)
Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/test/spec/services/permalinkservice.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Permalink service', () => {
StateManagerService = _ngeoStateManager_;
PermalinkService = _gmfPermalink_;
ngeoLocation = _ngeoLocation_;
const map = new olMap({layers: [], view: new olView({projection: olProj.get('EPSG:2056')})});
const map = new olMap({layers: [], view: new olView({projection: olProj.get(ngeoProjEPSG2056)})});
PermalinkService.setMap(map);
// need to work on a clone of themes, because the permalink service
// seems to change the original object?!
Expand Down Expand Up @@ -184,7 +184,7 @@ describe('Permalink service', () => {
});

it('accepts flipped coordinates (x/y switched)', () => {
PermalinkService.sourceProjections_ = [olProj.get('EPSG:2056'), olProj.get('EPSG:4326')];
PermalinkService.sourceProjections_ = [olProj.get(ngeoProjEPSG2056), olProj.get('EPSG:4326')];
StateManagerService.initialState['map_x'] = 46.7685575;
StateManagerService.initialState['map_y'] = 6.6144562;
const center = PermalinkService.getMapCenter();
Expand All @@ -193,7 +193,7 @@ describe('Permalink service', () => {
});

it('reprojects the center', () => {
PermalinkService.sourceProjections_ = [olProj.get('EPSG:2056'), olProj.get('EPSG:4326')];
PermalinkService.sourceProjections_ = [olProj.get(ngeoProjEPSG2056), olProj.get('EPSG:4326')];
StateManagerService.initialState['map_x'] = 6.6144562;
StateManagerService.initialState['map_y'] = 46.7685575;
const center = PermalinkService.getMapCenter();
Expand Down
1 change: 0 additions & 1 deletion github_versions

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"moment": "2.22.1",
"ol-cesium": "1.36.0",
"olcs": "0.0.10",
"openlayers": "https://api.github.com/repos/openlayers/openlayers/tarball/bfae19c7e138533ad0c1a071d8886d55aac9bd35",
"openlayers": "https://api.github.com/repos/openlayers/openlayers/tarball/f284b95cb897b3ce1b49b985b58ebe1ca76be1fe",
"phantomjs-polyfill-string-includes": "1.0.0",
"phantomjs-prebuilt": "2.1.16",
"proj4": "2.4.4",
Expand Down
5 changes: 3 additions & 2 deletions src/map/FeatureOverlayMgr.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import * as olBase from 'ol/index.js';
import olLayerVector from 'ol/layer/Vector.js';
import * as olObj from 'ol/obj.js';
import olSourceVector from 'ol/source/Vector.js';
import olStyleStyle from 'ol/style/Style.js';
import olStyleStyle, {toFunction as toStyleFunction} from 'ol/style/Style.js';


/**
* Provides a service that wraps an "unmanaged" vector layer,
Expand Down Expand Up @@ -155,7 +156,7 @@ exports.prototype.setStyle = function(style, groupIndex) {
googAsserts.assert(groupIndex >= 0);
googAsserts.assert(groupIndex < this.groups_.length);
this.groups_[groupIndex].styleFunction = style === null ?
olStyleStyle.defaultFunction : olStyleStyle.createFunction(style);
olStyleStyle.defaultFunction : toStyleFunction(style);
};


Expand Down
6 changes: 3 additions & 3 deletions src/map/LayerHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import olLayerTile from 'ol/layer/Tile.js';
import * as olObj from 'ol/obj.js';
import olSourceImageWMS from 'ol/source/ImageWMS.js';
import olSourceTileWMS from 'ol/source/TileWMS.js';
import olSourceWMTS from 'ol/source/WMTS.js';
import olSourceWMTS, {optionsFromCapabilities} from 'ol/source/WMTS.js';
import * as olUri from 'ol/uri.js';

/**
Expand Down Expand Up @@ -173,7 +173,7 @@ exports.prototype.createWMTSLayerFromCapabilitites = function(capabilitiesURL, l
result = parser.read(response.data);
}
if (result) {
const options = olSourceWMTS.optionsFromCapabilities(result, {
const options = optionsFromCapabilities(result, {
matrixSet: opt_matrixSet,
crossOrigin: 'anonymous',
layer: layerName
Expand Down Expand Up @@ -211,7 +211,7 @@ exports.prototype.createWMTSLayerFromCapabilititesObj = function(
capabilities, layerCap, opt_dimensions
) {

const options = olSourceWMTS.optionsFromCapabilities(capabilities, {
const options = optionsFromCapabilities(capabilities, {
crossOrigin: 'anonymous',
layer: layerCap['Identifier']
});
Expand Down
1 change: 0 additions & 1 deletion src/profile/d3Elevation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @module ngeo.profile.d3Elevation
*/
import googAsserts from 'goog/asserts.js';
import * as olBase from 'ol/index.js';
import * as olObj from 'ol/obj.js';

import 'd3-transition';
Expand Down
1 change: 0 additions & 1 deletion src/search/createGeoJSONBloodhound.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @module ngeo.search.createGeoJSONBloodhound
*/
import * as olBase from 'ol/index.js';
import olFormatGeoJSON from 'ol/format/GeoJSON.js';
import * as olObj from 'ol/obj.js';

Expand Down
1 change: 0 additions & 1 deletion src/search/createLocationSearchBloodhound.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @module ngeo.search.createLocationSearchBloodhound
*/
import * as olBase from 'ol/index.js';
import * as olObj from 'ol/obj.js';
import * as olProj from 'ol/proj.js';

Expand Down
1 change: 0 additions & 1 deletion src/search/searchDirective.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @module ngeo.search.searchDirective
*/
import * as olBase from 'ol/index.js';

/**
* Provides the "ngeoSearch" directive, which uses Twitter's
Expand Down
6 changes: 3 additions & 3 deletions test/spec/services/autoprojection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ describe('ngeo.misc.AutoProjection', () => {
it('Try projections', () => {
const coordinatesA = [600000, 200000];
const coordinatesB = [8, 47];
const viewProjection = olProj.get('EPSG:21781');
const viewProjection = olProj.get(ngeoProjEPSG21781);
const extent = viewProjection.getExtent();
const projections = [olProj.get('EPSG:21781'), olProj.get('EPSG:4326')];
const projections = [olProj.get(ngeoProjEPSG21781), olProj.get('EPSG:4326')];

let point = ngeoAutoProjection.tryProjections(coordinatesA, extent,
viewProjection);
Expand All @@ -58,7 +58,7 @@ describe('ngeo.misc.AutoProjection', () => {

it('Try projections with inversion', () => {
const coordinates = [47, 8];
const viewProjection = olProj.get('EPSG:21781');
const viewProjection = olProj.get(ngeoProjEPSG21781);
const extent = viewProjection.getExtent();
const projections = [olProj.get('EPSG:4326')];
const coordinatesTransformed = olProj.transform(coordinates.reverse(),
Expand Down