[GeoNetwork-users] Conect google layers in mainmap

Hi there,

I'm working in conect google layers in my GN as a layers in mainmap. I
checked basically ol_map.js and config-gui.xml files to try to configure it.
In config-gui.xml I added:

/<mapViewer options="{projection: 'EPSG:4326', maxExtent: new
OpenLayers.Bounds(-180,-90,180,90), units: 'degrees', restrictedExtent: new
OpenLayers.Bounds(-180,-90,180,90)}">
  <layers>
    <layer server="http://data.fao.org/geo/wms?&quot; tocName="Sat│lᄋlit"
params="{layers: 'COMMON:dark_bluemarble', format: 'image/png'}"
options="{isBaseLayer: true}" />
    <layer server="http://129.206.228.72/cached/osm?&quot; tocName="Pol■tic"
params="{layers: 'osm_auto:all', format: 'image/png'}"
options="{isBaseLayer: true}" />
  <layer server="http://geonetwork3.fao.org/ows/14074?&quot; tocName="Plantilla"
params="{layers: 'Country Boundaries', format: 'image/png'}"
options="{isBaseLayer: true}" />/
  *<googleLayer server="google" tocName="Google Satellite"
type="G_SATELLITE_MAP" defaultLayer="true" />*
  /</layers>/

and in ol_map.js I added these two paragraphs of code as it here
http://131.220.109.2/geonetwork/scripts/ol_map.js

/for (var i=0; i<layers.length; i++) {
               
createWmsLayer(layers[i][0],layers[i][1],layers[i][2],layers[i][3]);
            }
             for (var i=0; i&lt;layers.length; i++) {
                    if(layers[i][1] == &quot;google&quot;){
                      
createGoogleLayer(layers[i][0],layers[i][1],layers[i][2],layers[i][3]);
        }
        else{
                  
createWmsLayer(layers[i][0],layers[i][1],layers[i][2],layers[i][3]);
        }
      }

      addPositionControl();&lt;/i>

/var createGoogleLayer = function(name,url,type,defaultLayer) {
    var tempLayer = "";
    if(type=="G_HYBRID_MAP"){
      tempLayer=new OpenLayers.Layer.Google(name,{type:G_HYBRID_MAP,
'sphericalMercator': true, wrapDateLine: true});
    }
    if(type=="G_SATELLITE_MAP"){
      tempLayer=new OpenLayers.Layer.Google(name,{type:G_SATELLITE_MAP,
'sphericalMercator': true, wrapDateLine: true});
    }
    if(type=="G_NORMAL_MAP"){
      tempLayer=new OpenLayers.Layer.Google(name,{type:G_NORMAL_MAP,
'sphericalMercator': true, wrapDateLine: true});
    }
    if(type=="G_PHYSICAL_MAP"){
      tempLayer=new OpenLayers.Layer.Google(name,{type:G_PHYSICAL_MAP,
'sphericalMercator': true, wrapDateLine: true});
    }
    
    if(tempLayer != ""){
      map.addLayer(tempLayer);
      if(defaultLayer){
        map.setBaseLayer(tempLayer);
      }
    }
  };/

I forgot something??
Please help

Víctor

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Please any idea???

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016285.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Hi

One thing that for sure you need is to create the minified version of
ol_map.js,
for this you need to download source code for the version you're using
(2.6.4?), replace ol_map.js with yours and execute inside web folder: mvn
install This minifies all js files. The file you're interested
is web/src/main/webapp/scripts/lib/gn.libs.map.js.

Maybe before doing this, you can test unminified version for ol_map.js,
using this URL: http://localhost:8080/geonetwork/srv/en/main.home?debug=true

This should load the unminified version of js code and can help to debug
any error.

Regards,
Jose García

On Wed, Nov 14, 2012 at 3:46 PM, Vaictor
<victor.fernandez.gayan@anonymised.com>wrote:

Please any idea???

--
View this message in context:
http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016285.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--
*
GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on
GeoServer and GeoNetwork. Visit http://geocat.net for details.
_________________________
Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net/&gt;

*

