 <p>You can also ask the window: </p> <p>var hidpi = ('devicePixelRatio' in window &amp;&amp; devicePixelRatio > 1);</p> <p>and create the default Layers like this: </p> <p>var defaultLayers = platform.createDefaultLayers(hidpi ? 512 : 256, hidpi ? 320 : null);</p>