From 0b10b34c7fdbfc6baa573cddad991443b4065118 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 24 Aug 2013 17:37:09 +0100 Subject: Fix the title and description of map popups For the GeoJSON output: - Add the missing name attribute - Rename properties.desc to properties.description --- IkiWiki/Plugin/osm.pm | 4 ++++ 1 file changed, 4 insertions(+) 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}}) { -- cgit v1.2.3