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

KML: Data handling and GeoJSON layer compatibility #165

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fbuccioni
Copy link

Hi, I have added some functionality to work KML with data:

  • Inherited options
  • Geometry feature property
  • Parser of ExtendedData tags, providing properties
  • Options to put name, description and ExtendedData/Data/displayName tags into properties
  • onEachFeature support

@brunob
Copy link
Collaborator

brunob commented Jul 13, 2015

Hi @falcacibar this one can't be merged for now, can you fix it please ?

@fbuccioni
Copy link
Author

Hey @brunob, it's fixed. check it out.

@brunob
Copy link
Collaborator

brunob commented Jul 16, 2015

Thx @falcacibar but iI think there's still a problem, look at the diff. Maybe you should make a new pr.

@fbuccioni
Copy link
Author

@brunob: I have rebased my commits over the last changes, try again please.

@gavioto
Copy link

gavioto commented Sep 7, 2015

This is what I'm searching... @brunob do you intend to accept the changes? Thanks

@brunob
Copy link
Collaborator

brunob commented Dec 2, 2015

@falcacibar sorry for the delay, before merge this one could you please provide in the PR an example file & an associated kml file to show the usage ?

@brunob brunob added the todo label Dec 2, 2015
@brunob
Copy link
Collaborator

brunob commented Apr 17, 2016

Any news about this @falcacibar ?

@fbuccioni
Copy link
Author

fbuccioni commented May 2, 2016

Sorry @brunob I was very busy this last time, if something can write docs will be great, so I'm gonna explain what does this:

Parsing Name and Description tags

The KML specification uses by default Name and Description tags to identify a geometry, to avoid conflicts with possible Name or Description metadata, this can be configurable by the following options:

Name

  • name_on_props (default: false)
  • name_prop (default: 'kml_name')

And in feature.properties will be:

  • The name of the property is options.name_prop
  • The value of the property is Name tag

Description

  • descr_on_props (default: false)
  • descr_prop (default: 'kml_description')

And in feature.properties will be:

  • The name of the property is options.descr_prop
  • The value of the property is Description tag

Configurable pop-up

Pop-up behavior can be activated or deactivated by the option popup (default: true)

GeoJSON feature/onEachFeature compatibility

Follows the GeoJSON parse type, adding "feature" property and parsing the properties in the geometry of the KML

Read KML ExtendedData and place into feature.properties object

Reads the features properties from ExtendedData/Data tag according to the specification in https://developers.google.com/kml/documentation/extendeddata#adding-untyped-namevalue-pairs.

  • The name of the property is ExtendedData/Data@name
  • The value of the property is ExtendedData/Data/Value

Parsing ExtendedData/Data/DisplayName

The specification of KML adds a DisplayName tag to differs the data name with long name of each Data tag.

This tag can be placed into featuree.properties object with displayName option (default: false) of the KML layer and applying a suffix with the displayName_suffix option (default '_display_name'), then:

  • The name of the property is ExtendedData/Data@name + options.displayName_suffix
  • The value of the property is ExtendedData/Data/DisplayName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants