Opened 15 years ago

Closed 15 years ago

#271 closed enhancement (fixed)

MapGuide BasemapSwitcher Wigdet for commercial map services

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

Description

Currently, fusion support Google, Yahoo and Virtual Earth services as basemaps shown behind overlayed MapGuide layers. However there's no proper widget to switch basemaps. That means there's no way for end-user to change the basemaps. This widget will help end-user to control the commercial base maps(turn on/off commercial basemaps or switch the basemaps).

Attachments (2)

BasemapSwitcher.patch (12.2 KB ) - added by liuar 15 years ago.
BasemapSwitcher2.patch (12.6 KB ) - added by liuar 15 years ago.

Download all attachments as: .zip

Change History (6)

by liuar, 15 years ago

Attachment: BasemapSwitcher.patch added

comment:1 by zjames, 15 years ago

Owner: changed from liuar to zjames
state: NewReview
Status: newassigned

Good idea! I'm testing this now. There seems to be some problems introduced in the legend when switching back and forth.

comment:2 by zjames, 15 years ago

Owner: changed from zjames to liuar
Status: assignednew

The problem is that if you switch to the 'None' option, the mapguide layer becomes the base layer (there has to be a base layer) and when you switch back to a commercial layer, it replaces the base layer. The switch function probably needs to reset isBaseLayer to true for the mapguide layer. A simpler fix would just be to remove the 'None' select option.

A more subtle issue is that the widget will cause js errors if the various commercial api keys are not present in the template because it relies on global variables being defined for the map types (e.g. G_NORMAL_MAP). The widget should have logic to deal with that condition.

Other than these issues, this works well.

comment:3 by liuar, 15 years ago

Much grateful for your comments and tests.

For the first problem, I think the method setBaseLayer(newBaseLayer) will update the visibility of previous baselayer to false. So, I added the code to keep the visibility of MapGuide layers. Thank you for point it out.

For the second problem, there's no commercial api used in this widget. The G_NORMAL_MAP in this widget is the MapType from the application definition.

I've attached the new patch, and please review it.

Thanks, Arthur

by liuar, 15 years ago

Attachment: BasemapSwitcher2.patch added

comment:4 by zjames, 15 years ago

Resolution: fixed
Status: newclosed

Arthur, I tested your latest patch and it resolves the 'None' switching problem so I'm going to commit this to trunk. Thanks for your work on this enhancement.

The map types aren't defined in this widget, as you pointed out, but making inclusion of a commercial layer the default does invoke code in generic.js that requires the service map variable to be available. That condition should probably be trapped in generic,js itself, however, so that will be a separate ticket.

Committed in [1888]

Note: See TracTickets for help on using tickets.