Jump to content

Module talk:Location map/Archive 3

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1Archive 2Archive 3Archive 4Archive 5Archive 10

Red dot

About a week ago, the red dot used in {{infobox UK place}} became smaller and less red. It used to look like instead of Image:Red pog2.svg. I cannot see any discussion of this change (and this template was changed to use Image:Red pog2.svg back in September 2007) so I do not know if this is a deliberate change. To my mind, the dot is now too small and insignificant for use on maps such as that in the infobox for Caddington. JonH (talk) 13:58, 15 November 2008 (UTC)

I agree, it's far too small. It's a problem with a newly uploaded Image:Red pog2.svg on Commons, I've asked for it to be reverted. --Joowwww (talk) 20:17, 15 November 2008 (UTC)
Ok, I've fixed the problem. The template was pointing at the wrong image on commons. -----J.S (T/C/WRE) 21:28, 15 November 2008 (UTC)

Thanks. (In the same way that this template can only be changed by administrators, perhaps the image used for the dot should be protected.) JonH (talk) 09:53, 16 November 2008 (UTC)

Full support. --Obersachse (talk) 10:47, 16 November 2008 (UTC)

Alt attribute

For the benefit of user who do not see the image, this template should allow the user to set an alt attribute ("Alternative text", defined in the MoS as: "…a substitute for the image, for those who cannot see it. It should not interpret the image, or suggest its meaning, since that role belongs to the caption") on the image element, and when none is set, have an appropriate default. For instance, a user might set the attribute in the Pag example to:

Pag is located on the island of Pag, off the West coast of Croatia, in the northern Adriatic Sea

and the default, generated from values already in the template, might be:

Pag is located at 44°26′N 15°04′E

Alternatively, the default could be a null value.

How would folks like to proceed; and can someone assist in coding this, please? Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 18:52, 4 January 2009 (UTC)

{{editprotected}} Done by Chris G. — Kalan ? 11:20, 7 January 2009 (UTC)
Done at User:Kalan/editprotected, requesting an admin to make changes.
Alternative text is adjusted with alt=; if not set, the alternative text defaults to a generic description (in our case, Pag is located in Croatia), because coordinates recalculation would complicate the template too much.
P. S. Your signature looks like a continuation of your message rather than a signature; could you make it shorter?
Kalan ? 06:47, 7 January 2009 (UTC)
Many thanks! (Will revisit sig, but am trying to adhere to WCAG with it! Suggestions welcome) Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 21:37, 7 January 2009 (UTC)

Sakhalin Island

Would someone mind adding [[image:Sakhalin.PNG]] to the list of available maps please. Thanks Socrates2008 (Talk) 08:02, 6 January 2009 (UTC)

What are the border coordinates of the image? --Obersachse (talk) 12:26, 6 January 2009 (UTC)

Switch to new image

Please switch the template to make it use the image File:Croatia location map.svg, which have the same coordinates, but with a better quality (SVG). Yug (talk) 14:06, 24 January 2009 (UTC)

 Done, that was to do on an other, not protected tamplate. That's done now ;) 14:27, 24 January 2009 (UTC)


Marker in PDFs

The marker is dislocated in PDFs as the book tool can not interpret CSS. Developers are working on a solution for this problem. Till then the marker (not the map) should be omitted in PDFs by encapsulating related markup within the {{Hide in print}} template. --He!ko (talk) 20:35, 1 March 2009 (UTC)

China

Hi, someone recently changed the map for China to an apparently prettier one. I reverted this, as it led to wrong locations shown in infoboxes (for example Hohhot). If someone wants to look into it, please do. Yaan (talk) 16:36, 8 April 2009 (UTC)

Atlantic Ocean

Any chance someone could help with a map of the Atlantic Ocean? Thanks Socrates2008 (Talk) 11:59, 1 June 2009 (UTC)

Template:Location map 270-0-360-90? --Obersachse (talk) 11:00, 2 June 2009 (UTC)


karvenagar in pune —Preceding unsigned comment added by 115.109.13.45 (talk) 09:22, 15 June 2009 (UTC)

Ontario

