Opened 14 years ago

Closed 14 years ago

#367 closed defect (fixed)

MapMenu: warning message is pop-up when reloading the MapGroup with commercial layers.

Reported by: liuar Owned by: madair
Priority: P2 Milestone: 2.0
Component: Widgets Version: 2.0 - beta
Severity: Major Keywords:
Cc: jennyhe Browser: All
External ID: 1272713 Operating System: All
state: New

Description

  1. Create a flexible web layout with commercial layers
  2. Click the MapWidget and select current map group


Result: One message is pop-up.

Attachments (1)

MapMenu.patch (841 bytes ) - added by liuar 14 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by liuar, 14 years ago

[Analysis]
In MapMenu.js

var dest = new OpenLayers.Projection(data.maps[0].projCode);
ce = ce.transform(this.oMap.oMapOL.baseLayer.projection, dest);

but the layer's projCode implementation in openlayers.js used in Fusion makes the projCode always be EPSG:4326. so the transformation might be invalid, and the calculated extent might not make any sense.

[Workaround]

        if(data.maps[0].layerOptions.projection)
        {
            var dest = new OpenLayers.Projection(data.maps[0].layerOptions.projection);
            ce = ce.transform(this.oMap.oMapOL.baseLayer.projection,dest);
        }
}}}[[BR]]

we will transform the coordinate system only if the layer contians the projection info. Fo the other layers, just keep the original behavior.

by liuar, 14 years ago

Attachment: MapMenu.patch added

comment:2 by madair, 14 years ago

in general this patch is ok but isn't it better to check 'data.maps[0].projCode' for a projection code rather than data.maps[0].layerOptions.projection? How are you defining the map object in the AppDef?

comment:3 by liuar, 14 years ago

All my layer's projCode is Epsg:4326, no matter which coordinate system assigned to the map. That's why I have to get the layerOptions.projection value.

This is a sample of map group with one map in AppDef,

<MapGroupType id="Sheboygan">
    <Map>
      <Type>MapGuide</Type>
      <SingleTile>true</SingleTile>
      <Extension>
        <ResourceId>Library://DID 1272737 Theme with commercial layer/Sheboygan.MapDefinition</ResourceId>
        <SelectionAsOverlay>true</SelectionAsOverlay>
        <SelectionColor>0x0000FFA0</SelectionColor>
      </Extension>
    </Map>
    <Extension />
  </MapGroupType>

comment:4 by madair, 14 years ago

Resolution: fixed
Status: newclosed

fixed at rev 2098 as part of #315

Note: See TracTickets for help on using tickets.