[OpenLayers-Users] Google Layer shifted small dustance

boesiii boesiii at yahoo.com
Fri Mar 29 12:02:41 PDT 2013


Third try

 

<!DOCTYPE html>

<html>

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <title>mapIt!</title>

    <script src="http://openlayers.org/dev/OpenLayers.js"></script>

    <!-- <script
src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> -->

                <script type="text/javascript"
src="http://maps.google.com/maps/api/js?v=3.5&sensor=false"></script>

                <style>

                html, body {

                                width: 100%;

                                height: 100%;

                                margin: 0;

                                padding: 0;

                                }

                                

                #top_bar {

                                background: #c0cf2e;

                

                }

                

                #bottom_bar {

                                background: #c0cf2e;     

                }

                

                

                

                .container3 {

                                width:500px;

                                /* background:#DADADA; */

                                float: right;

                                

                }

                

                .content3 {

                                /* background:green; */

                                /* width:100px;*/

                                /* display:inline-block !important; */

                                float: right;

                }

                

                .sidebar3 {

                                width:200px; /* Intentionaly has more width
*/ 

                                float: right;

                                /* display:inline-block; */

                                /* Ignore this, it's just to show the green
sidebar is not jumping to the next line, even though it "collides" */

                                /* background:lime; */

                                z-index:100;

                                /* position:relative;*/

                                text-align: right;

                }

                </style>

                                

    

    <script type="text/javascript">

    var map;

                var lon = -8931492; //conway

                var lat = 4963166;

                var zoom = 15;

    

    function init(){

                                //map = new OpenLayers.Map('map', {});

                                map = new OpenLayers.Map('map',{

                                                projection: new
OpenLayers.Projection('EPSG:900913'),

                                                displayProjection: new
OpenLayers.Projection("EPSG:4326")

                                });

                                

                                var wms = new OpenLayers.Layer.WMS(

                                                'OpenLayers WMS',

 
'http://vmap0.tiles.osgeo.org/wms/vmap0',

                                                {layers: 'basic'}

                                );

                                

                                var streets = new
OpenLayers.Layer.Google("Google Streets", {

                                                //numZoomLevels: 20

                                });

                                

                                var physical = new
OpenLayers.Layer.Google("Google Physical", {

                                                type:
google.maps.MapTypeId.TERRAIN

                                });

                                

                                var hybrid = new
OpenLayers.Layer.Google("Google Hybrid", {

                                                type:
google.maps.MapTypeId.HYBRID

                                });

                                

                                var satellite = new OpenLayers.Layer.Google
("Google Satellite", {

                                                type:
google.maps.MapTypeId.SATELLITE

                                });

                                

                                arrayOSM =
["http://otile1.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",

 
"http://otile2.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",

 
"http://otile3.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",

 
"http://otile4.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg"];

 


                                arrayAerial =
["http://otile1.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg",

 
"http://otile2.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg",

 
"http://otile3.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg",

 
"http://otile4.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg"];

 


                                //baseOSM = new
OpenLayers.Layer.OSM("MapQuest-OSM Tiles", arrayOSM);

                                //baseAerial = new
OpenLayers.Layer.OSM("MapQuest Open Aerial Tiles", arrayAerial);

                                

                                map.addLayers([streets, physical, hybrid,
satellite]);

                                

                                map.addControl(new
OpenLayers.Control.LayerSwitcher());

                                //map.addControl(new
OpenLayers.Control.MousePosition({

                                                //displayProjection: new
OpenLayers.Projection('EPSG:4326')

                                                //div: 'coords'

                                                //})

                                //);

                                map.addControl(new
OpenLayers.Control.MousePosition({

                                                displayProjection: new
OpenLayers.Projection('EPSG:4326'),

                                                numDigits: 6,

                                                emptyString: 'null',

                                                div: coords

                                                })

                                );

                                map.addControl(new
OpenLayers.Control.PanZoomBar());

                                map.addControl(new
OpenLayers.Control.ScaleLine());

                                map.addControl(new
OpenLayers.Control.Navigation());

                                

                                map.setCenter(new
OpenLayers.LonLat(lon,lat), zoom);

                                

                                //if(!map.getCenter()){

                                //            map.zoomToMaxExtent();

                                //}

                                

                                

                }

                </script>

</head>

 

<body onload='init();'>

                <div id='top_bar' style='width: 100%; height: 3%;'></div>

                <div id='map' style='width: 100%; height: 94%;'></div>

                <div id='bottom_bar' class='container3' style='width: 100%;
height: 3%;'>

                                <div id='coords' class='sidebar3'></div>


                                <div id='mouse_pos'
class='content3'>Coordinates:</div>

                </div>

</body>

</html>

 

From: Gery [via OSGeo.org] [mailto:ml-node+s1560n5043748h51 at n6.nabble.com] 
Sent: Friday, March 29, 2013 3:00 PM
To: boesiii
Subject: Re: Google Layer shifted small dustance

 

Where? 

Sent from my iBath 

On Mar 29, 2013, at 18:13, "boesiii" <[hidden email]> wrote: 

For some reason nabble gobbles my script sections.  Here is my second
attept. 





-- 
View this message in context:
http://osgeo-org.1560.n6.nabble.com/Google-Layer-shifted-small-dustance-tp50
42428p5043732.html
Sent from the OpenLayers Users mailing list archive at Nabble.com. 
_______________________________________________ 
Users mailing list 
[hidden email] 
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________ 
Users mailing list 
[hidden email] 
http://lists.osgeo.org/mailman/listinfo/openlayers-users



  _____  

If you reply to this email, your message will be added to the discussion
below:

http://osgeo-org.1560.n6.nabble.com/Google-Layer-shifted-small-dustance-tp50
42428p5043748.html 

To unsubscribe from Google Layer shifted small dustance, click here
<http://osgeo-org.1560.n6.nabble.com/template/NamlServlet.jtp?macro=unsubscr
ibe_by_code&node=5042428&code=Ym9lc2lpaUB5YWhvby5jb218NTA0MjQyOHwtMTQyOTU5NT
YyMQ==> .
 
<http://osgeo-org.1560.n6.nabble.com/template/NamlServlet.jtp?macro=macro_vi
ewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.Basic
Namespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.
NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_e
mails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> NAML 





--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Google-Layer-shifted-small-dustance-tp5042428p5043750.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130329/109a7eed/attachment.html>


More information about the Users mailing list