I have used a WKT field to identify a LINESTRING from LA to Hong Kong to Bangkok as a plane would fly (Over the Pacific Ocean, rather than across North America, the Atlantic, and all of Eurasia). To accomplish this I specified longitudes for Hong Kong and Bangkok as WEST of zero. That is, I placed Hong Kong at "-245.84111" rather than "114.15888".

The LINESTRING is drawn as expected, across the Pacific. BUT ONLY IF the map is being viewed with its center line WEST OF ZERO DEGREES. Dragging the map so that it is centered East of zero redraws the line way over to the West.

The attached image illustrates the problem.

I realize that specifying longitudes greater than 180 or less than -180 is a bit hacky. One workaround for this problem is to add a second field with a similar LINESTRING, with LA "hacked" in the same way as Hong Kong and Bangkok in the example above (i.e. Place LA at "241.75" instead of "-118.25"). Then two LINESTRINGs could be drawn - one "West-based" and one "East-based".

Can anyone else offer a solution to this?

CommentFileSizeAuthor
OpenLayers Map Is Flat Not Circular2.png180.33 KBnerdcore
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zzolo’s picture

Status: Active » Postponed (maintainer needs more info)

Hey @nerdcore, are there any JS errors? This is a hard one to debug and probably little to do with this module and more with the OpenLayers library.

mgifford’s picture

This looks like an OpenLayers core issue & not OpenLayers module issue.

http://gis.stackexchange.com/questions/22384/view-markers-on-both-sides-...

nerdcore’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)