Display credit in map composer?Automating citation of data source in QGIS print composer?Exported PDF...
What would be some possible ways of escaping higher gravity planets?
Why write a book when there's a movie in my head?
Solving the linear first order differential equation?
Buying a "Used" Router
Performance and power usage for Raspberry Pi in the Stratosphere
What are some ways of extending a description of a scenery?
Modern Algebraic Geometry and Analytic Number Theory
Count repetitions of an array
Why does a single AND gate need 60 transistors?
smartctl reports overall health test as passed but the tests failed?
Even as admin, I cannot edit DefaultFonts.plist for Notes.app. What am I doing wrong?
Promise.all returning empty objects
Does red noise even at low values mean a hardware problem with my camera's sensor?
Dealing with an internal ScriptKiddie
Maybe pigeonhole problem?
Is Screenshot Time-tracking Common?
Calculating the strength of an ionic bond that contains poly-atomic ions
Why do neural networks need so many examples to perform?
Was Opportunity's last message to Earth "My battery is low and it's getting dark"?
Coworker asking me to not bring cakes due to self control issue. What should I do?
Can I travel from country A to country B to country C without going back to country A?
How do I fight with Heavy Armor as a Wizard with Tenser's Transformation?
Is it recommended to be 100% delegated for a baker?
How would an EMP effect spacesuits (and small-arms weapons)?
Display credit in map composer?
Automating citation of data source in QGIS print composer?Exported PDF resulting in misaligned Bing Aerial and vector layer using QGIS?How to display multiple attributes in a QGIS Composer legend?QGIS Map Composer has wrong coordinatesDraw Coordinates problem in QGIS map composerQGIS Composer Map Frame BlankAutomatic map rotation in map composer QGISHow to display inches in the Print Composer margin guideQGIS showing decimal degree coordinates in map/layout composer displayMap orientation in print composer in QGISHow to update map canvas in QGIS 3.4 Print Composer
I am trying to publish maps from QGIS Map Composer.
I would like to automatically add the credits of the background layers displayed in the composition (like OSM, Bing, ...)
I am aware of such a feature in main QGIS window using
View -> Decorations -> Copyright label
but
- this data is not shown in composer
- I am looking for an expression to adapt the text depending of the active layer
(Currently using either qgis 2.18 or 3.4)
qgis print-composer qgis-print-layouts
add a comment |
I am trying to publish maps from QGIS Map Composer.
I would like to automatically add the credits of the background layers displayed in the composition (like OSM, Bing, ...)
I am aware of such a feature in main QGIS window using
View -> Decorations -> Copyright label
but
- this data is not shown in composer
- I am looking for an expression to adapt the text depending of the active layer
(Currently using either qgis 2.18 or 3.4)
qgis print-composer qgis-print-layouts
add a comment |
I am trying to publish maps from QGIS Map Composer.
I would like to automatically add the credits of the background layers displayed in the composition (like OSM, Bing, ...)
I am aware of such a feature in main QGIS window using
View -> Decorations -> Copyright label
but
- this data is not shown in composer
- I am looking for an expression to adapt the text depending of the active layer
(Currently using either qgis 2.18 or 3.4)
qgis print-composer qgis-print-layouts
I am trying to publish maps from QGIS Map Composer.
I would like to automatically add the credits of the background layers displayed in the composition (like OSM, Bing, ...)
I am aware of such a feature in main QGIS window using
View -> Decorations -> Copyright label
but
- this data is not shown in composer
- I am looking for an expression to adapt the text depending of the active layer
(Currently using either qgis 2.18 or 3.4)
qgis print-composer qgis-print-layouts
qgis print-composer qgis-print-layouts
edited 8 mins ago
underdark♦
68.3k13177342
68.3k13177342
asked 3 hours ago
kFlykFly
3081314
3081314
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
One answer to your question can be a union of the great answers (in fact, your question is almost a duplicate) of this one: Automating citation of data source in QGIS print composer?
Add a new text label to the layout.
In the item properties of the label, main properties, click on Insert an Expression.
In the expression builder, switch to the Function Editor tab, and paste this code:
# Be sure to import iface from qgis.utils
from qgis.core import *
from qgis.gui import *
from qgis.utils import iface
@qgsfunction(args='auto', group='Custom')
def get_layer_name(feature, parent):
return qgis.utils.iface.activeLayer().name()
Its define a new get_layer_name() function that returns the name of the active layer and can be found under the Custom group of the expressions list.
Click on Save and Load Function.
Switch to the Expression tab and write this expression:
layer_property( get_layer_name(), 'attribution')
It returns the Attribution metadata of the active layer.
Don't forget to refresh the layout view when the active layer has changed.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313384%2fdisplay-credit-in-map-composer%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
One answer to your question can be a union of the great answers (in fact, your question is almost a duplicate) of this one: Automating citation of data source in QGIS print composer?
Add a new text label to the layout.
In the item properties of the label, main properties, click on Insert an Expression.
In the expression builder, switch to the Function Editor tab, and paste this code:
# Be sure to import iface from qgis.utils
from qgis.core import *
from qgis.gui import *
from qgis.utils import iface
@qgsfunction(args='auto', group='Custom')
def get_layer_name(feature, parent):
return qgis.utils.iface.activeLayer().name()
Its define a new get_layer_name() function that returns the name of the active layer and can be found under the Custom group of the expressions list.
Click on Save and Load Function.
Switch to the Expression tab and write this expression:
layer_property( get_layer_name(), 'attribution')
It returns the Attribution metadata of the active layer.
Don't forget to refresh the layout view when the active layer has changed.
add a comment |
One answer to your question can be a union of the great answers (in fact, your question is almost a duplicate) of this one: Automating citation of data source in QGIS print composer?
Add a new text label to the layout.
In the item properties of the label, main properties, click on Insert an Expression.
In the expression builder, switch to the Function Editor tab, and paste this code:
# Be sure to import iface from qgis.utils
from qgis.core import *
from qgis.gui import *
from qgis.utils import iface
@qgsfunction(args='auto', group='Custom')
def get_layer_name(feature, parent):
return qgis.utils.iface.activeLayer().name()
Its define a new get_layer_name() function that returns the name of the active layer and can be found under the Custom group of the expressions list.
Click on Save and Load Function.
Switch to the Expression tab and write this expression:
layer_property( get_layer_name(), 'attribution')
It returns the Attribution metadata of the active layer.
Don't forget to refresh the layout view when the active layer has changed.
add a comment |
One answer to your question can be a union of the great answers (in fact, your question is almost a duplicate) of this one: Automating citation of data source in QGIS print composer?
Add a new text label to the layout.
In the item properties of the label, main properties, click on Insert an Expression.
In the expression builder, switch to the Function Editor tab, and paste this code:
# Be sure to import iface from qgis.utils
from qgis.core import *
from qgis.gui import *
from qgis.utils import iface
@qgsfunction(args='auto', group='Custom')
def get_layer_name(feature, parent):
return qgis.utils.iface.activeLayer().name()
Its define a new get_layer_name() function that returns the name of the active layer and can be found under the Custom group of the expressions list.
Click on Save and Load Function.
Switch to the Expression tab and write this expression:
layer_property( get_layer_name(), 'attribution')
It returns the Attribution metadata of the active layer.
Don't forget to refresh the layout view when the active layer has changed.
One answer to your question can be a union of the great answers (in fact, your question is almost a duplicate) of this one: Automating citation of data source in QGIS print composer?
Add a new text label to the layout.
In the item properties of the label, main properties, click on Insert an Expression.
In the expression builder, switch to the Function Editor tab, and paste this code:
# Be sure to import iface from qgis.utils
from qgis.core import *
from qgis.gui import *
from qgis.utils import iface
@qgsfunction(args='auto', group='Custom')
def get_layer_name(feature, parent):
return qgis.utils.iface.activeLayer().name()
Its define a new get_layer_name() function that returns the name of the active layer and can be found under the Custom group of the expressions list.
Click on Save and Load Function.
Switch to the Expression tab and write this expression:
layer_property( get_layer_name(), 'attribution')
It returns the Attribution metadata of the active layer.
Don't forget to refresh the layout view when the active layer has changed.
edited 26 mins ago
answered 32 mins ago
Gabriel De LucaGabriel De Luca
2,753215
2,753215
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313384%2fdisplay-credit-in-map-composer%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown