aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2013-08-24 17:37:09 +0100
committerChristopher Baines <cbaines8@gmail.com>2013-10-06 10:06:05 +0100
commit0b10b34c7fdbfc6baa573cddad991443b4065118 (patch)
treea8783bfeb79885d1102e720470287b85589863e9
parent5242d1a6d282aa84d4bf2d19b6dade6a918db78e (diff)
downloadikiwiki-osm-popup-fixes.tar
ikiwiki-osm-popup-fixes.tar.gz
Fix the title and description of map popupsosm-popup-fixes
For the GeoJSON output: - Add the missing name attribute - Rename properties.desc to properties.description
-rw-r--r--IkiWiki/Plugin/osm.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/osm.pm b/IkiWiki/Plugin/osm.pm
index aa117bae2..604c15c50 100644
--- a/IkiWiki/Plugin/osm.pm
+++ b/IkiWiki/Plugin/osm.pm
@@ -351,6 +351,10 @@ sub writejson($;$) {
my %marker = ( "type" => "Feature",
"geometry" => { "type" => "Point", "coordinates" => [ $waypoints{$map}{$name}{'lon'}, $waypoints{$map}{$name}{'lat'} ] },
"properties" => $waypoints{$map}{$name} );
+ # Add the name as a property
+ $marker{'properties'}{'name'} = $name;
+ # Rename desc to description (this matches the kml output)
+ $marker{'properties'}{'description'} = delete $marker{'properties'}{'desc'};
push @{$geojson{'features'}}, \%marker;
}
foreach my $linestring (@{$linestrings{$map}}) {