Hi Victor,

you may have forgotten to change the file /xsl/geo/utils.xsl. In
config-gui.xml I´ve introduced a new category "googleLayer". Due to the fact
that the content of config-gui.xml is written into a Javascript-array within
utils.xsl you have to tell geonetwork how it should handle the
"googleLayer"-category.

In utils.xsl you´ll find a section with this content:
/<xsl:for-each select="/root/gui/config/mapViewer/layers/layer">
backgroundLayers.push(["<xsl:value-of select='@tocName'/>","<xsl:value-of
select='@server'/>",<xsl:value-of select='@params'/>, <xsl:value-of
select='@options'/>]);
</xsl:for-each>/
This is responsible for saving the "normal" WMS-layers in the
backgroundlayers-array.

Following the same pattern you need to add this snippet afterwards:
/<xsl:for-each select="/root/gui/config/mapViewer/layers/googleLayer">
backgroundLayers.push(["<xsl:value-of select='@tocName'/>","<xsl:value-of
select='@server'/>","<xsl:value-of select='@type'/>",<xsl:value-of
select='@defaultLayer'/>]);
</xsl:for-each>/
This creates an entry for every google-Layer in the backgroundLayers-array.

Thereafter this array is read in ol_map.js and the google-layers are
created.

Best regards,
Max Stephan

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016515.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

P.S.: You find a more detailed explanation in an earlier post of mine here:
http://osgeo-org.1560.n6.nabble.com/Geoserver-Google-Maps-integration-tp3860447p3860448.html

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016518.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Hi Victor,

First: Please always send your replies to the mailinglist as well cause only then other users can benefit from them.

Regarding your problem: As described in the link to my olderpost it also might be necessary to alter main-page.xsl so that the coordinates get transformed. But that shouldn´t be the cause for the page not to load I guess. Please use a developer-plugin within your browser to get a clue what might have gone wrong during the load-process (e.g. Firebug in Firefox, or the integrated developer-tools in IE or google Chrome). Those tools have a console that provide you with information on errors that possibly occurred. In addition the geonetwork-logfile might provide useful information.

Best,
Max

From: victor.fernandez.gayan@anonymised.com [mailto:victor.fernandez.gayan@anonymised.com…]
Sent: 15 November 2012 12:43
To: Max Stephan
Subject: Re: [GeoNetwork-users] Conect google layers in mainmap

Hi Max,

I've done exactly what you done. My files look like this now:

config-gui.xml

<mapViewer options="{projection: 'EPSG:4326', maxExtent: new OpenLayers.Bounds(-180,-90,180,90), units: 'degrees', restrictedExtent: new OpenLayers.Bounds(-180,-90,180,90)}">
  <layers>
    <layer server="http://data.fao.org/geo/wms?&quot; tocName="Satèl·lit" params="{layers: 'COMMON:dark_bluemarble', format: 'image/png'}" options="{isBaseLayer: true}" />
    <layer server="http://129.206.228.72/cached/osm?&quot; tocName="Polític" params="{layers: 'osm_auto:all', format: 'image/png'}" options="{isBaseLayer: true}" />
            <layer server="http://geonetwork3.fao.org/ows/14074?&quot; tocName="Plantilla" params="{layers: 'Country Boundaries', format: 'image/png'}" options="{isBaseLayer: true}" />
            <googleLayer server="google" tocName="Google Satellite" type="G_SATELLITE_MAP" defaultLayer="true" />
  </layers>
  <scales values="[7500000, 5000000, 2500000, 1000000, 750000, 500000, 250000, 100000, 75000, 50000, 25000, 10000, 7500, 5000, 2500, 1000]" />
  <!--scales values="" /-->
  <proj>
    <crs code="EPSG:4326" default="1" name="WGS84 (lat/lon)" />
  </proj>
  <servers>
    <server name="NASA JPL OneEarth Web Mapping Server (WMS)" url="http://wms.jpl.nasa.gov/wms.cgi?&quot; />
    <server name="NASA Earth Observations (NEO) WMS" url="http://neowms.sci.gsfc.nasa.gov/wms/wms?&quot; />
    <server name="DEMIS World Map Server" url="http://www2.demis.nl/mapserver/wms.asp?&quot; />
    <server name="Geoserver" url="http://localhost:8080/geoserver/wms?&quot; />
  </servers>
