OpenLayers , MapGuide , GoogleMap together

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenLayers , MapGuide , GoogleMap together

ElbrusNT
Hi everyone.

This is my OpenLayers code for show google maps with mapguide maps.
But when I zoom in  mapguide map visible in white background for    useOverlay: false
and  pink background for     useOverlay: true

var url = "http://localhost:8008/geoweb/mapagent/mapagent.fcgi?USERNAME=Anonymous";

    var params = {
      mapdefinition: 'Library://Maps/Map.MapDefinition',
      mapName: '<?php echo $mapName;?>',
      transparent: 'true',
      format: 'png',
      behavior: 7
    };
   
    var options = {
        isBaseLayer: false,
        transitionEffect: "resize",
        buffer: 1,
        useOverlay: false,
        useAsyncOverlay: false,
        singleTile: true,
        visibility : true,
        transparent: true,
        maxResolution: 'auto',
        numZoomLevels: 20,
        sphericalMercator: true,
        displayOutsideMaxExtent: true
    };

var google_sat = new OpenLayers.Layer.Google(
        'Google Satellite',
        {type: google.maps.MapTypeId.SATELLITE}
    );

    var layer = new OpenLayers.Layer.MapGuide( "MapGuide OS tiled layer", url, params, options );

    map.addLayers([google_sat,layer]);


I want show transparent mapguide layers  with google maps the background.
Please help me.
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers , MapGuide , GoogleMap together

Jackie Ng
Firstly, your Map Definition must be in WGS84.PseudoMercator

Secondly, you need to do some modifications to OpenLayers.INCHES_PER_UNIT based on the meters-per-unit value of the Map Definition's coordinate system.

The meters-per-unit is the result of MgCoordinateSystem.ConvertCoordinateSystemUnitsToMeters(1.0)

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers , MapGuide , GoogleMap together

ElbrusNT
My Map Definition in WGS84.PseudoMercator.

and

var metersPerUnit = 1;
var inPerUnit = OpenLayers.INCHES_PER_UNIT.m * metersPerUnit;
OpenLayers.INCHES_PER_UNIT["dd"] = inPerUnit;
OpenLayers.INCHES_PER_UNIT["degrees"] = inPerUnit;
OpenLayers.DOTS_PER_INCH = 96;

Please look this two photo.
I want  transparent image,  (without  white background) .

this is  with no mapguide check<br />

<br />
If  I  check  the MapGuide Map then it show me this one<br />


Thanks. Mr. Jackie Ng.
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers , MapGuide , GoogleMap together

GordonL
I think the mapagent defaults to version 1,

try adding the version:

var url = "http://localhost:8008/geoweb/mapagent/mapagent.fcgi?VERSION=2.0.0&USERNAME=Anonymous";

Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers , MapGuide , GoogleMap together

ElbrusNT
Thanks for you reply Mr.
But this example did not help me.

I think I am wrong somewhere.
I want to know how the MapGuide Transparent  Layer and Map.
I want transparent 2-nd image for show  pipeline  on the  Google Map.
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers , MapGuide , GoogleMap together

Jackie Ng
You should check in your browser developer tools to see if OpenLayers is firing off GETMAPIMAGE requests or GETDYNAMICMAPOVERLAYIMAGE requests.

GETMAPIMAGE requests will be opaque. GETDYNAMICMAPOVERLAYIMAGE requests will not.

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers , MapGuide , GoogleMap together

ElbrusNT
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers , MapGuide , GoogleMap together

ElbrusNT
Ok Guys.
I am solved the problem.

I had to set the backgroundcolor  of map to the  minimum for transparent.

Thanks  for all.