<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Milo,<o:p></o:p></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks, but this doesn’t change the layer behaviour. It still loads the tiles with the wrong token, realises it does something dumb, and loads the same tiles
 with the proper token.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The layer itself knows its invisible.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Jelmer<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Milo van der Linden [mailto:milo@dogodigi.net]
<br>
<b>Sent:</b> Thursday, August 09, 2012 9:59 AM<br>
<b>To:</b> Jelmer Baas<br>
<b>Cc:</b> openlayers-users@lists.osgeo.org<br>
<b>Subject:</b> Re: [OpenLayers-Users] Having a non-visible Google Layer leads to 404's at map load<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p>You need an extra optionset in your layer definition that holds visibility:<o:p></o:p></p>
<p>OpenLayers.Layer.Google("name",{youroptions},{visibility:false})<o:p></o:p></p>
<p>Verzonden vanaf mijn Samsung Galaxy S II<o:p></o:p></p>
<div>
<p class="MsoNormal">On Aug 9, 2012 9:21 AM, "Jelmer Baas" <<a href="mailto:baas@speerit.nl">baas@speerit.nl</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Hello,<br>
<br>
I'm using OL 2.12 to add an optional Google Satellite baselayer:<br>
map = new OpenLayers.Map({<br>
div: 'map',<br>
                projection: "EPSG:900913",<br>
                controls: [...]<br>
, layers: [<br>
                    new OpenLayers.Layer.OSM("OpenStreetMap",<br>
                        ["<a href="http://x/osm_tiles2/$%7bz%7d/$%7bx%7d/$%7by%7d.png" target="_blank">http://x/osm_tiles2/${z}/${x}/${y}.png</a>"],<br>
                        { transitionEffect: "resize", numZoomLevels: 24, opacity: 1 })<br>
                    , new OpenLayers.Layer.Google("Google Satellite", {visibility: false, type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22, transitionEffect: "resize"})<br>
]});<br>
<br>
I had expected this to be enough to make the Google layer invisible, yet, at page load I get about 50 404 errors:<br>
"NetworkError: 404 Not Found - <a href="http://khm1.googleapis.com/kh?v=115&hl=en-US&x=1023&y=1024&z=11&token=68404" target="_blank">
http://khm1.googleapis.com/kh?v=115&hl=en-US&x=1023&y=1024&z=11&token=68404</a>"<br>
Later, the url is changed to:<br>
<a href="http://khm1.googleapis.com/kh?v=115&hl=en-US&x=1057&y=671&z=11&token=113046" target="_blank">http://khm1.googleapis.com/kh?v=115&hl=en-US&x=1057&y=671&z=11&token=113046</a> (i.e., the token changes)<br>
and the map loads succelfully. Yet, at this point my Google layer is still supposed to be invisible. I only want it to load when I turn it on by setting map.setBaseLayer().<br>
<br>
Oh, the Google API is loaded by:<br>
<script src="<a href="http://maps.google.com/maps/api/js?v=3.2&sensor=false" target="_blank">http://maps.google.com/maps/api/js?v=3.2&sensor=false</a>"></script><br>
<br>
Any idea what I'm doing wrong?<br>
<br>
Thanks in advance,<br>
Jelmer Baas<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><o:p></o:p></p>
</div>
</div>
</body>
</html>