I need help with this when I use a script on its own work well but if i start the same script in a function it does´t work any more.
the script is:
[lua]local function mapping (event)
for i=1, #markerTable do
markerCode[i] = [[
var infowindow]]…i…[[ = new google.maps.InfoWindow({
content: “]]…markerTable[i].name…[[
]]…markerTable[i].notes…[[”
});
var marker]]…i…[[ = new google.maps.Marker({
position: new google.maps.LatLng(]]…markerTable[i].lat…’, '…markerTable[i].lon…[[),
map: map,
animation: google.maps.Animation.DROP,
});
google.maps.event.addListener(marker]]…i…[[, ‘click’, function() {
infowindow]]…i…[[.open(map,marker]]…i…[[);
});
]]
end
local markerString = table.concat(markerCode)
–HTML & JAVASCRIPT CODE
local mapString = [[
[html]
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
[/html]
]]
local htmlFile = io.open( path, “w” )
htmlFile:write( mapString )
io.close( htmlFile )
native.showWebPopup (0, 75, display.contentWidth, 790, “map.html”,{baseUrl=system.DocumentsDirectory})
end[/lua]
I NEED HELP WHY DOES´T IT WORK!
THe Terminal always says that there is an error:
attempt to concatenate field ‘notes’ (a nil value)
thanks for any reply
Lenny [import]uid: 149464 topic_id: 30546 reply_id: 330546[/import]