Ticket #310 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Flexible weblayout unit doesn't consistent with its map.

Reported by: liuar Owned by: madair
Priority: P1 Milestone: 2.0
Component: MapGuide Version: 1.1.1
Severity: Major Keywords:
Cc: External ID: 1267676
state: New Browser: All
Operating System: All

Description

1. Create a Flexble weblayout with map which unit is meter. 2. View it in browser, click the "Options" widget, the unit is degrees. 3. The initial view of the map is not correct either.

Attachments

UnknownProjectionPatchTrunk.patch Download (5.1 KB) - added by chrisclaydon 3 years ago.
UnknownProjectionPatch2.2gp.patch Download (5.1 KB) - added by chrisclaydon 3 years ago.

Change History

Changed 4 years ago by liuar

  • priority changed from P2 to P1

In Openlayers.js

Line 10856: if (window.Proj4js) {

this.proj = new Proj4js.Proj(projCode);

} If proj4js included, the projection will be initialized.

Line 20817:

this.units = this.projection.getUnits() this.units this.map.units; If the projection has units, the layer’s unit will be the projection’s unit rather than map’s unit. However, for openlayers maps, the default coordinate system is always EPSG:4326, so the units will always be degrees.

In Map.js

Line 918: getUnits: function() {

return this.oMapOL.baseLayer.units;

},

The map’s units is its baselayer’s units, so the OptionView? widget will get the degrees as unit and the initial view of non-degrees map will not be shown correctly.

Changed 4 years ago by liuar

This is the ticket which introduce the proj4js. http://trac.osgeo.org/fusion/changeset/1914

Changed 4 years ago by chrisclaydon

Temporarily reverted the change that causes this problem:

http://trac.osgeo.org/fusion/changeset/1960

DM Solns is aware of the issue and will add the Proj4js reference back into the build when the projection/units/MG compatibility issues have been resolved.

Changed 3 years ago by madair

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from Future to 2.0

this was fixed as part of some other tickets, changesets [2066] and [2077].

For maps that aren't in EPSG:4326, the projection must be specified for widgets that depend on the correct units (e.g. measure). For MapGuide, this is sometimes returned in the LoadMap? response, but not always in which case it must be listed in the APpDef

Changed 3 years ago by chrisclaydon

Recent changes to the MapGuide code improve the number of MG coordinate systems that can be used in the map that will result in an EPSG code being returned. However, not all systems will return a code, and some don't even have a corresponding code. In such cases, using a default LL/WGS84 system (as is currently the case) is not appropriate since it may be wildly different from the actual system, and may use different units, resulting in scale calculation problems.

This can be resolved by setting the projection code in MapGuide.js to a special value, "UNKNOWN" and then bypassing coordinate system initialization in OpenLayers.Projection for this code. This essentially makes everything behave as it did before Proj4js.js was linked in to the project.

Changed 3 years ago by chrisclaydon

Changed 3 years ago by chrisclaydon

Changed 3 years ago by chrisclaydon

Please review the attached patches (changes are identical in both) that implement the change described above.

Changed 3 years ago by chrisclaydon

Submitted patch to 2.2gp branch:

http://trac.osgeo.org/fusion/changeset/2151

Note: See TracTickets for help on using tickets.