Re: [OpenLayers-Users] PROBLEM GOOGLE + WMS
LAST SOLUTION openlayermap = new OpenLayers.Map('openlayermap'); var ghyb = new OpenLayers.Layer.Google("Google Hybrid",{type: G_HYBRID_MAP, numZoomLevels: 20 , 'sphericalMercator': false}); var wms = new OpenLayers.Layer.WMS.Untiled("MYWMSLAYER"," http://89.188.137.83/mapguide/mapagent/mapagent.fcgi";, {transparent: 'TRUE', layers: 'Orbassano/Layers/Catasto Edifici' }); //,projection : new OpenLayers.Projection('epsg:4326') //first solution do not launch originale redraw. //wms.redraw = function() {return;}; //second solution use map bounds instead layer function calculateBounds. I think its better wms.getExtent = function() {return this.map.getExtent();}; //this.map.calculateBounds() get wrong values... openlayermap.addLayers([ghyb,wms]); var layswitchcontrol = new OpenLayers.Control.LayerSwitcher(); openlayermap.addControl(layswitchcontrol); openlayermap.setCenter(new OpenLayers.LonLat(xcent,ycent), 16); 2010/4/6 Alessandro Gorreta > I'm trying to do a sample thing. Put a google layer with a WMS layer from > mapguide server. > All works fine when I show viewer the first time, but when a redraw all WMS > layer is placed wrong. > If I omit singlelayer also is WRONG. > Some IDEAS ??? > > function openlayerinit(xcent,ycent) > { > openlayermap = new OpenLayers.Map('openlayermap'); > var ghyb = new OpenLayers.Layer.Google("Google Hybrid",{type: > G_HYBRID_MAP, numZoomLevels: 20 , 'sphericalMercator': false}); > var wms = new OpenLayers.Layer.WMS("MYWMSLAYER"," > http:///mapguide/mapagent/mapagent.fcgi";, {transparent: 'TRUE', > layers: 'Orbassano/Layers/Catasto Edifici' , version: '1.1.1' } , > {singleTile: true} ); > openlayermap.addLayers([ghyb,wms]); > var layswitchcontrol = new OpenLayers.Control.LayerSwitcher(); > openlayermap.addControl(layswitchcontrol); > openlayermap.setCenter(new OpenLayers.LonLat(xcent,ycent), 16); > > } > > THANKS > ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] PROBLEM GOOGLE + WMS
FOUND A STUPID SOLUTION I've noticed the problem is extent recalculation in redraw function. So this works temporary for me , but is strange because redraw in singletiled / untiled layers behaviour is like a normal layer. WHY SOME IDEAS ??? openlayermap = new OpenLayers.Map('openlayermap'); var ghyb = new OpenLayers.Layer.Google("Google Hybrid",{type: G_HYBRID_MAP, numZoomLevels: 20 , 'sphericalMercator': false}); var wms = new OpenLayers.Layer.WMS.Untiled("MYWMSLAYER"," http://89.188.137.83/mapguide/mapagent/mapagent.fcgi";, {transparent: 'TRUE', layers: 'Orbassano/Layers/Catasto Edifici' ,projection : new OpenLayers.Projection('epsg:4326') }); *wms.redraw = function() {return;};* openlayermap.addLayers([ghyb,wms]); var layswitchcontrol = new OpenLayers.Control.LayerSwitcher(); openlayermap.addControl(layswitchcontrol); openlayermap.setCenter(new OpenLayers.LonLat(xcent,ycent), 16); THANKS.. 2010/4/6 Alexandre Dube > Hi, > > Have you tried with 'sphericalMercator': true ? > > Alexandre > > > Alessandro Gorreta wrote: > >> I'm trying to do a sample thing. Put a google layer with a WMS layer from >> mapguide server. >> All works fine when I show viewer the first time, but when a redraw all >> WMS layer is placed wrong. >> If I omit singlelayer also is WRONG. >> Some IDEAS ??? >> >> function openlayerinit(xcent,ycent) >> { >>openlayermap = new OpenLayers.Map('openlayermap'); >>var ghyb = new OpenLayers.Layer.Google("Google Hybrid",{type: >> G_HYBRID_MAP, numZoomLevels: 20 , 'sphericalMercator': false}); >>var wms = new OpenLayers.Layer.WMS("MYWMSLAYER"," >> http:///mapguide/mapagent/mapagent.fcgi";, {transparent: 'TRUE', >> layers: 'Orbassano/Layers/Catasto Edifici' , version: '1.1.1' } , >> {singleTile: true} ); >>openlayermap.addLayers([ghyb,wms]); >>var layswitchcontrol = new OpenLayers.Control.LayerSwitcher(); >>openlayermap.addControl(layswitchcontrol); >>openlayermap.setCenter(new OpenLayers.LonLat(xcent,ycent), 16); >> } >> >> THANKS >> >> >> ___ >> Users mailing list >> Users@openlayers.org >> http://openlayers.org/mailman/listinfo/users >> >> > > > -- > Alexandre Dubé > Mapgears > www.mapgears.com > > ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] PROBLEM GOOGLE + WMS
yes, but with 'sphericalMercator': true I do not see my WMS layer.. 2010/4/6 Alexandre Dube > Hi, > > Have you tried with 'sphericalMercator': true ? > > Alexandre > > > Alessandro Gorreta wrote: > >> I'm trying to do a sample thing. Put a google layer with a WMS layer from >> mapguide server. >> All works fine when I show viewer the first time, but when a redraw all >> WMS layer is placed wrong. >> If I omit singlelayer also is WRONG. >> Some IDEAS ??? >> >> function openlayerinit(xcent,ycent) >> { >>openlayermap = new OpenLayers.Map('openlayermap'); >>var ghyb = new OpenLayers.Layer.Google("Google Hybrid",{type: >> G_HYBRID_MAP, numZoomLevels: 20 , 'sphericalMercator': false}); >>var wms = new OpenLayers.Layer.WMS("MYWMSLAYER"," >> http:///mapguide/mapagent/mapagent.fcgi";, {transparent: 'TRUE', >> layers: 'Orbassano/Layers/Catasto Edifici' , version: '1.1.1' } , >> {singleTile: true} ); >>openlayermap.addLayers([ghyb,wms]); >>var layswitchcontrol = new OpenLayers.Control.LayerSwitcher(); >>openlayermap.addControl(layswitchcontrol); >>openlayermap.setCenter(new OpenLayers.LonLat(xcent,ycent), 16); >> } >> >> THANKS >> >> >> ___ >> Users mailing list >> Users@openlayers.org >> http://openlayers.org/mailman/listinfo/users >> >> > > > -- > Alexandre Dubé > Mapgears > www.mapgears.com > > ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] PROBLEM GOOGLE + WMS
Hi, Have you tried with 'sphericalMercator': true ? Alexandre Alessandro Gorreta wrote: > I'm trying to do a sample thing. Put a google layer with a WMS layer > from mapguide server. > All works fine when I show viewer the first time, but when a redraw > all WMS layer is placed wrong. > If I omit singlelayer also is WRONG. > Some IDEAS ??? > > function openlayerinit(xcent,ycent) > { > openlayermap = new OpenLayers.Map('openlayermap'); > var ghyb = new OpenLayers.Layer.Google("Google Hybrid",{type: > G_HYBRID_MAP, numZoomLevels: 20 , 'sphericalMercator': false}); > var wms = new > OpenLayers.Layer.WMS("MYWMSLAYER","http:///mapguide/mapagent/mapagent.fcgi";, > > {transparent: 'TRUE', layers: 'Orbassano/Layers/Catasto Edifici' , > version: '1.1.1' } , {singleTile: true} ); > openlayermap.addLayers([ghyb,wms]); > var layswitchcontrol = new OpenLayers.Control.LayerSwitcher(); > openlayermap.addControl(layswitchcontrol); > openlayermap.setCenter(new OpenLayers.LonLat(xcent,ycent), 16); > > } > > THANKS > > > ___ > Users mailing list > Users@openlayers.org > http://openlayers.org/mailman/listinfo/users > -- Alexandre Dubé Mapgears www.mapgears.com ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
[OpenLayers-Users] PROBLEM GOOGLE + WMS
I'm trying to do a sample thing. Put a google layer with a WMS layer from mapguide server. All works fine when I show viewer the first time, but when a redraw all WMS layer is placed wrong. If I omit singlelayer also is WRONG. Some IDEAS ??? function openlayerinit(xcent,ycent) { openlayermap = new OpenLayers.Map('openlayermap'); var ghyb = new OpenLayers.Layer.Google("Google Hybrid",{type: G_HYBRID_MAP, numZoomLevels: 20 , 'sphericalMercator': false}); var wms = new OpenLayers.Layer.WMS("MYWMSLAYER"," http:///mapguide/mapagent/mapagent.fcgi";, {transparent: 'TRUE', layers: 'Orbassano/Layers/Catasto Edifici' , version: '1.1.1' } , {singleTile: true} ); openlayermap.addLayers([ghyb,wms]); var layswitchcontrol = new OpenLayers.Control.LayerSwitcher(); openlayermap.addControl(layswitchcontrol); openlayermap.setCenter(new OpenLayers.LonLat(xcent,ycent), 16); } THANKS ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users