Use style.label as placemark name if available. r=pgiraud (closes #2441)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9977 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -1020,14 +1020,13 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
createPlacemarkXML: function(feature) {
|
||||
// Placemark name
|
||||
var placemarkName = this.createElementNS(this.kmlns, "name");
|
||||
var name = (feature.attributes.name) ?
|
||||
feature.attributes.name : feature.id;
|
||||
var name = feature.style && feature.style.label ? feature.style.label :
|
||||
feature.attributes.name || feature.id;
|
||||
placemarkName.appendChild(this.createTextNode(name));
|
||||
|
||||
// Placemark description
|
||||
var placemarkDesc = this.createElementNS(this.kmlns, "description");
|
||||
var desc = (feature.attributes.description) ?
|
||||
feature.attributes.description : this.placemarksDesc;
|
||||
var desc = feature.attributes.description || this.placemarksDesc;
|
||||
placemarkDesc.appendChild(this.createTextNode(desc));
|
||||
|
||||
// Placemark
|
||||
|
||||
Reference in New Issue
Block a user