Template:OSM Location map/sandbox/testcases

<<:Template:OSM Location map/testcases

Test of dateline functionality

{{testcase table

|_template=OSM Location map

|coord={{coord|0|0}} |zoom=0 |float=left |width=400 |height=200 |mark-sizeD=10

|label=Vancouver |mark-coord={{coord|49.25|-123.1}}

|label1=1 Manila |mark-coord1={{coord|14.5958|120.9772}}| dateline1=-1

|label3x = area across date line

|mark-lat3= 49

|mark-lon3=-179.9

|label-size3=13,outline,background|ldx3=10|ldy3=10

| label-pos3 = bottom,n-line

|mark-size3=14|shape3=n-square

|mark-title3=A square

|label4x = area across date line

|mark-lat4= 40

|mark-lon4=179.9

| dateline4=-1

|label-size4=13,outline,background|ldx4=10|ldy4=10

| label-pos4 = bottom,n-line

|mark-size4=14|shape4=n-square

|mark-title4=A square

|label5=Manila |mark-coord5={{coord|14.5958|120.9772}}

|label6x = area across date line

|mark-lat6= -20

|mark-lon6=179.9

|label-size6=13,outline,background|ldx6=10|ldy6=10

| label-pos6 = bottom,n-line

|mark-size6=14|shape6=n-square

|mark-title6=A square

}}

Pacific centric map -180

{{testcase table

|_template=OSM Location map

|coord={{coord|0|-180}} |zoom=1 |float=left |width=400 |height=200 |mark-sizeD=10

|label=-123° Vancouver ^d=0|mark-coord={{coord|49.25|-123.1}} | dateline=0| label-pos=right

|label1=120° Manila d=-1|mark-coord1={{coord|14.5958|120.9772}} |shape1=n-square

| dateline1=-1

|label3x = area across date line

|mark-lat3= 49

|mark-lon3=-179.9

|label-size3x=13,outline,background|ldx3=10|ldy3=10

| label-pos3 = bottom

|mark-size3=14|shape3=n-square

|mark-title3=A square

|label4x = area across date line

|mark-lat4= 40

|mark-lon4=179.9

| dateline4=-1

|label-size4x=13,outline,background|ldx4=10|ldy4=10

| label-pos4 = bottom

|mark-size4=14|shape4=n-square

|mark-title4=A square

|label5=Sidney|mark-lat5=-33.867778| mark-lon5=151.21 |dateline5=-1

|label6 = San Fran'

|mark-coord6= {{coord|37.7775|-122.416389}} | dateline6=0

|label-size6=13

| label-pos6 = right,mark-line,2,dashed

|mark-size6=14|shape6=n-square

|mark-title6=San Fran

}}

Pacific centric map 180

{{testcase table

|_template=OSM Location map

|coord={{coord|0|180}} |zoom=1 |float=left |width=400 |height=200 |mark-sizeD=10

|label=-123° Vancouver ^d=1|mark-coord={{coord|49.25|-123.1}} | dateline=1| label-pos=right

|label1=120° Manila d=0|mark-coord1={{coord|14.5958|120.9772}} |shape1=n-square

| dateline1=0

|label3x = area across date line

|mark-lat3= 49

|mark-lon3=-179.9| dateline3=1

|label-size3x=13,outline,background|ldx3=10|ldy3=10

| label-pos3 = bottom

|mark-size3=14|shape3=n-square

|mark-title3=A square

|label4x = area across date line

|mark-lat4= 40

|mark-lon4=179.9 | dateline4=0

|label-size4x=13,outline,background|ldx4=10|ldy4=10

| label-pos4 = bottom

|mark-size4=14|shape4=n-square

|mark-title4=A square

|label5=Sidney|mark-coord5={{coord|-33.867778|151.21}} |dateline5=0

|label6 = San Fran'

|mark-lat6= 37.7775

|mark-lon6= -122.416389 | dateline6=1

|label-size6=13

| label-pos6 = right,mark-line,2,dashed

|mark-size6=14|shape6=n-square

|mark-title6=San Fran

}}