</mapViewer>

ol_map.js

Copy and paste from http://131.220.109.2/geonetwork/scripts/ol_map.js

utils.xsl

<script type="text/javascript" language="JavaScript1.2">
        // Load layers defined in config file
        var backgroundLayers = ;

        // Map viewer options to use in main map viewer and in editor map viewer
        var mapOptions = <xsl:value-of select='/root/gui/config/mapViewer/@options'/>;

        <xsl:for-each select="/root/gui/config/mapViewer/layers/layer">
        backgroundLayers.push(["<xsl:value-of select='@tocName'/>","<xsl:value-of select='@server'/>",<xsl:value-of select='@params'/>, <xsl:value-of select='@options'/>]);
        </xsl:for-each>

                        <xsl:for-each select="/root/gui/config/mapViewer/layers/googleLayer">
        backgroundLayers.push(["<xsl:value-of select='@tocName'/>","<xsl:value-of select='@server'/>",<xsl:value-of select='@type'/>,<xsl:value-of select='@defaultLayer'/>]);
        </xsl:for-each>

        var backgroundLayersMapSearch = ;
        <xsl:for-each select="/root/gui/config/mapSearch/layers/layer">
        backgroundLayersMapSearch.push(["<xsl:value-of select='@tocName'/>","<xsl:value-of select='@server'/>",<xsl:value-of select='@params'/>, <xsl:value-of select='@options'/>]);
        </xsl:for-each>

        // If no layers defined for search map, use the layers defined for map viewer
        if (backgroundLayersMapSearch.length == 0) backgroundLayersMapSearch = backgroundLayers;
        </script>

Here is everything I've done and when I test unmified version http://localhost:8080/geonetwork/srv/en/main.home?debug=true it doesn't load anything from GN, just the graphics from the header and nothing else. Anything wrong, something I miss???

Thanks for advance Max

2012/11/15 Max Stephan <max.stephan@anonymised.com<mailto:max.stephan@anonymised.com>>
P.S.: You find a more detailed explanation in an earlier post of mine here:
http://osgeo-org.1560.n6.nabble.com/Geoserver-Google-Maps-integration-tp3860447p3860448.html

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016518.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net<mailto:GeoNetwork-users@anonymised.comforge.net>
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Hi Max,

If I execute GN http://localhost:8080/geonetwork (picture main) it appears
my three layers duplicate, I don't know why. If I execute
http://localhost:8080/geonetwork/srv/en/main.home?debug=true nothing
appears, just the graphics from the header. (picture debug). I have Firebug
in Firefox but I don't know how to sse what happens. Any help will be
fantastic

Thanks
Victor

<http://osgeo-org.1560.n6.nabble.com/file/n5016611/debug.jpg&gt;
<http://osgeo-org.1560.n6.nabble.com/file/n5016611/main.jpg&gt;

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016611.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

I've done exactly what you done. My files look like this now:

*config-gui.xml*

<mapViewer options="{projection: 'EPSG:4326', maxExtent: new
OpenLayers.Bounds(-180,-90,180,90), units: 'degrees', restrictedExtent: new
OpenLayers.Bounds(-180,-90,180,90)}">
  <layers>
    <layer server="http://data.fao.org/geo/wms?&quot; tocName="Satèl·lit"
params="{layers: 'COMMON:dark_bluemarble', format: 'image/png'}"
options="{isBaseLayer: true}" />
    <layer server="http://129.206.228.72/cached/osm?&quot; tocName="Polític"
params="{layers: 'osm_auto:all', format: 'image/png'}"
options="{isBaseLayer: true}" />
  <layer server="http://geonetwork3.fao.org/ows/14074?&quot; tocName="Plantilla"
params="{layers: 'Country Boundaries', format: 'image/png'}"
options="{isBaseLayer: true}" />
  *<googleLayer server="google" tocName="Google Satellite"
