[OpenLayers-Users] Google Layer example

ashley_c_mort ashley_c_mort at raytheon.com
Thu Aug 20 07:47:35 EDT 2009


All,
    I found the answer to my original question and have another question.  I
attached sample code of how we obtained the Google Fusion Server layers.
 
   The Google map/fusion sever here has 3 layers:
1) ImageryMaps1
2) VectorMapsRaster1 
3) VectorMapsRaster2 

    Looking at fusionmapobj.js on the server, the vector layers get added to
the GFusionMap object but it looks like it's  erroring out if I try to do a
showInitialFusionLayers() call as I don't think it can find that method
(which should reside in the .js on the Google server).  
     Any ideas on how to get the our VectorMapsRaster to show up on our
GFusionMap?  The ImageryMaps1 layer shows up and the other 2 layers are in
there but the showInitialFusionLayers method seems to die on
this.addOverlay(...) (GFusionMap.showInitialFusionLayers resides in
fusionmapobj.js on the Google server)


SOLUTION TO ORIGINAL QUESTION
- modify Layer/Google.js and put this code at the top of loadMapObject()
[note that we seem to need to use GFusionMap instead of GMap2 to get
anything to show up from our server]

this.mapObject = new GFusionMap( this.div );
var layerz=this.mapObject.map_layers;

for(var x=0;x<layerz.length;x++)
{
	alert("google.js fusion layers "+layerz[x].txt);
}
this.mapObject.showInitialFusionLayers();  //this line doesn't work

-----Original Message-----
From: Christopher Schmidt [mailto:crschmidt at metacarta.com] 
Sent: Tuesday, August 18, 2009 12:34 PM
To: ashley_c_mort
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] Google Layer example

On Tue, Aug 18, 2009 at 02:22:53AM -0400, ashley_c_mort wrote:
>     Does anyone know how you can determine all the layers available on 
> a Google server?  We are trying to hook up to a Google server but the 
> layers available are not known and are more numerous than the defaults 
> below.  How can we determine all of the available layer names from a
Google box?
> Thanks!

I'm assuming that you're using some kind of Fusion server; In my experiences
with Fusion, I have not solved this problem. Your best bet may be to discuss
this in a Fusion-specific forum, rather than OL, since OL doesn't provide
that type of API to the Fusion data.

-- Chris 

>  
>  
> map = new OpenLayers.Map('map');
> 
>             map.addControl(new OpenLayers.Control.LayerSwitcher());
> 
>             
> 
>             var gphy = new OpenLayers.Layer.Google(
> 
>                 "Google Physical",
> 
>                 {type: G_PHYSICAL_MAP}
> 
>             );
> 
>             var gmap = new OpenLayers.Layer.Google(
> 
>                 "Google Streets", // the default
> 
>                 {numZoomLevels: 20}
> 
>             );
> 
>             var ghyb = new OpenLayers.Layer.Google(
> 
>                 "Google Hybrid",
> 
>                 {type: G_HYBRID_MAP, numZoomLevels: 20}
> 
>             );
> 
>             var gsat = new OpenLayers.Layer.Google(
> 
>                 "Google Satellite",
> 
>                 {type: G_SATELLITE_MAP, numZoomLevels: 20}
> 
>             );
> 
> 
> 
> 
> 
>             map.addLayers([gphy, gmap, ghyb, gsat]);

> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


--
Christopher Schmidt
MetaCarta

The following line is added for your protection and will be used for
analysis if this message is reported as spam:

(Raytheon Analysis: IP=208.80.142.18; e-from=crschmidt at metacarta.com;
from=crschmidt at metacarta.com; date=Aug 18, 2009 4:34:23 PM; subject=Re:
[OpenLayers-Users] Google Layer example)





More information about the Users mailing list