Add layer to the map (a file found on VKFRAMES_DATA_PATH).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(TerrainBody), | intent(inout) | :: | self | |||
| type(MapLayer), | intent(in) | :: | layer |
the layer to add |
subroutine apply_layer(self, layer) type(TerrainBody), intent(inout) :: self type(MapLayer), intent(in) :: layer !! the layer to add character(len=:), allocatable :: uri integer(c_int) :: status uri = layer%uri if (layer%source == LAYER_GDAL .and. index(uri, '://') == 0) then ! a file: by name on VKFRAMES_DATA_PATH uri = find_data_file(layer%uri) if (len(uri) == 0) then write(*, '(a)') 'vkframes: TerrainBody '//self%name()//': could not find '//layer%uri return end if end if if (layer%elevation) then status = vkf_rocky_add_elevation(self%map, int(layer%source, c_int), uri, len(uri, kind=c_int), & int(layer%encoding, c_int)) else status = vkf_rocky_add_image(self%map, int(layer%source, c_int), uri, len(uri, kind=c_int)) end if if (status /= 0) write(*, '(a)') 'vkframes: TerrainBody '//self%name()//': could not add layer '//layer%uri end subroutine apply_layer