diff options
author | Christopher Baines <cbaines8@gmail.com> | 2013-08-24 17:37:09 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2017-10-31 20:32:45 +0000 |
commit | 32592cf4f72fb8187904364d8c15e783dedc9c33 (patch) | |
tree | 1bbea95474e3c91c7bf57d1dc5043552aa9095f2 | |
parent | 2314d8db726d19d956e006e7c99f04be1b38a8f0 (diff) | |
download | ikiwiki-32592cf4f72fb8187904364d8c15e783dedc9c33.tar ikiwiki-32592cf4f72fb8187904364d8c15e783dedc9c33.tar.gz |
Fix the title and description of map popups
For the GeoJSON output:
- Add the missing name attribute
- Rename properties.desc to properties.description
-rw-r--r-- | IkiWiki/Plugin/osm.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/osm.pm b/IkiWiki/Plugin/osm.pm index 9df53f76e..33e2e0d4d 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}}) { |