This is an archive of past discussions about Module:Location map. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.
I remember that IE is notorious for botching up the stacking order when it comes to relatively positioned elements (see also the z-index bugs in earlier IE versions). Perhaps IE8 has issues with stacking order of relatively positioned elements as well (we aren't using an explicit z-index here, but that means it's z-index:auto of course). But I don't have Windows, so I cannot test. —TheDJ (talk • contribs) 22:12, 9 January 2010 (UTC)
Yeah, well, bl**dy Microsoft. When did they last write software that actually worked per spec? 23 years ago (MS-DOS 3.3), that's when. --Redrose64 (talk) 00:44, 2 February 2010 (UTC)
In my experience MS software is on average no more buggy than anyone else's, and a lot better than some. For some reason, people just like bashing them all the time. 86.136.194.75 (talk) 14:39, 2 February 2010 (UTC).
Either way, as far as a website is concerned, the implementation is the standard, at least if the implementer represents a significant share of the market.
But while responding there, I noticed that I'm no longer having a problem. Yay! (I'm still using Navigation Popups and Monobook.)
We've speculated at VPT that there may have been an unannounced fix included with the January 2010 IE security update. Unless you are still getting the problem after having installed the update?
Does anyone think that Russian template should use this image (upper one) instead? As a citizen of Russia myself, I'm much more pleased with this representation of Russia than the equirectangular projection, and apparently so do members of Russian, German, French and some other Wikipedias. I tried to make a new template by copy-pasting the code from those templates, but it seems like English wiki does not recognize it. --NineInchRuiner (talk) 14:06, 8 January 2010 (UTC)
Overall, this map does indeed look much nicer, but it is missing the boundaries of the federal subjects and is, thus, quite useless for the purposes served by the location maps. If a map is produced in this projection that includes the federal subject boundaries, then it would be much more helpful.—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); 14:48, January 8, 2010 (UTC)
It seems that map below might be done in the same projection, though position is slightly turned anticlockwise and the scale is slightly bigger. I believe it can be investigated with some external application (Photoshop, etc.), and if correct, it will be possible to paste boundaries onto the first map. What do you think? --NineInchRuiner (talk) 15:39, 8 January 2010 (UTC)
Is there a new template that works as a locator for a non-equirectangular projection? I would love to have something like this implemented for Alaska, so our locator map doesn't look so ridiculous. Calliopejen1 (talk) 21:54, 2 February 2010 (UTC)
I don't know if it's ever been discussed before but the name fields in some maps are not very useful. For example {{Location map USA}} gives "USA". While correct, IMHO that is not to useful in a sentence. For example "The location of xyz in USA" is not the way it should read. I think the name should produce "the USA" so that a sentence would read "the location of xyz in the USA". There are other nations have the same problem. For example, the United Kingdom and the United Arab Emirates. All opinions welcome. –droll[chat]03:09, 8 February 2010 (UTC)
Multiple markers
I'm interested in creating a placename distribution map for an article I'm writing. This would involve placing more than 300 markers on a map. Is this something that would be possible using a template, or is the only option to create an image offline and import it as a jpeg?
That looks okay for my purposes, I mainly want to add them to illustrate density rather than having specific locations determinable, so I've also taken out the labels... looks pretty good so far. Catfish Jim and the soapdish (talk) 16:31, 11 February 2010 (UTC)
With so many markers, would it not be more appropriate to create an SVG image showing all the markers (and any labels), perhaps also incorporating the underlying map? Otherwise, the servers and browsers might both struggle. I don't know how familiar you are with editing SVG files, but it might be worth the effort to prevent the article from becoming frustratingly slow to render. — Richardguk (talk) 01:33, 12 February 2010 (UTC)
Noted similar comments at Wikipedia:Village pump (technical)/Archive 132#Template for creating distribution map where it seems this question originated and from where it never quite moved! But older versions of Excel producing poor quality graphics. SVG, on the other hand, scales better (in theory at least) at different image sizes, and it may be that you could work out how to edit the SVG code manually to place each marker (since SVG itself uses coordinates to position elements) without even needing to use an SVG graphics editor program. — Richardguk (talk) 01:58, 12 February 2010 (UTC)
{{Location map|Missouri|label=Kansas City
|lat_deg=39|lat_min=06|lat_sed=00|
lon_deg=-94.58|
}}
{{Location map|Missouri|label=Kansas City
|lat_deg=39|lat_min=06|lat_sed=00|
lon_deg=-94|lon_min=34|lon_sec=48|
}}
Note: Must enter negative lon_deg number, or the dot is moved over 180 degrees
See right, please observe spelling mistakes in your version: |lat_sed=. If you amend these to |lat_sec=, it should work. Please also note that the negative longitude fiddle is not required if you specify |lon_dir=W:
{{Location map|Missouri|label=Kansas City
|lat_deg=39|lat_min=06|lat_sec=00|lat_dir=N
|lon_deg=94|lon_min=34|lon_sec=48|lon_dir=W
}}
So a couple of weeks ago user user:Aleksandr Grigoryev changed Location map marker size from 8 to 5px with no explanation. I tried to revert but he did it again, to 4px. History. I asked him if there was any discussion on the subjuect but he seems be ingnoring me while still replying to other people (meaning he's not away or anything). What should I do and what you people think the size of marker should be?--NineInchRuiner (talk) 11:36, 27 April 2010 (UTC)
For lighthouses we need a location map of the Chesapeake Bay including major tributaries and showing both Virginia and Maryland state borders. Is there someone who could make this up or point me to where to go or instructions for doing it myself? Mangoe (talk) 03:13, 2 May 2010 (UTC)
Padding
The template needs a bit of padding so that text does not butt right up to the edge of the map. It should be a variable. -- Alan Liefting (talk) - 10:13, 12 May 2010 (UTC)
which seems to have done the trick. There's a complicated interrelationship between several templates but from the article pages I've checked after purging the amended template, there don't seem to be any side effects.
The label positioning seems a bit of a hack right now. Is there a better way than assuming a label width of around 6.5em? Is there some alternative way to allow for variable label width without resorting to str len functions? Plastikspork―Œ(talk)20:38, 15 July 2010 (UTC)
FYI, I didn't see any discussion, but this template has now been forked: Template:Location map2. It is currently being replaced in many infobox templates. I'm not sure how I missed the discussion of this change. It would seem better to just improve this template, rather than fork it. Plastikspork―Œ(talk)14:16, 17 July 2010 (UTC)
Okay, I think there were some misunderstandings. As far as I can tell the new templates have a few new features (1) Automatic positioning of the label if the point is close to the border at the right of the template, (2) The ability to select relief maps, and (3) Support for edcp location maps for very large regions and/or regions far from the equator (like Africa, Russia, Canada). I believe this would be a great addition to WP. We should certainly merge these changes here if possible, if there is support to do so, since the name {{Location map2}} is not very obvious to the end user. Also, I would imagine that {{Location map Africa1}} and {{Location map Russia1}} aren't the best names either. Can we merge these with {{Location map Africa}} and {{Location map Russia}}? Should we support both the current and edcp using a "type=" option? Thanks for all your help, and please if anyone else has any input, please discuss here. For example, should the edcp maps be the default? Thanks! Plastikspork―Œ(talk)18:26, 18 July 2010 (UTC)
I support the code changing. The english Wikipedia should have the same possibilities to use edcp maps as the german or russian. They prefer edcp maps, making them default. So should we. The type option is not needed because we have the AlternativeMap parameter. --Obersachse (talk) 21:08, 18 July 2010 (UTC)
We support both the current and edcp without using a "type=" option. The main parameter is {{{1}}}=(Russia, Russia1). In other templates location map = (Russia, Russia1). If there is parameter |x= in location map template ({{Location map Russia1}}), then edcp. If there is no parameter |x= , then standard algorithm. Polar maps is not supported now (may be later).--Амба (talk) 00:26, 19 July 2010 (UTC)
Okay, since there seem to be no objections, I start merging the code. I will make a few minor adjustments, but it should be basically what was suggested by Амба. Thanks for your help! Plastikspork―Œ(talk)22:30, 26 July 2010 (UTC)
Updates
Okay, I have merged the changes as discussed in the thread above. I don't believe this will break anything and adds support for non-rectangular projections (e.g., edcp location maps). It also adds new default label positioning logic to try to move labels left when near the right edge of the map. I am hopeful that we will finally have {{Location map Antarctica}} working. For those interested in the details, this is the way it works. A location map is passed the lat/long (decimal) coordinates and asked to return the x and y position of the marker in the form of an expression which can be evaluated by the "expr" parser function. This means that the subtemplates are no longer brainless, but have some knowledge of the mathematical formulae used in the projection. If the location map template is one of the old versions, that does not return such an expression, then it falls back on the old code, and asks for the coordinates of the top/bottom/left/right edges of the map. I would say with this we could potentially ax {{Location map skew}} as well. I will work on updating the documentation when I have a chance. But for now, hopefully nothing broke, and the old behaviour should still work as it did before the update. Plastikspork―Œ(talk)22:49, 26 July 2010 (UTC)
Can you provide a link? I don't think it was changes to this template that broke stuff, it was changes to {{Location map China}}, {{Location map Russia}}, ... which caused problems with {{Location map~}}. This problem should be fixed now as far as I can tell. Please correct me if I am wrong, and let us know what specifically broke so we can fix it. Thank you. Plastikspork―Œ(talk)14:43, 31 July 2010 (UTC)
Please correct me if I am mistaken but the image referred to does not use equirectangular projection and so it needs the coordinates of the origin. Notice that neither the latitudinal nor the longitudinal lines are parallel. I doubt that a map using equirectangular projection of such a vast area would be practical. I haven't kept up with the recent modifications to this template but {{Location map skew}} does not do well with every projection thrown at it. The idea of including some formula in the map template might be an approach that would work but I don't know if this is possible. The formula would be required to calculate only a rough estimate of the correct placement. It would be best if the formulas were reviewed by somebody with experience in numerical methods. Sorry if this seems esoteric. –droll[chat]01:14, 2 August 2010 (UTC)
In which world do you live? de:WP, fr:WP and ru:WP use all kinds of projections. The formulas calculate the exact placement. Uwe Dedering (talk) 20:24, 2 August 2010 (UTC)
I would like to be able to create a location map where I upload an SVG of a country with administrative borders in standard colors, make a location map template with geographic references, then feed it a parameter telling it to highlight (set fill to red) the topmost polygon located at a given longitude/latitude. With this, a single standard SVG map could be used for an entire country of state/province articles. I don't know much about WP template scripting, but would this be possible? Lesqual (talk) 04:36, 15 August 2010 (UTC)
Everything is possible, but something is very complicated ;-)
Your proposion has a big plus (only one map), but is very very difficult to realize. I'd like to propose another way. The minus of my proposion is, we have to use a set of maps, each map with a different state/province colored. But it's much more simpler to use with the help of the AlternativeMap parameter. For an example see Template:Location map Estonia Pärnu County. --Obersachse (talk) 05:54, 15 August 2010 (UTC)
Bug in calling location map with negative decimal longitude when map crosses 180
I don't think that the problem is truly fixed: now positions in the eastern hemisphere will not work. For example:
{{Location map
|Alaska
| label = Arbitrary location
| lat = 60
| long = 175
| float = center
| caption =
| border = none
| alt =
| mark = Fire.svg
| marksize = 8
| width = 272
| position =
}}
produces
Arbitrary location
The Russian article uses dms to describe the location: it doesn't use the {{{lat}}} and {{{long}}} parameters directly. I believe that is where the problem lies. —hike395 (talk) 16:08, 6 September 2010 (UTC)