Template talk:Superimpose

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Really neat and wikistyle idea[edit]

A really neat and wikistyle idea. This was discussed on the german WP before (with bitmap superimpose using css) but dismissed, since the resulting pictures cannot easily be saved on a local harddrive by users. --Dschwen 07:57, 3 November 2005 (UTC)[reply]

Yes, it's designed for use within Wikipedia pages, not as a tool for generating new downloadable images. Why did users want to download them? There may be other ways to do that, if it's a useful feature. —Papayoung 15:54, 3 November 2005 (UTC)[reply]

Great template! Template:Location on map is similar, except it has a frame and caption as with the "|thumb" image syntax (e.g. at Vail, Colorado). dbenbenn | talk 00:55, 22 November 2005 (UTC)[reply]

One highly annoying thing about this template is that the unit, px, is built in to the x and y parameters, but not the width parameters. dbenbenn | talk 05:15, 14 February 2006 (UTC)[reply]


Hi, if you like superimposing things, i've created the Template:Superimpose-text to superimpose wikitext to an image (including liks and that stuff). I guess more then an user will like this for his/her own page and userboxes. {{ Template: Superimpose-text |x=20 |y=30 |text=This is an example|Image name=Flag of Argentina.svg |pixel width=150 |caption=the example}} --Argentino (talk/cont.) 18:54, 1 May 2006 (UTC)[reply]

New template from the German wiki[edit]

On the German wiki, a new approach to this has come out: {{Lageplan}}, which can be placed inside another template and, with a bit of extra work, can place a point on a map given the geographical co-ordinates. It has been directly copied to the English wiki for use in the new template {{Infobox German Location}}. The text for Lageplan is still in German, but you get the idea. For an example, see Cologne. It has also been successfully implemented in {{Infobox Town GR}} (eg. Heraklion). - 52 Pickup 08:19, 10 January 2007 (UTC)[reply]

