-
Notifications
You must be signed in to change notification settings - Fork 409
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
Conversation
offtherailz
commented
Nov 30, 2016
- 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.
@@ -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'); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
Ok, now it is optimized and should work with every npm version. |
…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