OpenLayers OpenLayers

Ticket #2441 (reopened feature)

Opened 2 months ago

Last modified 1 month ago

Format.KML: use style.label if available

Reported by: fredj Assigned to: tschaub
Priority: trivial Milestone: 2.10 Release
Component: Format.KML Version: SVN
Keywords: Cc:
State: Needs Discussion

Description

If a feature has a label (feature.style.label) it should be used instead of the name attribute (feature.attributes.name)

Attachments

2441.0.patch (2.2 kB) - added by fredj on 01/25/10 15:13:01.
placemark name: use feature.style.label || feature.attributes.name || feature.id

Change History

01/25/10 15:13:01 changed by fredj

  • attachment 2441.0.patch added.

placemark name: use feature.style.label feature.attributes.name feature.id

01/25/10 15:14:50 changed by fredj

  • state set to Review.

tests pass on FF 3.6 and chrome

01/27/10 14:58:01 changed by pgiraud

Once again, this patch looks good. You can commit.

01/27/10 15:27:04 changed by fredj

  • status changed from new to closed.
  • state changed from Review to Complete.
  • resolution set to fixed.

(In [9977]) Use style.label as placemark name if available. r=pgiraud (closes #2441)

(follow-up: ↓ 5 ) 02/06/10 19:25:31 changed by ahocevar

  • status changed from closed to reopened.
  • state changed from Complete to Needs Discussion.
  • resolution deleted.

It does not feel right to me to have a style take precedence over a feature attribute for determining the placemark name.

IMO you should check for attributes.name first, then fall back to style.label, and then to id.

(in reply to: ↑ 4 ) 02/08/10 08:45:55 changed by fredj

Replying to ahocevar:

It does not feel right to me to have a style take precedence over a feature attribute for determining the placemark name. IMO you should check for attributes.name first, then fall back to style.label, and then to id.

You're right: attributes are more important than styles. New patch to come.

(follow-up: ↓ 7 ) 02/15/10 11:49:38 changed by fredj

I see an other possible issue with this feature: the label value comes from style.label but what about layer.style and layer.styleMap ?

(in reply to: ↑ 6 ) 02/15/10 12:07:24 changed by ahocevar

Replying to fredj:

I see an other possible issue with this feature: the label value comes from style.label but what about layer.style and layer.styleMap ?

Then the fallback order would have to be feature.attributes.name -> feature.style.label -> layer.style.label -> layer.createSymbolizer(feature, feature.renderIntent)