I have a simple map control that is working as I hope.
Map1.png
The problem is I am failing to understand the data object available onClick
My code (Shortened) looks like this
for (i = 1; i <= rc; i++) {
var row = {dialog.object}._repeatingSectionLogicalToPhysicalRow('DETAILS',i);
var comp = {dialog.Object}.getValue('Trip_Company' + ':' + row);
var settings = {
group: 'mg1', // group that the marker is part of - an arbitrary name
icon: {
url: url1, // url of the image to use for the marker
width: false, // width of the image
height: false, // height of the image
anchor: {x: false, y: false} // anchor point of the image (this is the point in the image that will be the lat/lng of the marker)
},
//Here everything is fine each title sets correctly.
title: comp, // mouse over help text
detail: {
has: true, // whether or not the marker has a "detail". The "detail" is a popup that provides the user with more information when they click on the marker.
data: title1 // the data to display to the user
},
onClick: function(data){
//here comp is the last value found not the value I expect.
var txt = comp;
alert(txt);
}
};
var mapObj = {dialog.object}.getControl('trip_Map');
mapObj.addMarker(name,[lat, lng],settings);
//alert(comp + " " + i);
}
var mapObj = {dialog.object}.getControl('trip_Map');
mapObj.viewMarkerGroups('mg1');
Can some see what I am doing wrong?
Michael
Map1.png
The problem is I am failing to understand the data object available onClick
My code (Shortened) looks like this
for (i = 1; i <= rc; i++) {
var row = {dialog.object}._repeatingSectionLogicalToPhysicalRow('DETAILS',i);
var comp = {dialog.Object}.getValue('Trip_Company' + ':' + row);
var settings = {
group: 'mg1', // group that the marker is part of - an arbitrary name
icon: {
url: url1, // url of the image to use for the marker
width: false, // width of the image
height: false, // height of the image
anchor: {x: false, y: false} // anchor point of the image (this is the point in the image that will be the lat/lng of the marker)
},
//Here everything is fine each title sets correctly.
title: comp, // mouse over help text
detail: {
has: true, // whether or not the marker has a "detail". The "detail" is a popup that provides the user with more information when they click on the marker.
data: title1 // the data to display to the user
},
onClick: function(data){
//here comp is the last value found not the value I expect.
var txt = comp;
alert(txt);
}
};
var mapObj = {dialog.object}.getControl('trip_Map');
mapObj.addMarker(name,[lat, lng],settings);
//alert(comp + " " + i);
}
var mapObj = {dialog.object}.getControl('trip_Map');
mapObj.viewMarkerGroups('mg1');
Can some see what I am doing wrong?
Michael
Comment