I'm using Modernizr, and I want to use a Google Maps when -no-touch is available. And use a static map when .touch is available. Like so:
.no-touch #map-canvas {
height: 400px;
}
.touch #map-canvas-static {
height: 300px;
background-image: url('http://maps.googleapis.com/maps/api/staticmap?center=63.439016,10.416856&zoom=15&format=png&sensor=false&size=1583x1583&maptype=roadmap&style=element:geometry|saturation:-71&style=feature:water|saturation:-2|color:0x768080|lightness:34&markers=63.439114,10.415564&&scale=1');
background-position: center;
}
HTML Markup is as simple as this:
<section id="map">
<div id="map-canvas-static"></div>
<div id="map-canvas"></div>
</section>
Are there any reasons why this would not work?
Because on my desktop computer, this is working just fine. However on the iPhone I'm testing it with, it's not.