type="G_SATELLITE_MAP" defaultLayer="true" />*
  </layers>
  <scales values="[7500000, 5000000, 2500000, 1000000, 750000, 500000,
250000, 100000, 75000, 50000, 25000, 10000, 7500, 5000, 2500, 1000]" />
      
  <proj>
    <crs code="EPSG:4326" default="1" name="WGS84 (lat/lon)" />
  </proj>
  <servers>
    <server name="NASA JPL OneEarth Web Mapping Server (WMS)"
url="http://wms.jpl.nasa.gov/wms.cgi?&quot; />
    <server name="NASA Earth Observations (NEO) WMS"
url="http://neowms.sci.gsfc.nasa.gov/wms/wms?&quot; />
    <server name="DEMIS World Map Server"
url="http://www2.demis.nl/mapserver/wms.asp?&quot; />
    <server name="Geoserver" url="http://localhost:8080/geoserver/wms?&quot; />
  </servers>
</mapViewer>

*ol_map.js*

Copy and paste from http://131.220.109.2/geonetwork/scripts/ol_map.js

*utils.xsl*

Thanks for advance Max

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016641.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Hi Victor,

Firebug has to be activated first. Usually you should see a button with an image of a bug on it either in your statusbar or menubar (within Firefox). By clicking on it you activate Firebug for the website you´re currently on (in this case your local geonetwork). Firebug has multiple tabs, e.g. the aforementioned "Console"-tab where errors are displayed and the Scripts-tab where you can create breakpoints and check if something´s going wrong within the code during creation of the map.

Best,
Max

-----Original Message-----
From: Vaictor [mailto:victor.fernandez.gayan@anonymised.com]
Sent: 15 November 2012 14:17
To: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] Conect google layers in mainmap

Hi Max,

If I execute GN http://localhost:8080/geonetwork (picture main) it appears my three layers duplicate, I don't know why. If I execute http://localhost:8080/geonetwork/srv/en/main\.home?debug=true nothing appears, just the graphics from the header. (picture debug). I have Firebug in Firefox but I don't know how to sse what happens. Any help will be fantastic

Thanks
Victor

<http://osgeo-org.1560.n6.nabble.com/file/n5016611/debug.jpg&gt;
<http://osgeo-org.1560.n6.nabble.com/file/n5016611/main.jpg&gt;

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016611.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Hi there,

I have 39 errors when I execute
http://localhost:8080/geonetwork/srv/en/main.home?debug=true inside
Firebug-Console-Errors

All of them come from files whick I haven't modified, is it normal?

I add an image. Should I repair all the errors? Firebug indicates the field
and line but I don't undersant most of the errors and I don't know if they
are related to google maps.

Is there any other easy solution, I should do this work. Maybe I could call
you.

Thanks Max
Víctor

<http://osgeo-org.1560.n6.nabble.com/file/n5016658/errors.jpg&gt;

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016658.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Hi Victor,

Those errors don´t necessarily mean that there´s really something wrong in the files mentioned, just that something went wrong before which causes those types not to load.

What comes to my mind now is that you also need to include the google-maps-API-javascript in main-page.xsl twice. First in the section for the scripts that are loaded when you execute the debug-version (<xsl:when test="/root/request/debug">) and second in the section for the production-version after the debug-section (<xsl:otherwise>). The following snippet has to be included:

<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=yourAPIkey&gt;&lt;/script&gt;

Replace "yourAPIkey" with your googlemaps-API-key if you already have one. If not you might also use google-maps-API-v3 though that has the odd behavior to display a popup with copyright information every time you change the extent as far as I remember.

If it´s still not working then I´d recommend to start from basic level (i.e. undo all the changes you did before and add the googleLayer manually in ol_map.js - see the OpenLayers-example http://openlayers.org/dev/examples/google.html for more information on this). Please also verify that your map should have EPSG:900913 set as Coordinate Reference System.

Best,
Max

-----Original Message-----
From: Vaictor [mailto:victor.fernandez.gayan@…54…]
Sent: 15 November 2012 16:11
To: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] Conect google layers in mainmap

