[Spanish] Re: mapserver, google maps y openlayers

martinmaximilianoflores martinmaximilianoflores at yahoo.com.ar
Mon Feb 27 14:36:55 EST 2012


la funcion de Open layers:

	  function init()
	    {
    	
    	 //var map = new OpenLayers.Map('map',{maxExtent: new
OpenLayers.Bounds(5596608.075442,6161290.075000,5623305.424558,6182013.925000),maxResolution:
'auto',units: "m",projection: "EPSG:22195"}); 
    	 var map = new OpenLayers.Map('map',
    	 {
    	  displayProjection: new OpenLayers.Projection("EPSG:"),
    	  projection: new OpenLayers.Projection("EPSG:900913"),
    	  maxExtent: new
OpenLayers.Bounds(5596608.075442,6161290.075000,5623305.424558,6182013.925000),
    	  //maxExtent: new OpenLayers.Bounds(-1,-1,1,1),
    	  maxResolution: 'auto',
    	  units: "m",
    	  //projection: new OpenLayers.Projection("EPSG:22195")
    	 }
    	 );
    	     	 
    	     	 
     	 var layer = new
OpenLayers.Layer.WMS("Moreno","http://sshhost.dyndns-server.com/cgi-bin/mapserv?map=/var/www/html/webtools/afis.map",
{layers:'afis4ok'},{isBaseLayer:false},{tranparent:true}); 
    	
    	 var gphy = new OpenLayers.Layer.Google("Google Physical",{type:
google.maps.MapTypeId.TERRAIN,maxExtent: new
OpenLayers.Bounds(5596608.075442,6161290.075000,5623305.424558,6182013.925000)});
    	
    	 info = new OpenLayers.Control.WMSGetFeatureInfo({
            layers: [layer], 
            title: 'Info',
            queryVisible: true,
            eventListeners: {
                getfeatureinfo: function(event) {
                    map.addPopup(new OpenLayers.Popup.FramedCloud(
                        "chicken", 
                        map.getLonLatFromPixel(event.xy),
                        null,
                        event.text,
                        null,
                        true
                    ));
                }
            }
        });
        
        map.addControl(info);
        
        info.activate();
      	 
      	 map.addControl(new OpenLayers.Control.LayerSwitcher());
      	 map.addControl(new OpenLayers.Control.OverviewMap());
      	 map.addControl(new OpenLayers.Control.NavToolbar())
    	 
    	 map.addLayers([gphy,layer]);
    	 
    	 
    	// map.addLayers([layer]);
    	 
    	 map.zoomToMaxExtent(); 
    	
  	   }
	  	
Saludos y gracias

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/mapserver-google-maps-y-openlayers-tp4515966p4516194.html
Sent from the OSGeo Spanish Local Chapter mailing list archive at Nabble.com.


More information about the Spanish mailing list