I'm not sure how that would assist the protected areas articles which uses this infobox...could you provide an example of how it might appear by using an infrequently edited article, for example Great Bear Wilderness?--MONGO 12:52, 10 January 2007 (UTC)[reply]
Unforuntaely I don't have time to come up with an example at the moment. But I think the core idea is that you need to come up with the mathematical equation that translates the geographical co-ordinates to the loc_x / loc_y values for a given map. (while this template uses pixels, Lageplan uses a relative 0-100 scale). - 52 Pickup 13:54, 10 January 2007 (UTC)[reply]
{{Lageplan}} has parameters with default values (loaded when the parameters are not specified), and uses a re-scaling algorithm. {{superimpose}} adds "px" to the x and y parameters. A template with % instead of px would probably be more flexible (in terms of image size). Or even one where the position can be entered either way (x=34px y=100px or x=20% y=35%).
[[Image:{{{float}}}|{{{float_width}}}
replaced with
[[Image:{{{float|Locator_Dot.svg}}}|{{{float_width|10px}}}
would default to those values when they are not specified. This however, can be better done in the templates that use superimpose. --Qyd 17:30, 10 January 2007 (UTC)[reply]

Location map[edit]

After discussing Lageplan above, I have just discovered {{Location map}} which already supports various maps. Check it out. - 52 Pickup 09:39, 24 January 2007 (UTC)[reply]

Frame[edit]

A random tip... It's possible to use {{imageframe}} to add a frame around a superimposed image, to make it look more like a normal image. See for example the Pilottown, Louisiana article. Also, if someone is feeling eager, it might be possible for the superimpose template to directly call imageframe itself, possibly optionally. --Interiot 19:08, 12 March 2007 (UTC)[reply]

Fix width for surrounding <div>[edit]

{{editprotected}}

Please change the first line from

<div style="position: relative;">{{

to

<div style="position: relative; width: {{{base_width}}};">{{

This is based on the problem raised here at WP:VPT. If the base image is centered within a table cell, the red dot appears off to the left because the surrounding <div> covers the entire table cell and not just the image. –Pomte 21:02, 27 April 2007 (UTC)[reply]

checkY Done. --ais523 08:27, 30 April 2007 (UTC)

Problem with functinality[edit]

I have noticed that if the base_width field is used to change the display size of the base image then the float image appears in the wrong location. The float_caption and base_caption fields are not functioning. See examples below:

{{Superimpose
  | base = US_Locator_Blank.svg
  | base_width = 288px
<!--| base_caption = United States Locator Map-->
  | base_caption = Location of Boulder, Colorado in the USA
  | float = Red Dot.svg
  | float_width = 10px
  | float_caption = Boulder, Colorado
  | x = 95
  | y = 80
}}

Notice that the float is somewhere in Oklahoma

{{Superimpose
  | base = US_Locator_Blank.svg
  | base_width = 200px
<!--| base_caption = United States Locator Map-->
  | base_caption = Location of Boulder, Colorado in the USA
  | float = Red Dot.svg
  | float_width = 10px
  | float_caption = Boulder, Colorado
  | x = 95
  | y = 80
}}
Boulder, Colorado
Location of Boulder, Colorado in the USA

This kludge works but it can't be implemented in the template until the height and width of the original image and the height and width of the resised image can be found. I think more about that latter unless someone else does it first.

{{subst:Superimpose
  | base = US_Locator_Blank.svg
  | base_width = 200px
<!--| base_caption = United States Locator Map-->
  | base_caption = Location of Boulder, Colorado in the USA
  | float = Red Dot.svg
  | float_width = 6px
  | float_caption = Boulder, Colorado
  | x = {{#expr: (200 * 95) / 288}}
  | y = {{#expr: ((130 * 80) / 187)}}
}}

x = 65.972222222222
y = 55.614973262032

Since I think x and y are colculated based on the width of 288px and the height of that image is 230px and we know the new width maybe we are ok already.

Question: are all maps of this size? Question are all original maps in svg format? Where to the png maps come from and why?

--droll [chat] 12:24, 9 March 2009 (UTC)[reply]

Add support for alt text[edit]

{{editprotected}} As per WP:ALT, for WP:ACCESSIBILITY by the visually impaired, it should be possible to specify alt text for images generated by this template. I've implemented this in the sandbox with this sandbox edit, which adds float_alt= and base_alt= parameters for the two images. I have tested the sandbox version with the test case, and have updated the documentation to describe the new version. Can you please install the change into the main version? Thanks. Eubulides (talk) 01:11, 16 July 2009 (UTC)[reply]

 Done Hersfold (t/a/c) 00:44, 17 July 2009 (UTC)[reply]

Accessibility improvement[edit]

{{editprotected}} Following up on the previous request, it turns out that the typical use of this template should specify alt text once, for the combination for the images, rather than have a separate bit of alt text for both images. The W3C suggests that, in this case, one supplies alt text for the first (base image) only.

I ran into this problem when reviewing the WP:ACCESSIBILITY of the featured article candidate Upper and Lower Table Rock. Its infobox uses {{Infobox protected area}}, which needs an accessibility fix (see Template talk:Infobox protected area #Accessibility improvement; in order to get that to work, {{Superimpose}} needs to be extended so that the caller can specify the |link= parameter of the image syntax, and so that the caller can specify an empty caption for the floating image. The default link should be empty for the floating image, to support the usual case of a small marker floating over a large base image, where the marker should not be announced separately to the visually impaired reader. This default can be overridden by specifying a new |float_link= parameter. Similarly, there's a new |base_link= parameter for the base image, which defaults to the file page for the base image.

I've implemented this in the sandbox, and have documented it; could you please install the sandbox patch? Thanks. Eubulides (talk) 07:54, 17 October 2009 (UTC)[reply]

 Done, thanks for your ever-clear editrequests :)  Skomorokh, barbarian  08:35, 17 October 2009 (UTC)[reply]

Add 2nd layer of superimposition[edit]

The JA version of this template has already been implemented the 2nd layer of superimposition and is put into practical use. The EN version should follow it as well or further extends it to support more layers, say over 50 layers.

Testing sandbox:

-- Sameboat - 同舟 (talk) 23:03, 24 July 2009 (UTC)[reply]

Fix alt text[edit]

editprotected

New code is in the sandbox. I fixed alt text for the base image. The |alt= field only works for thumb images. The fix is a bit messy because I assume that both base_alt and base_caption are in use. In the sandbox version the two fields are synonymous but base_alt takes priority.

Neither float_alt or float_caption are functional and I don't know why. –droll [chat] 20:50, 3 February 2010 (UTC)[reply]

Sorry, I don't see why the new code is an improvement. Among other things, it breaks the test case in Template:Superimpose/testcases. In that test case, |base_caption=United States Locator Map works in the installed version (that text is put into the title text, and works as a tooltip with most browsers), but it doesn't work in the sandbox version (the title text is a copy of the alt text, which is not what's wanted). Can you please give an example of where this change is needed? Eubulides (talk) 03:46, 4 February 2010 (UTC)[reply]
Slightly off-topic. Does that mean the caption will act as the title attribute for pop-up tooltips meesage? -- Sameboat - 同舟 (talk) 04:37, 4 February 2010 (UTC)[reply]
Yes, as described in WP:PIC #Plain pictures. Eubulides (talk) 08:04, 4 February 2010 (UTC)[reply]

After some research I see that Eubulides is on the right side in this. When the courser is over the base image the text set by the title attribute (what we commonly call the caption) is displayed as a tool tip. The only way to see the alt text is to use the browsers image properties feature. So I'll let the browser developers worry about whats best for the visually impaired. Alt text for the pog can be viewed in the same manor but I have not found a way to display the title text. To avoid confusion I synchronized the sandbox with the active template. –droll [chat] 13:28, 4 February 2010 (UTC)[reply]

Problem on Internet explorer[edit]

I just noticed that the marker (dot) is lower when using IE than with Firefox, Chrome, Safari or Opera. I kinda think this is a problem. It could related to attribute inheritance which is not supported by any version of IE but is by the other four. I'm not sure if it is worth spending time to try to fix this issue. Any opinions? –droll [chat] 02:55, 13 February 2010 (UTC)[reply]

Does the parameter float_caption do anything?[edit]

In the HTML source code for this version of the sandbox, I can't find the the value assigned to float_caption. Is the parameter ignored by the parser? –droll [chat] 07:59, 24 September 2010 (UTC)[reply]

Caption and alt parameters[edit]

I've been working on an update for this template. There are two changes I'm making to other templates that transclude this template.

  1. The parser generates no HTML for values assigned to the float_caption and float_alt parameters. I'm removing these parameters from transcluded templates.
  2. Currently the value assigned to base_caption produces no visible output and because of the way this template handles alt text the value assign base_caption does not function as alt text as is the case with the extended image syntax. I'm going tweak the templates so that the value currently assigned to base_caption will be used as alt text.

I sorry if this explanation isn't clear. If you see something that you think is a mistake please leave a note here or on my talk page. –droll [chat] 06:07, 4 October 2010 (UTC)[reply]

Caption is actually misleading here, as it is actually title in nature. It serves as the mouse-over popup tool tips. As for alt attribute, please read wp:alt. Also I have added the border parameter in {{superimpose2}}, it's useful if the base image itself has extremely pale background and hard to be distinguished from the homepage background. -- Sameboat - 同舟 (talk) 06:28, 4 October 2010 (UTC)[reply]
Sorry. I'm reverting the edits I made. –droll [chat] 06:30, 4 October 2010 (UTC)[reply]

Update request[edit]

{{editprotected}}

Please paste the sandbox version into the active template. Please change {{template sandbox notice}} to {{documentation}}.

The change allows the base image caption to act as alternative text if none is supplied. See WP:EIS and WP:ALT. I wrote some test cases. No difference in output will be seen using a web browser. The changes can be checked by examining the HTML or by using a screen reader.

I added some comment tags to improve the readability of the code. Thanks. –droll [chat] 06:53, 7 October 2010 (UTC)[reply]

The caption should really be visible: right now it's simply acting as title text, which isn't right. (There are some troubling things in WP:ALT right now, such as the assertion that "see adjacent text" is a good choice of alt text, but I'll deal with them at WT:ALT.) I've edited the sandbox code to make the captions visible; this matches the display of similar templates. Thoughts? Chris Cunningham (user:thumperward: not at work) - talk 09:36, 9 October 2010 (UTC)[reply]
This template is used in Infobox templates that already have code to display a caption below the map. My edit request was very straight forward. Please don't added captions. Currently what is in the sandbox is not the edit I requested. I think what is now in the sandbox is too drastic a change. My simple intention was to make the template conform with the Wikipedia:Extended image syntax which, incidentally, does not display a caption below the an image unless it is a thumb. Because of the way the template is currently coded if no alt text is supplied the caption text does not act as alt text as is default case with the image syntax. I think any changes made to the template that are visible should be carefully evaluated so that they do not break pages that currently use the template. People who coded other templates, such as Infoboxes, expected this template to behave as it does now. I would rather see no changes made than those proposed in the sandbox. –droll [chat] 21:57, 9 October 2010 (UTC)[reply]
Yes, seriously...this is used in over a hundred articles I started..it's a bit cumbersome, but does a good job of providing a basic display location...it works well for various maps as in Chalco Hills Recreation Area and Bob Marshall Wilderness--MONGO 22:32, 9 October 2010 (UTC)[reply]
From what I can tell, every time this is called by another template (as with {{infobox protected area}}), the template in question could (and probably should) be using {{location map}} instead. Why is this a separate template in the first place? Chris Cunningham (user:thumperward: not at work) - talk 02:55, 11 October 2010 (UTC)[reply]
Obviously not. Although some user was using {{Superimpose}} which can be substituted by {{location map}}, there're still occasions that the superimposition is applied apart from indicating position on the map. Previously this template was transluded by the Wikipedia:ROUTE#Overlay project for combining new icons from basic icon images, though it is now substituted by {{superimpose2}}. -- Sameboat - 同舟 (talk) 04:14, 11 October 2010 (UTC)[reply]

Position = ?[edit]

In some languages (like finnish and spain) template has "position = right" -option to allign image easily on right edge. Can you pls add this feature to the template. Now it seems one must use


{| style="float:right; clear:right;"
|{{Superimpose ...
}}
|}

--RicHard-59 (talk) 16:55, 13 March 2011 (UTC)[reply]

The float_caption option is non functional[edit]

I noticed that text assigned to float_caption does not work as advertised and, in fact, generates no HTML code. –droll [chat] 23:40, 28 July 2011 (UTC)[reply]

I'm working on fixing this. My view is that this template should treat the caption, alt, and link parameters the same way that the [[File:name]] extension does and that is documented at Wikipedia:Extended image syntax. Changes to the markup would not change the templates output in any other way. If anyone has any comments or objections I would be interested. –droll [chat] 02:03, 29 July 2011 (UTC)[reply]
It is caused by voiding of "link" attribute if no entry given to float_link parameter. This is done intentionally as per wp:ICON. But disabling tooltip altogether is worth reporting to bugzilla. Adding file: after link={{{float_link| should do it but I don't recommend it. -- Sameboat - 同舟 (talk) 02:18, 29 July 2011 (UTC)[reply]
I don't think it is a bug. In the my sandbox version, float_caption is used as the title of the div that contains the dot image. I works fine. Take a look at the testcases. The file: bit look like some kind of kludge. Tomorrow I'll work up a version that conforms to the [[File:name]] extension that I mentioned above. Note that the my sandbox version is far from complete. For example, the float_link text should work as the title if there is no float_caption value defined. The way the alt text works does not conform either.

New version in the sandbox[edit]

I put some new markup in the sandbox. Take a look at the testcases. Caption, link and alt text output matches that of the File: syntax. Please make any comments you have promptly as I'll request that the template be updated if there are no unresolved objections. –droll [chat] 06:20, 7 August 2011 (UTC)[reply]

Attribution and the link parameter[edit]

While working on this update I was reminded that, if an image file requires attribution, the link to the image description page should not be suppressed "unless attribution is provided in some other fashion." See Wikipedia:Extended image syntax. Many images, including many map images, do not require attribution as they are in the public domain. Some, such as US Locator Blank.svg, do require attribution. –droll [chat] 06:20, 7 August 2011 (UTC)[reply]

In an effort to simplify attribution, I added an optional parameter in the sandbox version that displays an information icon with a link to the image description page for the base image. This does not address the issue of what to do when an editor wants to link form the superimposed image. The option is functional when the base image links somewhere else and only useful if the base image requires attribution. This method is borrowed from the clickable version of US Locator Blank.svg and can be seen on the image description page. –droll [chat] 18:52, 7 August 2011 (UTC)[reply]