MCPcopy Index your code
hub / github.com/MapServer/MapServer / msWMSPrintAttribution

Function msWMSPrintAttribution

mapwms.c:1284–1338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1282
1283
1284void msWMSPrintAttribution(FILE *stream, const char *tabspace,
1285 hashTableObj *metadata,
1286 const char *namespaces)
1287{
1288 const char *title, *onlineres, *logourl;
1289 char * pszEncodedValue=NULL;
1290
1291 if (stream && metadata)
1292 {
1293 title = msOWSLookupMetadata(metadata, "MO",
1294 "attribution_title");
1295 onlineres = msOWSLookupMetadata(metadata, "MO",
1296 "attribution_onlineresource");
1297 logourl = msOWSLookupMetadata(metadata, "MO",
1298 "attribution_logourl_width");
1299
1300 if (title || onlineres || logourl)
1301 {
1302 msIO_printf("%s<Attribution>\n",tabspace);
1303 if (title)
1304 {
1305 pszEncodedValue = msEncodeHTMLEntities(title);
1306 msIO_fprintf(stream, "%s%s<Title>%s</Title>\n", tabspace,
1307 tabspace, pszEncodedValue);
1308 free(pszEncodedValue);
1309 }
1310
1311 if (onlineres)
1312 {
1313 pszEncodedValue = msEncodeHTMLEntities(onlineres);
1314 msIO_fprintf(stream, "%s%s<OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"%s\"/>\n", tabspace, tabspace,
1315 pszEncodedValue);
1316 free(pszEncodedValue);
1317 }
1318
1319 if (logourl)
1320 {
1321 msOWSPrintURLType(stream, metadata, "MO","attribution_logourl",
1322 OWS_NOERR, NULL, "LogoURL", NULL,
1323 " width=\"%s\"", " height=\"%s\"",
1324 ">\n <Format>%s</Format",
1325 "\n <OnlineResource "
1326 "xmlns:xlink=\"http://www.w3.org/1999/xlink\""
1327 " xlink:type=\"simple\" xlink:href=\"%s\"/>\n"
1328 " ",
1329 MS_FALSE, MS_TRUE, MS_TRUE, MS_TRUE, MS_TRUE,
1330 NULL, NULL, NULL, NULL, NULL, " ");
1331
1332
1333 }
1334 msIO_printf("%s</Attribution>\n", tabspace);
1335
1336 }
1337 }
1338}
1339
1340
1341/*

Callers 2

msDumpLayerFunction · 0.85
msWMSGetCapabilitiesFunction · 0.85

Calls 5

msOWSLookupMetadataFunction · 0.85
msIO_printfFunction · 0.85
msEncodeHTMLEntitiesFunction · 0.85
msIO_fprintfFunction · 0.85
msOWSPrintURLTypeFunction · 0.85

Tested by

no test coverage detected