<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi the pb is solved with this code.<div><br></div><div>variables map.getScale ( ); or getZoom  send a good information if it's  inside a function ..... </div><div><br></div><div><div><font class="Apple-style-span" color="#3c00ff"><span class="Apple-tab-span" style="white-space:pre">  </span>style = new OpenLayers.Style({</font></div><div><font class="Apple-style-span" color="#3c00ff">    <span class="Apple-tab-span" style="white-space: pre; ">   </span>externalGraphic: 'http://pofableau.com/openlayer/calque.png',</font></div><div><font class="Apple-style-span" color="#3c00ff">    <span class="Apple-tab-span" style="white-space: pre; ">    </span>graphicHeight: "${H1}",</font></div><div><font class="Apple-style-span" color="#3c00ff">    <span class="Apple-tab-span" style="white-space: pre; ">        </span>graphicWidth: "${W1}"</font></div><div><font class="Apple-style-span" color="#3c00ff">    <span class="Apple-tab-span" style="white-space: pre; ">  </span>},</font></div><div><font class="Apple-style-span" color="#3c00ff">    <span class="Apple-tab-span" style="white-space: pre; ">       </span>{ context: { </font></div><div><font class="Apple-style-span" color="#3c00ff">    <span class="Apple-tab-span" style="white-space: pre; ">               </span>H1: function() { return 272/</font><font class="Apple-style-span" color="#f81e1c">map.getScale()</font><font class="Apple-style-span" color="#3c00ff">*2000;},</font></div><div><font class="Apple-style-span" color="#3c00ff">    <span class="Apple-tab-span" style="white-space: pre; ">           </span>W1: function() { return 200/</font><font class="Apple-style-span" color="#f81e1c">map.getScale()</font><font class="Apple-style-span" color="#3c00ff">*2000;}    <span class="Apple-tab-span" style="white-space: pre; ">      </span></font></div><div><font class="Apple-style-span" color="#3c00ff">    <span class="Apple-tab-span" style="white-space: pre; ">         </span>} }    <span class="Apple-tab-span" style="white-space: pre; ">        </span></font></div><div><font class="Apple-style-span" color="#3c00ff"><span class="Apple-tab-span" style="white-space: pre; ">            </span>);</font></div><div><font class="Apple-style-span" color="#3c00ff"> </font></div><div><font class="Apple-style-span" color="#3c00ff">       var couche_calque = new OpenLayers.Layer.Vector("Calque", {</font></div><div><font class="Apple-style-span" color="#3c00ff">       styleMap: new OpenLayers.StyleMap(style) }</font></div><div><font class="Apple-style-span" color="#3c00ff">            );</font></div><div><font class="Apple-style-span" color="#3c00ff">       var feature = new OpenLayers.Feature.Vector(</font></div><div><font class="Apple-style-span" color="#3c00ff">       new OpenLayers.Geometry.Point(2.534904,48.387375).transform(</font></div><div><font class="Apple-style-span" color="#3c00ff">       new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984</font></div><div><font class="Apple-style-span" color="#3c00ff">       new OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection</font></div><div><font class="Apple-style-span" color="#3c00ff">            <span class="Apple-tab-span" style="white-space: pre; ">      </span>),</font></div><div><font class="Apple-style-span" color="#3c00ff">       {some:'data'}</font></div><div><font class="Apple-style-span" color="#3c00ff">            );</font></div><div><font class="Apple-style-span" color="#3c00ff">       couche_calque.addFeatures(feature);</font></div></div><div><font class="Apple-style-span" color="#3c00ff"><br></font></div><div><br></div><div><a href="http://pofableau.com/openlayer/multicouche.html">http://pofableau.com/openlayer/multicouche.html</a></div><div><br></div><div><br></div><div>Many thanks for the help.</div><div><br></div><div>Christian</div><div><font class="Apple-style-span" color="#3c00ff"><br></font></div><div><br></div><div><br><div><div>Le 19 juin 2012 à 16:52, Olivier Terral a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Christian,</div><div><br></div><div>You're doing a getZoom() just after created the map and before a zooming function, so the zoom property of the map is logically 0. </div><div><br></div><div>Anyway, I think you use a wrong way of managing scale dependent size. </div><div><br></div><div>Your problem seems similar to this example: <a href="http://dev.openlayers.org/releases/OpenLayers-2.11/examples/label-scale.html">http://dev.openlayers.org/releases/OpenLayers-2.11/examples/label-scale.html</a> .</div><div><br></div><div>Hope this helps.</div><div><br></div><div>Tschuuss</div><div><br></div><div><div>Le 19 juin 2012 à 15:05, christian bleau a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,

i'm just trying to use OL and I meet a problem with  map.getZoom 

<a href="http://www.pofableau.com/openlayer/multicouche2.html//" target="_top" rel="nofollow" link="external">here's</a> url of my test.

for adapt an  size of an OpenLayers.Layer.Vector and an externalGraphic 
I call a var zoom with map.getZoom

line: 159  I call var z= map.getZoom(); for change the size of an image

But they don't work "Error: Invalid value for <img> attribute height="Infinity" 

If I try to see the z'value   Firebug give me  "0" ..... 
<img class="smiley" src="http://n6.nabble.com/images/smiley/smiley_what.gif">

Thank a lot if you have the solution I search it since two days.
        
<br><hr align="left" width="300">
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/pb-with-map-getZoom-tp4982396.html">pb with map.getZoom</a><br>
Sent from the <a href="http://osgeo-org.1560.n6.nabble.com/OpenLayers-Users-f3910695.html">OpenLayers Users mailing list archive</a> at <a href="http://Nabble.com/">Nabble.com</a>.<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">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="font-family: Helvetica; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Olivier Terral<br></div><br class="Apple-interchange-newline"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span><span><PastedGraphic-1.gif></span></span><span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: Helvetica; "><br class="Apple-interchange-newline"> </span><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>GEOMATIC Ingénierie SA<br>Société du groupe Ringier<br>Chemin des Croisettes 26<br>1066 Epalinges<br><a href="http://www.geomatic.ch/">www.geomatic.ch</a></div><div><a href="http://www.thevirtualcity.ch/">www.thevirtualcity.ch</a><br>Tél:: +41 (21) 651 30 00<br>Fax: +41 (21) 651 30 09</div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"></span></div></span></span></span></span></span></span></span></span></span>
</div>
</span></span></span></span></span></span></span></span></div><br></div>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>http://lists.osgeo.org/mailman/listinfo/openlayers-users<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Christian</div><div><br></div><div><a href="http://www.pofableau.com/">Pof@Bleau</a></div><div><br></div><div><br></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>