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

Fix #1310. Improved vector gfi with buffer #1311

Merged
merged 4 commits into from
Dec 6, 2016

Conversation

offtherailz
Copy link
Member

  • Create a buffer in px around the clicked point and try to intersect the geometry (bufferized) to find out if it is clicked.
  • uses intersect instead of inside
  • Fixes max height for feature info window.

 - Create a buffer in px around the clicked point and try to intersect the geometry (bufferized) to find out if it is clicked.
 - uses intersect instead of inside
 - Fixes max height for feature info window.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 80.261% when pulling 30de677 on offtherailz:i_1310 into e819c94 on geosolutions-it:master.

mbarto
mbarto previously requested changes Dec 5, 2016
@@ -27,7 +27,7 @@ const {RESET_CONTROLS} = require('../actions/controls');

const assign = require('object-assign');
const {head} = require('lodash');
const {inside} = require('turf');
const {intersect, buffer} = require('turf');
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use:

turf/node_modules/turf-intersect

and

turf/node_modules/turf-buffer

to avoid including the complete turf bundle

Copy link
Member Author

Choose a reason for hiding this comment

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

no node-modules in my node_modules/turf dir.

Probably because I'm using most recent npm:

There are only package.json and index.js. The index.js has this content:
npm: '3.5.2',

/*eslint global-require: 0*/

/**
 * Turf is a modular geospatial analysis engine written in JavaScript. It performs geospatial
 * processing tasks with GeoJSON data and can be run on a server or in a browser.
 *
 * @module turf
 * @summary Geospatial analysis for JavaScript
 */
module.exports = {
    isolines: require('turf-isolines'),
    [...]
    buffer: require('turf-buffer'),
    [...]
    intersect: require('turf-intersect'),
    [...]
    };

var helpers = require('turf-helpers');
[...]
module.exports.point = helpers.point;
module.exports.polygon = helpers.polygon;
module.exports.lineString = helpers.lineString;
[...]

They are only in your node modules, with an oldest node_modules.

So I think the good approch is the mine one, that is compatible with both versions, and optimized for the newer, that will be used in the future.

What do you think?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 80.034% when pulling 0649027 on offtherailz:i_1310 into e819c94 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 80.093% when pulling bbd41c4 on offtherailz:i_1310 into e819c94 on geosolutions-it:master.

@offtherailz
Copy link
Member Author

Ok, now it is optimized and should work with every npm version.

@offtherailz offtherailz dismissed mbarto’s stale review December 6, 2016 09:35

Applied required changes

@offtherailz offtherailz merged commit 120ee5a into geosolutions-it:master Dec 6, 2016
offtherailz added a commit to offtherailz/MapStore2 that referenced this pull request Dec 6, 2016
…ns-it#1311)

* Fix geosolutions-it#1310. Improved vector gfi with buffer

 - Create a buffer in px around the clicked point and try to intersect the geometry (bufferized) to find out if it is clicked.
 - uses intersect instead of inside
 - Fixes max height for feature info window.

* defaults and notes

* reduced dependencies from turf

* fixed wrong dependencies
@offtherailz offtherailz deleted the i_1310 branch January 26, 2018 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants