PDA

View Full Version : Map BUG and WebApp on homescreen BUG



kevinv1990
30 Mar 2011, 1:25 PM
Hello,

When I touch a marker, the infowindows doesn't show. In sencha 1.0 this works, in sencha 1.1 and 1.0.1 it doesn't, what is the reason?

2nd bug is when you add the webapp on your homescreen the images aren't shown good, like the back button and the images on the tabbar.

Any chance this will be fixed?

Example of my code for the map panel:


// MapPanel
var image = new google.maps.MarkerImage(
'/icamsbase/mobile/img/point.png',
new google.maps.Size(32, 31),
new google.maps.Point(0,0),
new google.maps.Point(16, 31)
);

var pointer_deloitte1 = new google.maps.MarkerImage(
'/icamsbase/mobile/img/pointer_white.png',
new google.maps.Size(32, 31),
new google.maps.Point(0,0),
new google.maps.Point(16, 31)
);

var pointer_deloitte2 = new google.maps.MarkerImage(
'/icamsbase/mobile/img/pointer_blue.png',
new google.maps.Size(32, 31),
new google.maps.Point(0,0),
new google.maps.Point(16, 31)
);

icams.mapPanel = new Ext.Panel({
id: 'mapPanel',
name: 'mapPanel',
loadMask: true,
title: text.get('mappanel_title'),
items: [
{
xtype: 'map',
id: 'map1',
name: 'map1',
useCurrentLocation: true,
mapOptions: {
navigationControl: false,
streetViewControl: false,
mapTypeControl: false,
zoom: 10
},
listeners : {
maprender : function(comp, map) {
console.log('map render');
function addInfoWindow(marker, id, location, functie, i){
google.maps.event.addListener(marker, 'click', function() {
closeInfoWindows();
var infoContent1 = '<a href="#" class="functieCLS" onclick="mapShowDetail('+i+');">'+ functie + '<br/>' + '<span class="locatieCLS">' + location + '</span></a>' +
'<br/><a href="#" class="meerCLS" onClick="mapAllJobs('+i+');">' + text.get('morejobs_window') + ' &gt;</a></p>';
infoWindow1 = new google.maps.InfoWindow({
content: infoContent1,
cls: 'infowindow1'
});
infoWindow1.open(map, marker);
openInfoWindow1 = true;
});
}
function addInfoWindow2(marker, id, location, functie, i){
google.maps.event.addListener(marker, 'click', function() {
closeInfoWindows();
var infoContent2 = '<a href="#" class="functieCLS" onclick="mapShowDetail('+i+');">'+ functie + '<br/>' + '<span class="locatieCLS">' + location + '</span></a>';
infoWindow2 = new google.maps.InfoWindow({
content: infoContent2,
cls: 'infowindow2'
});
infoWindow2.open(map, marker);
openInfoWindow2 = true;
});
}
var i = 0;
var totalMarkers = datastore2.getCount();
console.log('Count Datastore 2: '+ datastore2.getCount());
for(i=0;i<totalMarkers;i++) {
var selectedMarker = datastore2.getAt(i);
var lat = selectedMarker.data.lat;
var lng = selectedMarker.data.lng;
var id = selectedMarker.data.id;
var location = selectedMarker.data.locatie;
var functie = selectedMarker.data.functie;
var positionMarker = new google.maps.LatLng(lat, lng);
function checkCordinates() {
var p;
for(p=0;p<totalMarkers;p++) {
if(p!=i) {
var checkMarker = datastore2.getAt(p);
var latCheck = checkMarker.data.lat;
var lngCheck = checkMarker.data.lng;
if(lat==latCheck && lng == lngCheck){
return 1;
}
}
}
}

if(checkCordinates(positionMarker)==1) {
var marker = new google.maps.Marker({
id: 'idMarker'+ (id),
position: positionMarker,
map: map,
icon: pointer_deloitte2,
title: 'Job'+(id)
});
addInfoWindow(marker, id, location, functie, i);

} else {
var marker = new google.maps.Marker({
id: 'idMarker'+ (id),
position: positionMarker,
map: map,
icon: pointer_deloitte1,
title: 'Job'+(id)
});
addInfoWindow2(marker, id, location, functie, i);
}
}
var marker = new google.maps.Marker({
id: 'currentMarker',
position: currentLocation,
map: map,
icon : image,
title: 'Current Location'
});
},
afterrender : function() {
this.update(currentLocation);
}
}
}
]
});
Sorry I know it's a lot of code, maybe not all relevant, but I am sure you gurus understand. ^^. On the desktop the infowindow is shown correctly.


Greetz.
Kevin

kevinv1990
5 Apr 2011, 1:07 AM
Please, it's a real problem, who is not having this problem? (the infowindow don't show up when the marker get touched) if you not, please post code.

Greetz