私が見ることができる限り、私は自分の関数に6つの引数を与えているだけで、スローされたエラーのように7つではありません:
mymap.addpoint(float(x[i][7][0]),float(x[i][7][1]), "#0000FF",None,title,str(x[i][0]))
TypeError: addpoint() takes at most 6 arguments (7 given)
誰か助けてくれませんか?以下のコード:
def plotjobs(x,y): #plots the latitude and longitudes of a job on a map (x would be the job dictionary, y is used to differentiate the filename)
mymap = pygmapsedit.maps(53.644638, -2.526855, 6)
for i in x:
title = "<img style = 'float: left' src='some.gif'><img style = 'float: left' src='someother.gif'><div style = 'float: right; width: 200px'><p><b>Route No.:</b> "+str(x[i][0])+"</p><p><b>Postcode:</b> "+str(x[i][1])+"</p><p><b>Visit Date:</b> "+str(x[i][3])+"</p><p><b>Store Name:</b> "+str(x[i][4])+"</p><p><b>Store Address:</b> "+str(x[i][5])+"</p><p><b>Store Telephone No.:</b> "+str(x[i][6])+"</div>"
mymap.addpoint(float(x[i][7][0]),float(x[i][7][1]), "#0000FF",None,title,None)
mymap.draw("./"+str(y)+"'s Route.html")
これは、私が使用しているモジュールのコードです (pygmaps の編集バージョン):
def drawpoint(self,f,lat,lon,color,title,windowtext,num):
f.write('\t\tvar latlng = new google.maps.LatLng(%f, %f);\n'%(lat,lon))
f.write('\t\tvar img = "http://mapicons.nicolasmollet.com/wp-content/uploads/mapicons/shape-default/color-666666/shapecolor-color/shadow-1/border-dark/symbolstyle-white/symbolshadowstyle-dark/gradient-iphone/number_'+num+'.png";\n') #replace with comment above to go back to default icon
if windowtext !=None:
f.write('\t\tvar info = '+'"'+windowtext+'"'+';\n')
f.write('\t\tvar infowindow = new google.maps.InfoWindow({\n')
f.write('\t\t});\n')
f.write('\t\tvar marker = new google.maps.Marker({\n')
if title !=None:
f.write('\t\ttitle: "'+str(title)+'",\n')
f.write('\t\ticon: img,\n')
f.write('\t\tposition: latlng,\n')
f.write('\t\tmap: map,\n')
f.write('\t\tcontent: info\n')
f.write('\t\t});\n')
f.write('\t\tmarker.setMap(map);\n')
f.write('\n')
f.write('\t\tgoogle.maps.event.addListener(marker, "click", function(content) {\n')
f.write('\t\t\tinfowindow.setContent(this.content);\n')
f.write('\t\t\tinfowindow.open(map,this);\n')
f.write('\t\t});\n')