Loading multiple contexts

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Loading multiple contexts

dnbphysicist
Is it possible to load multiple contexts, one being WMC and the other OWS? I want to use my existing WMC context but replace Demis with a base layer of Google maps. Is there a better way to do this?

Thanks! 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mapbuilder-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users
Reply | Threaded
Open this post in threaded view
|

Re: Loading multiple contexts

Andreas Hocevar-2
Hi,

On Tue, Dec 2, 2008 at 8:11 PM, Robert Hicks <[hidden email]> wrote:
> Is it possible to load multiple contexts, one being WMC and the other OWS? I
> want to use my existing WMC context but replace Demis with a base layer of
> Google maps. Is there a better way to do this?

I assume you are asking if it is possible to load multiple contexts
for one map. Unfortunately not.

Replacing Demis with GMaps does not only require exchanging a layer,
but also switching to a different projection (EPSG:900913).

If, however, you are familiar with JavaScript, you can register a
listener for the context's loadModel event, and replace the base layer
(config.objects.mainMap.map.baseLayer) with a Google layer. In that
case you would just remove the demis layer from your context.

Regards,
Andreas.

--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mapbuilder-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users
Reply | Threaded
Open this post in threaded view
|

Re: Loading multiple contexts

dnbphysicist
Thanks a lot Andreas, I tried "hacking" in a new OpenLayers.Layer.Google(); as the default base map in the MapPaneOL file, and it loaded fine until we upgraded MapBuilder/OpenLayers now it gives me a JS error saying: 

objRef.model.map.getExtent() has no properties
Line 527

I also tried putting in these options:

     var baseLayerOptions = {
      
              units: units,
              projection: proj.srsCode,
              maxExtent: maxExtent,
              maxResolution: maxResolution,  //"auto" if not defined in the context
              minResolution: minResolution,
              resolutions: resolutions,
              alpha: false,            //option for png transparency with ie6
              isBaseLayer: true,
              displayOutsideMaxExtent: objRef.displayOutsideMaxExtent,
              ratio: 1,
              singleTile: true,
              transitionEffect: objRef.transitionEffect,
              visibility: false,
              //moveTo: function(){return true}
              minScale: 50000000,
              maxScale: 1,
              numZoomLevels: 20
         };

What I am trying to do is use my standard WMC context with a Google base map, and this worked in the previous version of MB and OL (In Firefox), does anyone have experience with doing this or is it even possible?

Thanks in advance!

On Wed, Dec 3, 2008 at 11:29 AM, Andreas Hocevar <[hidden email]> wrote:
Hi,

On Tue, Dec 2, 2008 at 8:11 PM, Robert Hicks <[hidden email]> wrote:
> Is it possible to load multiple contexts, one being WMC and the other OWS? I
> want to use my existing WMC context but replace Demis with a base layer of
> Google maps. Is there a better way to do this?

I assume you are asking if it is possible to load multiple contexts
for one map. Unfortunately not.

Replacing Demis with GMaps does not only require exchanging a layer,
but also switching to a different projection (EPSG:900913).

If, however, you are familiar with JavaScript, you can register a
listener for the context's loadModel event, and replace the base layer
(config.objects.mainMap.map.baseLayer) with a Google layer. In that
case you would just remove the demis layer from your context.

Regards,
Andreas.

--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Mapbuilder-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users