Hi there,

I have 39 errors when I execute
http://localhost:8080/geonetwork/srv/en/main.home?debug=true inside Firebug-Console-Errors

All of them come from files whick I haven't modified, is it normal?

I add an image. Should I repair all the errors? Firebug indicates the field and line but I don't undersant most of the errors and I don't know if they are related to google maps.

Is there any other easy solution, I should do this work. Maybe I could call you.

Thanks Max
Víctor

<http://osgeo-org.1560.n6.nabble.com/file/n5016658/errors.jpg&gt;

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016658.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Hey Max,

I made and api key from google.

<xsl:choose>
            <xsl:when test="/root/request/debug">
                
    <script
src='http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=&lt;b&gt;AIzaSyAyzne4Fu8ykn3Ayby\.\.\.&#39;\*&gt;&lt;/script&gt;
            </xsl:when>
            <xsl:otherwise>
               
                <script
src='http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=&lt;b&gt;AIzaSyAyzne4Fu8ykn3Ayby\.\.\.&#39;\*&gt;&lt;/script&gt;
            </xsl:otherwise>
        </xsl:choose>

When I restart Apache, at them bottom-right of the page it appears
"googlereading" it looks like its works but there are the duplicatets layers
as before. I runed debug mode and appears these error wich I think maybe is
the cause. What do you think?
If it's not what you recomend me to do. Now that I have an API acces is
there any other easy solution to load the layers??

Thanks too much Max
Víctor

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016709.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

The error image

<http://osgeo-org.1560.n6.nabble.com/file/n5016710/error2.jpg&gt;

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016710.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

OK Max,

I tried to add in main main map the four layers as in example
http://openlayers.org/dev/examples/google.html

Basically I edited ol_map.js

/*
* Copyright (C) 2009 GeoNetwork
*
* This file is part of GeoNetwork
*
* GeoNetwork is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GeoNetwork is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GeoNetwork. If not, see <http://www.gnu.org/licenses/&gt;\.
*/
Ext.namespace('GeoNetwork');

var mapInit = false;

*var map;
function init() {
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: 22}
);
map.addLayers([gphy, gmap, ghyb, gsat]);
map.setCenter(new OpenLayers.LonLat(10.2, 48.9), 5);
} *

var activeIndex = 0;

// print config url
var printConfigUrl = mapfish.SERVER_BASE_URL + 'pdf/info.json';
.
.
.

Basically I copied as in the example of openlayers the script. Then I addes
the library of google in main-page.xsl with my key. Finally I added in
Config-gui.xml "<googleLayer server="google" tocName="Google Satellite"
type="G_SATELLITE_MAP" defaultLayer="true" />" But it doesn't upload any
layer when I restart Apache Tomcat. I'm desperate. What I have to do???
Thanks

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016745.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

What you need to do is basically:
1. Creation of the google-layers. For the pure Satellite-googlelayer
for example like this:
var gsat = new OpenLayers.Layer.Google(
        "Google Satellite",
        {type: G_SATELLITE_MAP, numZoomLevels: 22}
    );
2. This layer/s have to be added to the map-object then (you shouldn´t
create a new one as in your code-snippet below because that will overwrite
the already existing one). So just perform:
map.addLayer(gsat)
This will add only the gsat-layer to the map. Alternatively:
map.addLayers([layer1, layer2])
for multiple layers.

Caution: The google-maps-scripts still have to be imported through
main-page.xsl for this to work.

Good luck!
Max

-----Ursprüngliche Nachricht-----
Von: Vaictor [mailto:victor.fernandez.gayan@anonymised.com]
Gesendet: Donnerstag, 15. November 2012 20:51
An: geonetwork-users@lists.sourceforge.net
Betreff: Re: [GeoNetwork-users] Conect google layers in mainmap

OK Max,

I tried to add in main main map the four layers as in example
http://openlayers.org/dev/examples/google.html

Basically I edited ol_map.js

