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

Support drawn features (gmf-drawfeature) in gmf-permalink #1059

Merged
merged 1 commit into from Apr 25, 2016

Conversation

adube
Copy link
Contributor

@adube adube commented Apr 22, 2016

This PR introduces the support of drawn vector features by the gmf-drawfeature directive inside the gmf-permalink service.

Todo

  • review

Live example

@adube adube force-pushed the gmf-drawfeature-permalink branch 2 times, most recently from 0890ab8 to 8133910 Compare April 22, 2016 18:38
@adube adube changed the title (WIP) Support drawn features (gmf-drawfeature) in gmf-permalink Support drawn features (gmf-drawfeature) in gmf-permalink Apr 22, 2016
@adube
Copy link
Contributor Author

adube commented Apr 22, 2016

@fredj (or @fgravin) Ready for review. See also the live example.

I think it would make sense if we renamed the following values (located in ngeo.js), i.e change: ANGLE: 'angle' for ANGLE: 'a' and so on. This would allow the url to be shorter.

Thoughts ?

/**
 * @enum {string}
 * @export
 */
ngeo.FeatureProperties = {
  /**
   * @type {string}
   * @export
   */
  ANGLE: 'angle',
  /**
   * @type {string}
   * @export
   */
  COLOR: 'color',
  /**
   * @type {string}
   * @export
   */
  IS_CIRCLE: 'isCircle',
  /**
   * @type {string}
   * @export
   */
  IS_RECTANGLE: 'isRectangle',
  /**
   * @type {string}
   * @export
   */
  IS_TEXT: 'isText',
  /**
   * @type {string}
   * @export
   */
  NAME: 'name',
  /**
   * @type {string}
   * @export
   */
  OPACITY: 'opacity',
  /**
   * @type {string}
   * @export
   */
  SHOW_MEASURE: 'showMeasure',
  /**
   * @type {string}
   * @export
   */
  SIZE: 'size',
  /**
   * @type {string}
   * @export
   */
  STROKE: 'stroke'
};

@fgravin
Copy link
Member

fgravin commented Apr 25, 2016

i.e change: ANGLE: 'angle' for ANGLE: 'a'

The permalink should be retro compatible.
So i think we cannot change its format @sbrunner ?

@fgravin
Copy link
Member

fgravin commented Apr 25, 2016

Looks good, waiting before merging

@sbrunner
Copy link
Member

Yes, it should be retro compatible...

@adube
Copy link
Contributor Author

adube commented Apr 25, 2016

@sbrunner I need examples for what it was before, for all 6 types:

  • point
  • line
  • polygon
  • rectangle
  • circle
  • text

If this requires more than a couple minutes to prepare, then let's take care of making this backward compatible in an other PR. @fgravin +1 ?

@fgravin
Copy link
Member

fgravin commented Apr 25, 2016

The featureHash format was made to be retro compatible, if you need to change things inside this format, it will break compatibility, but if you are just talking about property names in the features, then yes go ahead, but i would like a pattern that tells it is not a real property, like _a for angle ?

@sbrunner
Copy link
Member

sbrunner commented Apr 25, 2016

You can try them here: https://geomapfish-demo.camptocamp.net/2.0

Examples (removed prefix: https://geomapfish-demo.camptocamp.net/2.0/theme/Transport?map_x=542000&map_y=154000&map_zoom=2&):

  • point rl_features=Fp%28w8saFhdf3!~name*Un%2520titre~fillColor*%2523ff0000%27strokeColor*%2523ff0000%27pointRadius*6%27fontColor*%2523000000%29
  • line rl_features=Fl%28drh7F9tx2!htv_z1k_~~strokeColor*%2523ff0000%27strokeWidth*1%29
  • polygon rl_features=Fa%285rx4F11p2!sp1!1rGh3h_gwr_rg9!grn-~showMeasure*true~fillColor*%2523ff0000%27strokeColor*%2523ff0000%27strokeWidth*1%29
  • rectangle rl_features=Fa%285n25Fhzc1!.hec!9bt*..gec!~isBox*true~fillColor*%2523ff0000%27strokeColor*%2523ff0000%27strokeWidth*1%29
  • circle rl_features=Fa%287ya3Ff274!fjGqr-36G7f!qhF33AqnEhkByjD7yCy9C55EuuAk4Fh9*uvF7m_bdGyWnnGxWknG6m_bdGg9*uvFtuAk4Fx9C55ExjD7yCpnEhkBphF33A26G7f!ejGqr-ppG.ejGpr-26G6f!mhF23ArnEgkBxjD6yCx9C45EtuAj4Fg9*tvF6m_adGvWjnGwWmnG7m_adGh9*tvFuuAj4Fy9C45EyjD6yCsnEgkBnhF23A36G6f!fjGpr-~isCircle*true~fillColor*%2523ff0000%27strokeColor*%2523ff0000%27strokeWidth*1%29
  • text rl_features=Fp%285wx9F19ry_~name*Un%2520titre%27isLabel*true~fillColor*%2523ff0000%27strokeColor*%2523ff0000%27pointRadius*6%27fontColor*%2523000000%27fontSize*12px%27fontFamily*sans-serif%27graphic*false%29

@adube
Copy link
Contributor Author

adube commented Apr 25, 2016

Thanks for your answers.

@fgravin I shouldn't matter what names are used, i.e. a instead of _a, because real features (for example WFS) will not use this kind of approach for styling them. You don't style a feature one by one, you style them by category. It wouldn't be the same.

@sbrunner I'll try each one of them, thanks. I'll make sure that these are backward compatible when read. For writing, the new format will be used.

@fgravin
Copy link
Member

fgravin commented Apr 25, 2016

Ok

@adube adube force-pushed the gmf-drawfeature-permalink branch from 8133910 to b9a2488 Compare April 25, 2016 13:48
@sbrunner
Copy link
Member

:-)

@fgravin
Copy link
Member

fgravin commented Apr 25, 2016

Ok so ready for a merge ?
You will change the feature properties name in another PR ?

@adube
Copy link
Contributor Author

adube commented Apr 25, 2016

@fgravin You can merge.

I'll rename the properties in an other PR.

I'll also test the backward compatibility in an other PR as well.

@fgravin fgravin merged commit a864786 into camptocamp:master Apr 25, 2016
@adube adube deleted the gmf-drawfeature-permalink branch October 17, 2016 12:55
@sbrunner sbrunner added this to the Older milestone Aug 23, 2019
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.

None yet

3 participants