Skip to content

Commit

Permalink
support for any window size
Browse files Browse the repository at this point in the history
  • Loading branch information
max-mapper committed Feb 27, 2011
1 parent 58abe7c commit 458ef62
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions index.html
Expand Up @@ -39,15 +39,11 @@
.bottom {top: 120px; left: 25px;}
</style>

<script src="js/jquery-1.4.3.min.js"></script>
<script src="js/jquery.mobile-1.0a3.min.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>

<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="iphone.css" type="text/css" />

<script src="script/jquery-1.4.3.min.js"></script>
<script src="script/jquery.mobile-1.0a3.min.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.4.min.js"></script>
<script type="text/javascript" charset="utf-8">

var pictureSource, userAgent, media, map, catMarker;

var locWin = function(position) {
Expand All @@ -71,13 +67,20 @@
}

function onDeviceReady() {
userAgent = navigator.userAgent;
if (userAgent.indexOf('iPhone') != -1 || userAgent.indexOf('Android') != -1 ) {
pictureSource = navigator.camera.PictureSourceType;
if (isMobile()) {
pictureSource = navigator.camera.PictureSourceType;
}
navigator.geolocation.getCurrentPosition(locWin, locFail);
}

function isMobile() {
userAgent = navigator.userAgent;
if (userAgent.indexOf('iPhone') >= 0 || userAgent.indexOf('Android') >= 0 ) {
return true;
}
return false;
}

function uploadWin() {
$.mobile.changePage($('#map'));
alert('CAT MAPPED');
Expand Down Expand Up @@ -137,6 +140,7 @@
}

function showMap(latitude, longitude) {
$('.crosshair').css('left', (document.body.clientWidth - 320) / 2);
var geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(latitude, longitude);
var address;
Expand Down Expand Up @@ -183,8 +187,7 @@
};

$(function() {
userAgent = navigator.userAgent;
if (userAgent.indexOf('iPhone') === -1 || userAgent.indexOf('Android') === -1 ) {
if (!isMobile()) {
showMap(42.35017139318913, -71.04257583618164);
}
});
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 458ef62

Please sign in to comment.