/*
* Copyright (C) 2009 GeoNetwork
*
* This file is part of GeoNetwork
*
* GeoNetwork is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GeoNetwork is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GeoNetwork. If not, see <http://www.gnu.org/licenses/&gt;\.
*/
Ext.namespace('GeoNetwork');

var mapInit = false;

*var map;
function init() {
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: 22} ); map.addLayers([gphy, gmap,
ghyb, gsat]); map.setCenter(new OpenLayers.LonLat(10.2, 48.9), 5); } *

var activeIndex = 0;

// print config url
var printConfigUrl = mapfish.SERVER_BASE_URL + 'pdf/info.json'; .
.
.

Basically I copied as in the example of openlayers the script. Then I

addes the

library of google in main-page.xsl with my key. Finally I added in

Config-gui.xml

"<googleLayer server="google" tocName="Google Satellite"
type="G_SATELLITE_MAP" defaultLayer="true" />" But it doesn't upload any

layer

when I restart Apache Tomcat. I'm desperate. What I have to do???
Thanks

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-

<http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp50162
29p5016745.html>

google-layers-in-mainmap-tp5016229p5016745.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

----------------------------------------------------------------------------
--

Monitor your physical, virtual and cloud infrastructure from a single web

console.

Get in-depth insight into apps, servers, databases, vmware, SAP, cloud
infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

Hi Max,

As you said I copy-paste /var gsat = new OpenLayers.Layer.Google(
                                "Google Satellite",
                                {type: G_SATELLITE_MAP, numZoomLevels: 22} /

in ol_map.js between the code "var mapInit = false;" and "var activeIndex =
0;". Then I added in main-page.xsl in order to import google layers library

//
        <xsl:choose>
            <xsl:when test="/root/request/debug">
                
    **
            </xsl:when>
            <xsl:otherwise>
                
              **
            </xsl:otherwise>
        </xsl:choose>

I did both tings and still doesn't work, the layer doesn't appear in
mai-map.
Help
Víctor

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016759.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Just to discard other causes: do you know which OpenLayer version is
included in Geonetwork?
Google did some changes some months ago, causing that only last OpenLayers
version (2.12) is properly loading their layers.

Regards,

César

2012/11/15 Vaictor <victor.fernandez.gayan@anonymised.com>

Hi Max,

As you said I copy-paste /var gsat = new OpenLayers.Layer.Google(
                                "Google Satellite",
                                {type: G_SATELLITE_MAP, numZoomLevels: 22}
/

in ol_map.js between the code "var mapInit = false;" and "var activeIndex =
0;". Then I added in main-page.xsl in order to import google layers library

//
        <xsl:choose>
            <xsl:when test="/root/request/debug">

                **
            </xsl:when>
            <xsl:otherwise>

              **
            </xsl:otherwise>
        </xsl:choose>

I did both tings and still doesn't work, the layer doesn't appear in
mai-map.
Help
Víctor

--
View this message in context:
http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016759.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   César Martínez Izquierdo
   GIS developer
   - - - - - - - - - - - - - - - - - - - -
   ETC-SIA: http://sia.eionet.europa.eu/
   Universitat Autònoma de Barcelona (SPAIN)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Hi Cesar,

Openlayer version is 2.10 so I downloaded 2.12 and rename the folder as
"openlayer" to replace the oldone in C:\tomcat\webapps\geonetwork\scripts
Then I restart Tomcat, in theory should work but appear an error (picture
foto). If I comment code with because it's seems is the error, (in the
layers inside config-gui.xml as you can see in the picture) then appear
another error (picture error2)

Any idea
Thanks

<http://osgeo-org.1560.n6.nabble.com/file/n5016879/error.jpg&gt;
<http://osgeo-org.1560.n6.nabble.com/file/n5016879/error2.jpg&gt;

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016879.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

I post error2 biger
<http://osgeo-org.1560.n6.nabble.com/file/n5016884/error2.jpg&gt;

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5016884.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Any idea?? I still in this point and I can't publish any layer

Thanks

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Conect-google-layers-in-mainmap-tp5016229p5017258.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.