The location map that this template uses for Ontario is proportionally deformed and not at all representative — it looks like it's been flattened by a steamroller, such that the province appears much narrower east-to-west and much longer north-to-south than it really is. The map that's supposed to be used on Ontario articles, the one that's actually proportionally correct, is this one.

And no, this isn't a trivial nitpick, either — we're better off having no maps at all than we are having ones that are wrong. Bearcat (talk) 14:10, 26 July 2009 (UTC)

Techy question

Maps have been added to various list of windmills in the UK, such as List of windmills in Suffolk. Problem is that there are so many that labels overlap. Is it possible for the red dots to be the actual link themselves, so that clicking on the dot leads to the article on the windmill? Mjroots (talk) 07:07, 4 August 2009 (UTC)

The documentation at Template:Location map+ suggests that this can be done by supplying the |link= and |alt= parameters within the {{location map~ }} templates thus:
{{location map~|Suffolk|label=1|position=right|background=white|lat=52.146|long=1.600 |caption=|float=
 |link=Fort Green Mill, Aldeburgh
 |alt=Aldeburgh
}}
However, having actually tried that, it doesn't work: whilst hovering the mouse over a red dot shows that these parameters are being recognised, clicking it just displays the page for File:Red pog.svg. This is a known bug (July 2009) according to Wikipedia:Images linking to articles, so may get fixed later on. --Redrose64 (talk) 09:49, 12 August 2009 (UTC)

Automatic position

Is it technically possible to have the label automatically positioned left or right to avoid the label extending outside the area of the map? For example (at its simplest), a parameter of |position=auto which would automatically choose either left or right depending on whether the longitude was to the east or west of the map centre? --Dr Greg (talk) 11:56, 11 August 2009 (UTC)

All is possible. But I'm afraid, it will be a lot of code. Is it really neccesary? --Obersachse (talk) 20:17, 11 August 2009 (UTC)

It's causing a problem with {{Infobox UK place}}, used in more than 10,000 UK articles. The template has just recently started adding label text, and you can see an example of where it goes wrong at Wycoller. There's an ongoing discussion at Template talk:Infobox UK place#Changes as to whether it's worth using labels when they can go wrong like this, or whether other solutions are possible. If it's "a lot of code", I can't judge whether this is worthwhile or not. --Dr Greg (talk) 00:03, 12 August 2009 (UTC)

It's doable, but it is really quite a pain at the moment because of the way things are done. Maybe this would be a good time to restructure the template so that the top-level template would do all the projection calculations, and then pass pixel percentage coordinates to a child template which would actually display the map and the marker. If it was done that way, adding this feature would be trivial. Zocky | picture popups 01:42, 12 August 2009 (UTC)
I support Dr Greg in his request. It makes a mess of the label for those places on the right hand edge of the map. As a programmer I know that some trivial requests are not actually trivial to do, but this is one request which should have a higher priority. Twiceuponatime (talk) 08:02, 12 August 2009 (UTC)
I once did something in PostScript where a label shown in a proportional-spacing font needed to be shown to the immediate left of the point it was labelling. The basic idea was to go to that point, move left by the length of the string, and then display the string. But, because it was a p.-s. font, there was no simple length calculation for the leftward movement. What I think I did was to:
  1. move to the point which was to be labelled
  2. set font face and size
  3. set text direction as rotated 180 degrees
  4. show required text
  5. record cursor position
  6. draw filled rectangle in white, from the new position to the point position
  7. set text direction as normal
  8. set text colour to black
  9. recall saved cursor position
  10. show required text
The colour for the first show is immaterial, since it will be overwritten by the white rectangle.
Now, I'm afraid that I can't show you the actual PostScript that I used, it's under copyright to my previous employer. --Redrose64 (talk) 08:59, 12 August 2009 (UTC)

Despite my relative inexperience in template programming, I've made an attempt to implement this myself. I've created Template:Location map/test/template as a suggested replacement for this template, which in turn calls Template:Location map/test/subtemplate. If I've got it right, it should do everything this template does, plus the extra |position=auto functionality I asked for. The template also includes, within its "noinclude" part, a test of itself to show that it works. Can other editors who have worked on this template please go over my version with a fine toothcomb to check I haven't made a stupid mistake in my refactoring? Feel free to improve my attempt as you like. Hopefully an examination of the outer template should make it reasonably clear how both of them work. All the lat/long calculations and consultations of the relevant map template are done in the outer template. --Dr Greg (talk) 19:47, 12 August 2009 (UTC)

