It looks like you're new here. If you want to get involved, click one of these buttons!
Hi
![]() |
main.txt | (5K) |
I don`t know if this helpes. But the joContainer and the divs you use inside kind of create an empty element so the googlemaps wont show. So you just have to work arount that.
Made a kitchensink file without the phonegap js, but working in a browser so you should get around what you want.
include these in the <head>
<script src="http://www.google.com/jsapi"></script>
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
(if you use the kitchensink demo include this in menu.js)
{ title: "Googlemap test", id: "googlemap" }
And include the attached file in js folder and include in the index.html (attached file doesn`t work)
googlemap.js:
joCache.set("googlemap", function() {
var mapCard, joMap, map;
map = joDOM.create("div", {id:"map", width:"100%", height:"100%"});
mapCard = new joContainer(map);
mapCard.setStyle({position: "absolute", top:"0", left:"0", bottom: "0", right: "0"});
mapCard.activate = function() {
if(!mapCard.mapActivated) {
if(google.loader.ClientLocation) {
var latt = google.loader.ClientLocation.latitude;
var longg = google.loader.ClientLocation.longitude;
var latlng = new google.maps.LatLng(latt, longg);
} else {
var latlng = new google.maps.LatLng(-34.397, 150.644);
}
var myOptions = {
zoom: 14,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(map, myOptions);
mapCard.mapActivated = true;
}
}
mapCard.setTitle("Googlmap");
return mapCard;
});
Hello,
So first the map doesn't seem to work if you put it inside a joCard, and then load that into a joStack. It works directly being pushed onto the stack and displays fine.
Second the error I was getting in chrome and the inability to drag the map was due to a bug in the Ripple emulator which doesn't seem to be fixed in the new version either - v0.94 I think. Turn the emulator off or run in the phone and it works fine.
Btw I highly recommend using the Ripple emulator if you're doing Jo Dev, or any mobile Dev for that matter! There's a standalone and it works as a chrome extension as well.
John Paul
Hello all,