Ticket #367 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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 External ID: 1272713
state: New Browser: All
Operating System: All

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

MapMenu.patch Download (0.8 KB) - added by liuar 3 years ago.

Change History

Changed 3 years ago by liuar

[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.

Changed 3 years ago by liuar

Changed 3 years ago by madair

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??

Changed 3 years ago by liuar

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>

Changed 3 years ago by madair

  • status changed from new to closed
  • resolution set to fixed

fixed at rev 2098 as part of #315

Note: See TracTickets for help on using tickets.