I went and redid it, and wrote some metatemplates to simplify coding of map templates. We should thoroughly test it, and then {{Location map/test/subtemplate}} should become {{Overlay marker}} or something like that.
Should we think about adding other functionality? Here are a few things I'd like:
  • ISO-compatible names for country/region/city maps
  • a parameter for the projection of the map in map templates, so we can have skewed and polar maps without the user having to think about it
  • possibly named standard markers, e.g. mountain, city, etc.
  • warning if coordinates are outside of the map.
  • any other smart ideas somebody comes up with.
Zocky | picture popups 02:28, 15 August 2009 (UTC)

Thanks very much for your work on this. I'll leave the questions above for others to answer, but while you are refactoring you might also like to consider how {{Location map+}} and {{Location map~}} work, and see if all these related templates can share the same code as much as possible.

A couple of "bugs" in the current implementation were found by participants at Template talk:Infobox UK place#Changes. When the label splits into two or more lines (as demonstrated in some of the "self test" examples) and a background colour is used for the label, the second row can obliterate the descenders (e.g. the letter "g") in the first row. And when |position=top is used with a multi-line label the text is raised by only one line so the second line goes right over the marker (also demonstrated in the "self test"). I suspect neither of these would be easy to fix.

P.S. I've just discovered closely related {{Location map skew}}, {{Location map many}}, {{Location map 100x100}} as well! Ideally all should share as much code as possible. -- Dr Greg  >talk  10:56, 15 August 2009 (UTC)

Automatic position work in Template:Location map2. If horizontal position of marker > 70%, then position of label automatic switch to left.--Амба (talk) 00:14, 16 July 2010 (UTC)

Infobox Australian Place

This is a problem that is impacting {{Infobox Australian Place}} as well, which has about 6,500 includes. --TheJosh (talk) 03:15, 14 September 2009 (UTC)

New template version - do we want it?

Lua error in Module:Location_map/sandbox at line 433: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 433: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 433: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 433: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 433: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 433: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 433: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 433: No value was provided for longitude.

I went and extensively refactored the template at {{Location map/Sandbox}}. There are a bunch of subtemplates:

The following should be moved under {{Composite}} (which is now a deprecated redirect with just a couple of links) if we decide that we like them.

Other things to note:

  • The template produces a single marker by default, but this can be overriden with the overlay argument, which can contain any number of overlays (i.e. markers, rectangles, and when I get around to it, labels)
  • Arguments have more logical names (old names are kept for backward compatibility)
  • The Overlay template uses a html table to correctly place overlays. This is unfortunately necessary if we want vertical centering to work without manually specified heights. This may cause problems with accessibility for blind people, so should be discussed before deploying.
  • The new version automatically handles maps crossing 180degs, so once deployed, templates that contain them should be updated (drop the crosses180 parameter, and change the right parameter to what would be normally expected, e.g. -170, not 190).
  • There must still be bugs in the new template, so it should be tested against the current template before deploying.
  • {{Location map/rangemaplon}} and {{Location map/rangemaplat}} should know how to handle skewed and polar maps. We obviously can't place rectangles on them, but markers should work.

Comments and suggestions are more than welcome. Zocky | picture popups 15:12, 16 August 2009 (UTC)


