|
|
@ -28,6 +28,7 @@ my $path_template_name = "MapPath"; |
|
|
|
|
|
|
|
|
|
|
|
my $border_width = 1; |
|
|
|
my $border_width = 1; |
|
|
|
my $border_colour = 'black'; |
|
|
|
my $border_colour = 'black'; |
|
|
|
|
|
|
|
my $default_path_stroke_width = 5; |
|
|
|
my $show_coords = 0; |
|
|
|
my $show_coords = 0; |
|
|
|
my $embed_images = 1; |
|
|
|
my $embed_images = 1; |
|
|
|
|
|
|
|
|
|
|
@ -89,6 +90,8 @@ foreach my $page (values %{$region_query_results->{query}{pages}}) |
|
|
|
next unless $parsed_template; |
|
|
|
next unless $parsed_template; |
|
|
|
say STDERR "Processing region: $page->{title}"; |
|
|
|
say STDERR "Processing region: $page->{title}"; |
|
|
|
$region->{defaults}{colour} = $parsed_template->{named_params}{colour}; |
|
|
|
$region->{defaults}{colour} = $parsed_template->{named_params}{colour}; |
|
|
|
|
|
|
|
$region->{defaults}{coords_colour} = $parsed_template->{named_params}{coordinates_colour} |
|
|
|
|
|
|
|
if $parsed_template->{named_params}{coordinates_colour}; |
|
|
|
if($regiondir) |
|
|
|
if($regiondir) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$regions_by_subregion{$region->{name}} = $region->{name}; |
|
|
|
$regions_by_subregion{$region->{name}} = $region->{name}; |
|
|
@ -120,6 +123,8 @@ foreach my $page (values %{$subregion_query_results->{query}{pages}}) |
|
|
|
say STDERR "Processing subregion: $page->{title}"; |
|
|
|
say STDERR "Processing subregion: $page->{title}"; |
|
|
|
my $subregion = $grid->make_region($page->{title}); |
|
|
|
my $subregion = $grid->make_region($page->{title}); |
|
|
|
$subregion->{defaults}{colour} = $parsed_template->{named_params}{colour}; |
|
|
|
$subregion->{defaults}{colour} = $parsed_template->{named_params}{colour}; |
|
|
|
|
|
|
|
$subregion->{defaults}{coords_colour} = $parsed_template->{named_params}{coordinates_colour} |
|
|
|
|
|
|
|
if $parsed_template->{named_params}{coordinates_colour}; |
|
|
|
if($regiondir) |
|
|
|
if($regiondir) |
|
|
|
{ |
|
|
|
{ |
|
|
|
my $region_name = $parsed_template->{positional_params}[0]; |
|
|
|
my $region_name = $parsed_template->{positional_params}[0]; |
|
|
@ -155,6 +160,8 @@ foreach my $page (values %{$location_query_results->{query}{pages}}) |
|
|
|
|
|
|
|
|
|
|
|
my $location = $grid->make_region($page->{title}); |
|
|
|
my $location = $grid->make_region($page->{title}); |
|
|
|
$location->{defaults}{colour} = $parsed_template->{named_params}{colour}; |
|
|
|
$location->{defaults}{colour} = $parsed_template->{named_params}{colour}; |
|
|
|
|
|
|
|
$location->{defaults}{coords_colour} = $parsed_template->{named_params}{coordinates_colour} |
|
|
|
|
|
|
|
if $parsed_template->{named_params}{coordinates_colour}; |
|
|
|
push @{$background_pages{"File:$parsed_template->{named_params}{background}"}}, $location; |
|
|
|
push @{$background_pages{"File:$parsed_template->{named_params}{background}"}}, $location; |
|
|
|
my $region_name = $parsed_template->{positional_params}[1]; |
|
|
|
my $region_name = $parsed_template->{positional_params}[1]; |
|
|
|
$regions_by_subregion{$location->{name}} = $region_name; |
|
|
|
$regions_by_subregion{$location->{name}} = $region_name; |
|
|
@ -358,8 +365,8 @@ foreach my $page (values %{$path_tile_query_results->{query}{pages}}) |
|
|
|
do { carp "Skipping bad spec: $coords"; next; } unless $coords =~ $coords_regex; |
|
|
|
do { carp "Skipping bad spec: $coords"; next; } unless $coords =~ $coords_regex; |
|
|
|
push @path_coords, [$1,$2]; |
|
|
|
push @path_coords, [$1,$2]; |
|
|
|
} |
|
|
|
} |
|
|
|
$grid->make_path_from($path_spec{id}, \@path_coords, css_class => 'path', |
|
|
|
$grid->make_path_from($path_spec{id}, \@path_coords, css_class => 'path', colour => $path_spec{colour}, |
|
|
|
colour => $path_spec{colour}, style => { 'stroke-width' => $path_spec{stroke_width} }); |
|
|
|
style => { 'stroke-width' => $path_spec{stroke_width} // $default_path_stroke_width }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|