Try with mark coords to confirm new logic not working for marks more complex than labels

{{testcase table

|_template=OSM Location map

|coord={{coord|0|-180}} |zoom=1 |float=left|width=400 |height=200 |mark-sizeD=10

|label=Vancouver |mark-coord={{coord|49.25|-123.1}} |label1=Manila |mark-coord1={{coord|14.5958|120.9772}}

| dateline1=-1

|label3x = area across date line

|mark-coord3={{coord|49|-179.9}}

|label-size3=13,outline,background|ldx3=10|ldy3=10

| label-pos3 = bottom,n-line

|mark-size3=14|shape3=n-square

|mark-title3=A square

|label4 = area across date line

|mark-coord4={{coord|40|179.9}}

| dateline4=-1

|label-size4=13,outline,background|ldx4=10|ldy4=10

| label-pos4 = bottom,n-line

|mark-size4=14|shape4=n-square

|mark-title4=A square

|label5=5. Sidney |mark-coord5={{coord|-33.867778|151.21}} |dateline5=-1|label-pos5=right

|label6 = Another area across date line

|mark-coord6={{coord|-10|159.9}} | dateline6=-1

|label-size6=13,outline,background|ldx6=10|ldy6=17

| label-pos6 = right,n-line

|mark-size6=100,5|shape6=n-box

|mark-title6=Another box

}}

First draft at instructions

{{testcase table

|_template=OSM Location map

|coord={{coord|0|160}} |zoom=1 |float=left|width=400 |height=210 |mark-sizeD=10

|label1=Map ^centre ^(0,160) |mark-coord1={{coord|0|160}}

|label-pos1=bottom| dateline1=0

| mark-lat2=0

| mark-lon2=-150|dateline2=1

|label-pos2=right|ldx2=4|ldy2=8

|label2=If map centre has ^positive Longitude ^(as here), any ^negative-lon marks ^(such as this one ^at 0,-150) ^need to set^ dateline=1.

|label3 = Longitude^100   120   140   160   180  -160  -140  -120  -100

|mark-coord3={{coord|49|-179.9}}|ldy3=4 |dateline3=1

|label-size3=11

|label-pos3 = center

|mark-size3=240|shape3=rule|shape-outline3=hard grey,1

| mark-lat4=0

| mark-lon4=130

|label-pos4=left

|label4=If map centre has a ^negative Longitude, ^positive-lon marks ^(such as this one ^at 0,130) ^would need to set^ dateline=-1.

|mark-coord5={{coord|0|86}} |dateline5=0

|mark-size5=115,110|shape5=box|shape-outline5=hard brown,1| shape-color5=pale brown,70

|mark-coord6={{coord|0|-105}} |dateline6=1

|mark-size6=110,110|shape6=box|shape-outline6=hard brown,1| shape-color6=pale brown,70

|label7 = Eastern Hemisphere         Western Hemisphere

|mark-coord7={{coord|60|-179.9}}|dateline7=1|label-color7=hard grey,70

|caption=Coping with marks both sides of the dateline (180th meridian):

The line of longitude that is both plus and minus 180° can be seen as a feint blue line through the Pacific on this map. It divides the Eastern and Western hemispheres.

The 'map centre' longitude selects which hemisphere is the main one for any mark coordinates. Any marks in that hemisphere need no further clarification.

However, to show a mark in the 'other' hemisphere, use the 'dateline=' parameter, otherwise it will end up in the 'wrong' direction relative to your map centre. Set it to -1 for positive (western hemisphere) longitude marks and to 1 for negative (eastern hemisphere) longitude marks, if the map centre is in the 'other' hemisphere.

nb. There is no such problem on the Prime meridian. Marks either side of 0° longitude work as expected without any need for dateline to be set.

}}