hook(type => "format", id => "osm", call => \&format);
hook(type => "preprocess", id => "osm", call => \&preprocess);
hook(type => "preprocess", id => "waypoint", call => \&process_waypoint);
- hook(type => "savestate", id => "waypoint", call => \&savestate);
+ hook(type => "changes", id => "waypoint", call => \&changes);
hook(type => "cgi", id => "osm", call => \&cgi);
}
my $tag = shift;
# look for an icon attached to the tag
my $attached = $tag . '/' . $config{'osm_tag_default_icon'};
- if (srcfile($attached)) {
+ if (srcfile($attached, 1)) {
return $attached;
}
else {
return ($lon, $lat);
}
-sub savestate {
+sub changes {
my %waypoints = ();
my %linestrings = ();
}
$options{'layers'} = $config{osm_layers};
+ $name=~s/'//g; # $name comes from user input
return "mapsetup('mapdiv-$name', " . to_json(\%options) . ");";
}