[Thread Prev][Thread Next][Index]

[las_users] How to change the LAS Application Map, and want to integrate the Google Map.



Hi,
Good Morning....!!!

Dear All,

I am working on LAS Application wanted to change the LAS Application Map (Some images are attached in first picture),

vmap0.jpeg

How change this map  (from - labs.metacarta.com) and How to remove this image from LAS. Instead of this image i want to used Google Map in LAS Application.
Here is the Google Map image,

Picture1.png

Now the my problem is that, where i have to make the change in LAS Application so that the changes will reflect. I am able to put the Map on Standalone page, But cant able to integrate it into LAS. I tried to add layers of Google Map into LASOpenlayer.js file.

small snippet of the code....(This is LASOpenLayers.js file)

/* INIT OPENLAYERS MAP */
      
 mapoptions0   = {
                            maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
                restrictedExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
                };
               
        mapoptions180 = {
                maxExtent: new OpenLayers.Bounds(-400, -90, 400, 90),
                restrictedExtent: new OpenLayers.Bounds(-400, -90, 400, 90)
                };
                
                this.map = new OpenLayers.Map(this.DOMNode.id, mapoptions0);
        this.map.MW = this;

// i am adding the google layers below the "var wmsLayer"    this code not working

//  
      map = new OpenLayers.Map('map');
map.addControl(new OpenLayers.Control.LayerSwitcher());


var gphy = new OpenLayers.Layer.Google("Google Physical", {type: google.maps.MapTypeId.TERRAIN});
//
  

        /* add the layers */
                var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {wrapDateLine: true, isBaseLayer:false});
                var vector = new OpenLayers.Layer.Vector("
Vector Layer",{ rendererOptions : {  extent :  new OpenLayers.Bounds(-180, -90, 360, 90)}});
        vector.events.register("
sketchstarted", vector, function(evt) {evt.object.destroyFeatures();});
              vector.events.register("
featureadded", vector, function(evt) {
                evt.object.map.selection = evt.feature.geometry.bounds; 
                evt.object.map.MW.extents.
selection.grid.x.min = evt.feature.geometry.bounds.left;
                evt.object.map.MW.extents.
selection.grid.x.max = evt.feature.geometry.bounds.right;
                evt.object.map.MW.extents.
selection.grid.y.max = evt.feature.geometry.bounds.top;
                evt.object.map.MW.extents.
selection.grid.y.min = evt.feature.geometry.bounds.bottom;
                evt.object.map.MW.ondraw();
                evt.object.map.MW.onafterdraw(
);
                });
        vector.events.register("
afterfeaturemodified", vector, function(evt) {
                evt.object.map.selection = evt.feature.geometry.bounds; 
                evt.object.map.MW.extents.
selection.grid.x.min = evt.feature.geometry.bounds.left;
                evt.object.map.MW.extents.
selection.grid.x.max = evt.feature.geometry.bounds.right;
                evt.object.map.MW.extents.
selection.grid.y.max = evt.feature.geometry.bounds.top;
                evt.object.map.MW.extents.
selection.grid.y.min = evt.feature.geometry.bounds.bottom;
                evt.object.map.MW.ondraw();
                evt.object.map.MW.onafterdraw(
);
        });

        var base = new OpenLayers.Layer.Vector("Base Layer",{isBaseLayer:true, rendererOptions : { extent :  new OpenLayers.Bounds(-180, -90, 360, 90)}});

                this.map.addLayers([base, wmsLayer, vector]);
               
               this.map.addControl(new OpenLayers.Control.
MousePosition());
 
               controls = {
                    point: new OpenLayers.Control.
DrawFeature(vector, OpenLayers.Handler.Point, {title : "point"}),
                    hline: new OpenLayers.Control.
DrawFeature(vector, OpenLayers.Handler.HorizontalPath,{title : "hline" }),
                    vline: new OpenLayers.Control.
DrawFeature(vector, OpenLayers.Handler.VerticalPath,{title : "vline"}),
            box: new OpenLayers.Control.
DrawFeature(vector, OpenLayers.Handler.RegularPolygon, { title : "box", handlerOptions: { sides: 4, irregular: true}}),
                    drag: new OpenLayers.Control.
DragFeature(vector,{title:"map_change"}),
            nav: new OpenLayers.Control.Navigation(
{title : "map_nav"})
                };
 
                for(var key in controls) {
                    this.map.addControl(controls[
key]);
                }
                /*dateline WMS trick*/
                this.map.setCenter(new OpenLayers.LonLat(0, 0), 1);
                this.map.setOptions(
mapoptions180);
        this.map.zoomToExtent(new OpenLayers.Bounds(0,  -90, 360, 90), true);
        this.extents.data.grid.x.min=
0;
        this.extents.data.grid.x.max=
360;
        this.extents.data.grid.y.min=-
90;
        this.extents.data.grid.y.max=
90;
        this.extents.selection.grid.x.
min=0;
        this.extents.selection.grid.x.
max=360;
        this.extents.selection.grid.y.
min=-90;
        this.extents.selection.grid.y.
max=90;       
             
}




Please...., can anybody help me,  what are the ways to change the map.

Awaiting for reply.....


--
Thanks  & Regards,
Sandip Ingle,


[Thread Prev][Thread Next][Index]


Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement