Ignore:
Timestamp:
2019-05-31T21:35:03+12:00 (5 years ago)
Author:
wy59
Message:

Incremental changes following previous commit. This time the code is more backwards compatible with older collections that contain only Latitude and Longitude meta. In such cases, we now ADDITIONALLY add Coordinate (and Coordshort) meta, while still also outputting Lat and Lng meta. The JS and XSL code however now prefers to work with Coordinate meta where present.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/doc.pm

    r33125 r33126  
    11361136            my $metaMap = $self->get_metadata_hashmap($section); ### TODO: metaMap not used. Unnecesssary step? (Called function has no side-effects.)
    11371137        }
     1138       
     1139        if($field =~ m/^(.+\.)?Longitude$/) {
     1140            # if we are dealing with Longitude meta, we should 1. have Latitude meta; 2. already have processed Latitude meta
     1141            # in that case, add both Lat and Lng of this section as a Coordinate meta
     1142            my $latitude = $self->get_metadata_element ($section, "Latitude");         
     1143            # TODO: would like all Longitude info together followed by all Coordinate info, but the following will add all coord info meta and end of this function will add Longitude meta
     1144            $self->processCoordinate($section_ptr, $latitude, $value); # value is Longitude
     1145        }
    11381146    }
    11391147
     
    12061214                print STDERR "cos $centre_lat is $cos_lat\n";
    12071215
    1208                 $self->processCoordinate($section_ptr, $lat_north, $lng_east);             
     1216                $self->processCoordinate($section_ptr, $lat_north, $lng_east);
    12091217                $self->processCoordinate($section_ptr, $lat_south, $lng_east);
    12101218                $self->processCoordinate($section_ptr, $lat_south, $lng_west);
Note: See TracChangeset for help on using the changeset viewer.