Thanks very much for the huge effort you've put into this. As you say, it will need testing, and I'll try to do some of that over the next few days.
I have some concerns over backward compatibility. First, does it make sense to make |label_gravity=auto the default, when previously it was |position=right? It may make some existing maps look much different than the original creator intended. Apparently {{{alt}}} and {{{border}}} are no longer supported. I think support for {{{alt}}} is quite important for reasons of accessibility for visually impaired readers. You haven't documented the backward compatible support for {{{float}}}.
By the way, there never was a |position=auto (except in my test version), so you don't need to backwardly support that.
I'd also suggest you allow |label_gravity=centre as a synonym for "center". The name "label_gravity" makes no sense to me, "label_position" seems more logical.
Once I've had a chance to do some tests, I may have more comments. Thanks, again, for what you've done, Its a lot more than I was expecting. -- Dr Greg  talk  17:53, 16 August 2009 (UTC)
I added alt and fixed the docs. As for label_gravity, you're probably right, but it's too much effort atm, so I'll think about it some more and fix it when I get around to it.
Before we get too excited about the new template, we should remember that the template is used on several hundred thousand pages, so adding just 6 subtemplate calls (and we have more) would add a million records to the template link table. Before we actually deploy this, we should look into having a partially substed version for the most common case, and use the complicated structure only for custom-overlay maps and development. Zocky | picture popups 18:55, 16 August 2009 (UTC)
The other thing - default gravity: auto looks reasonable for maps with a single marker. It's probably not the correct way for {{location map+}} maps. Zocky | picture popups 19:01, 16 August 2009 (UTC)
I sure hope your code can be implemented. Trying to read the old code has been giving be headaches. Its a great template though. You might consider using {{Decdeg}} instead of {{Coord2dec}} as Decdeg its transcluded in thousands of pages and has proved to be robust. Not that its that complex. You'll have to check to make sure it has the functionality you need. It can use named or unnamed parameters. It can handle "degree minute second", degree minute" and "degree". The last element can be include a decimal part. Its sort of the duplicated functionality issue. As ever if you can improve Decdeg then have at it. I kind of like hem (hemisphere) more than dir (direction). I think hemisphere is closer to what we're talking about.
Someone pointed out to me the MOS section on coordinates. It says that the names lat_d, lat_m, lat_s, lat_NS, long_d, long_m, long_s and long_EW should be used. There are many templates that use other names and I think it just adds to the confusion.
I never did understand why float:center is forced to none in the switch. If it can be implemented it would help out centering images in infoboxes without using div blocks. [[File:Bad Title Example.png|center|200px|alt=Example alt text|Example caption]] looks like this:
Example alt text
Example caption
I think the border thing isn't working right now and I notice that you did not implement it. I hope that can be fixed. See Template:Infobox_mountain/testcases#Mount Fuji. I have thought that frame might be more descriptive. When maps are displayed in infoboxes where the width of the map is considerably less than the width of the infobox it can make the map look a little crisper. Especially when the colors near the edges of the map are of light.
It might a good idea to use a named parameter in addition to {{{1}}}. So something like {{{map|{{{1}}}}}}.
I tried to fix the problem with the sandbox not showing up in the current template documentation page. I didn't do a very good job so I requested a {{db-move}. When that's done I'll move template:Location map/Sandbox to template:Location map/sandbox and leave a redirect. –droll [chat]
Ah, I simply forgot the border argument, so that should be fixed. As for {{decdeg}} vs. {{coord2dec}} - unlike the former, the latter will default to the decimal value if the dms value is not provided. This isn't very useful in articles, but it's very useful in templates like this which must accept both DMS and decimal arguments - you simply pass all appropriate arguments to {{coord2dec}}, and it does the magic for you, so you can skip at least a couple of complex #ifs per template.
I screwed up argument names when I first created this template, so I'm not going to pretend that I know what argument names are best. They should be compatible with other templates, and obviously, we need to keep them backward compatible. Zocky | picture popups 15:43, 21 August 2009 (UTC)
Hmm, well has anyone tested this yet in Firefox 3.5.2 with monobook? place 1,2,3,4 markers are way over in the left margin of the page. RedWolf (talk) 06:21, 28 August 2009 (UTC)
Yes, I see that too (using Firefox 3.0.13 [I've not upgraded to 3.5 because would lose some compatibility] under Windows XP Pro [don't know how to determine version, there's no 'Help About'] and Monobook); besides those four red pogs (labelled "place 1" to "place 4") to the left of this section, I also have two more unlabelled red pogs way off the bottom (press the 'End' key and they are in left margin of an otherwise blank area). The Africa map also seems to have lost its rectangles, but gained two red pogs (one in Mali, the other in the South Atlantic); I suspect that the two way off bottom are associated with these. --Redrose64 (talk) 20:25, 28 August 2009 (UTC)
Somebody had changed the sandbox version to something else. All should be back to normal now. Zocky | picture popups 01:55, 29 August 2009 (UTC)
I'm now at my mother's house, she has IE8. The last three maps have their rectangles compressed into vertical lines at the left edge of the maps themselves. --Redrose64 (talk) 12:06, 29 August 2009 (UTC)

Minor fix for improved accessibility

{{editprotected}} For WP:ACCESSIBILITY by visually impaired readers, the little marker that this template generates should not have a link, so that the link doesn't cause a screen reader to read the link's name aloud. Could you please install this simple sandbox patch? Thanks. Eubulides (talk) 23:09, 27 August 2009 (UTC)

 DoneJake Wartenberg 18:35, 28 August 2009 (UTC)

Also need "alt="

{{editprotected}} As a followup, the little marker should also have |alt= instead of alt text; this is documented in WP:ALT #Purely decorative images. Could you please also install this obvious sandbox patch as well? The existing "|{{#if: {{{label|}}} | {{{label}}} | {{PAGENAME}} }}" code was designed for older MediaWiki versions, and is no longer relevant; it should be replaced with just "|alt=" as WP:ALT says. Thanks. Eubulides (talk) 23:38, 24 September 2009 (UTC)

Done. — RockMFR 03:35, 25 September 2009 (UTC)

Hungarian version of this template is missing on the interwiki. it is hu:Sablon:Pozíciós térkép.

I've asked my girlfriend User:Monkap to make a similar comment at the Hungarian page (she is native Hungarian), which has no Interwiki links at all. I dunno whether Interwiki bots have special permissions on locked pages, but probably easiest anyway to notify it on both sides.

Thanks Si Trew (talk) 16:18, 7 December 2009 (UTC)

Actually, it does not appear to be missing. Hmmm. I noticed some template in this area where the Hungarian was missing, but this isn't it. No action needed, withdrawn (and on Hungarian side). Si Trew (talk) 10:15, 8 December 2009 (UTC)
As a conclusion, it was missing, but was added by the Hungarian side to the English WP, as far as I can tell. Our initial comment there got the response (basically) "oh yes it is, it's been there since 2008" with a followup by another editor "oh no it wasn't, I just added it". It added everything from English WP to its own Interwiki links, and so presumbably that ed itself or an interwiki bot injected it into EN:WP after.
All is good. I still can't get the coords for [:Template:Location Map Kingdom of Hungary]] quite right, despite some input from various people, and having read off from fairly accurate maps, which admittedly use I think a Mercator projection but at this latitude and scale they would only be a couple of pixels out at most, which IMO is good enough (considering that generally one only specifies the edge lat and long to about six sig figs anyway, and I measured with calipers etc to about eight). Now just at the stage of fiddling about with it, which is a shame to have to do in template namespace (because of the self-referencing via the /Info subtemplate), unless there is a trick I don't know where I could have done it in my user space before moving it up. Si Trew (talk) 21:49, 2 January 2010 (UTC)

Pune locator map

i wish to know how do we create a city area locator map. I tried doing it with inkscape but it was quite difficult, especially drawing roads. i wish to create a Pune Area locator . thnx Nirvanareborn 14:57, 11 December 2009 (UTC)

Try User talk:NordNordWest if nobody will help here. --Obersachse (talk) 22:14, 11 December 2009 (UTC)
thnx a lot Nirvanareborn 05:06, 13 December 2009 (UTC)

Wales map - request for help

Snowdon is located in Wales
Snowdon
Snowdon
Snowdon (Wales)

Can someone take a look at {{Location map Wales}}, please? The syntax was screwed in one place, which I eventually spotted and fixed (I hope). However, the co-ordinate range was wrong before I got there. I've tried to fix it using ranges from Extreme points of the United Kingdom#Wales, but unsuccessfully, as it now thinks that Snowdon is in the middle of Anglesey... Unfortunately, I don't know enough about mapping to take this any further. Thanks, BencherliteTalk 21:00, 14 December 2009 (UTC)

Take that: Template:Location map Wales3 and the problem is solved. --Obersachse (talk) 13:59, 2 January 2010 (UTC)