<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=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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;}
span.E-postmall17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</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=SV link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal>Hi All, <o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span lang=EN-US>First I&#8217;m just going to tell you that
I&#8217;m not really a programmer, I&#8217;m more of a script kiddie, so bare
with me.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>The thing is that we got a customer that wants
to limit how close the user can zoom in to the map. So I started to have a look
and found out that there was something that made the map not zoom in closer
than the scale 1:1. So I started do look in the code for what was preventing
this, but I didn&#8217;t find anything in the zoom widgets or in the zoom
functions in Map.js. So I started to think there was something in openlayers
that made it impossible to zoom in more. <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Ok, so eventually I found out that we can send
some options when we initialize the open layers map, and I guess that 1:1 is
the default value. <a href="http://trac.openlayers.org/wiki/SettingZoomLevels">http://trac.openlayers.org/wiki/SettingZoomLevels</a><o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>So I looked in the code for where we
initialize an open layer map and found something on line 98 (this is MGE2009 so
the exact lines might have changed). Anyway I thought that I would try to send
some more options to the map and changed line 94 from<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>var options = {controls: [], fallThrough:
true};<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>to<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>var options = {controls: [], fallThrough:
true, minScale: 10000};<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>When I reload my map it initializes on
scale 1:10000, I can zoom in but not out. I try to change minScale to maxScale,
to make the opposite happen. But when I do that, nothing happens in the map, it
works like I had sent no extra option at all.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>So, could someone explain this behavior?
And could someone tell me how to solve my problem without using fixed
zoomscales?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Best regards<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Måns<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>-----------------------------------------------------------</span><span
style='font-size:12.0pt;font-family:"Times New Roman","serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Måns Beckman</span><span style='font-size:12.0pt;font-family:
"Times New Roman","serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Man and Machine</span><span style='font-size:12.0pt;font-family:
"Times New Roman","serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Fabriksgatan 13</span><span style='font-size:12.0pt;font-family:
"Times New Roman","serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>412 50 Göteborg</span><span style='font-size:12.0pt;font-family:
"Times New Roman","serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Phone: +46 31 - 762 8182</span><span style='font-size:12.0pt;
font-family:"Times New Roman","serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Mobile: +46 733 - 38 83 19</span><span style='font-size:12.0pt;
font-family:"Times New Roman","serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>