I am using Google map V2 in my application(android). In my app I have used custom info window. When user click on the infowindow(using ExtInfoWindow method ) I have to call a JavaScript function.
Here everything works fine in my mobile except , the onClick fun<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>More map</title>
<script src="/public/js/jquery.min.js" type="text/javascript"></script>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=ABQIAAAAPDUET0Qt7p2VcSk6JNU1sBSM5jMcmVqUpI7aqV44cW1cEECiThQYkcZUPRJn9vy_TWxWvuLoOfSFBw" type="text/javascript"></script>
<script src="/public/js/extinfowindow.js" type="text/javascript"></script>
<script type="text/javascript">
var lat;
var lon;
var heading;
var map;
function redirect(id){
alert(id);
}function mapCalling()
{
try{
if (GBrowserIsCompatible()) {
function createMarker(point, Icon, html ) {
var marker = new GMarker(point, Icon);
GEvent.addListener(marker, "click", function(){
marker.openExtInfoWindow(
map,
"simple_example_window",
html,
{beakOffset: 30}
);
});
return marker;
}
map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng("13.060422", "80.249583"), 15);
var latArray = new Array("13.060422","13.053891","13.06042");
var longArray = new Array("80.249583","80.201454","80.24958");
//We can iterate more locations in map
for(var j = 0;j<latArray.length;j++)
{
var cIcon = new GIcon();
cIcon.image = '/public/images/icon1.png';
cIcon.iconSize = new GSize(19,25);
cIcon.shadowSize = new GSize(70, 50);
cIcon.iconAnchor = new GPoint(6, 20);
cIcon.infoWindowAnchor = new GPoint(5, 1);
var contentString = '<div id="info'+j+'" onclick="redirect(this.id);" style="font-size:11px;border:1px solid green;">Dispensary Name '+j+'<br> <br>Sample text<br><div>';
var point = new GLatLng(latArray[j],longArray[j]);
var marker = createMarker(point,cIcon, contentString )
map.addOverlay(marker);
}
return false;
}
}catch(e){alert(e);}
}
</script>
</head>
<body onload="mapCalling()" >
<div id="map" style="width:320px; height:360px"></div>
</body>
</html>
It is Works fine in Desktop browser, What is the problem or Is there any alternative way to do this
Can any one please help me...
--
You received this message because you are subscribed to the Google Groups "rhomobile" group.
To post to this group, send email to rhom...@googlegroups.com.
To unsubscribe from this group, send email to rhomobile+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rhomobile?hl=en.
(http://stackoverflow.com/questions/7077499/google-map-title-annotation-not-working-for-android-in-rhodes)So that I moved to Javascript Google map, Here everything works fine except the onclick function
(http://stackoverflow.com/questions/7077499/google-map-title-annotation-not-working-for-android-in-rhodes)So that I moved to Javascript Google map, Here everything works fine except the onclick function