[英]How can i use different string value's in one function?
First i am a beginner in programming in general, i am trying to create a program for using gps locations from Lightroom on a map in googlemaps. 首先,我通常是编程的初学者,我试图创建一个程序来使用Lightroom在googlemaps中的地图上的gps位置。
When i use the print the strings below ti the screen i see 5 different value's, this is also what i want, but... 当我使用屏幕下方的字符串打印时,我看到5个不同的值,这也是我想要的,但是...
I want to create also 5 different markers on the map this is done by the addMarkerByCoords Function but how can i use the 5 value per strings in the function ? 我也想在地图上创建5个不同的标记,这是通过addMarkerByCoords函数完成的,但是如何在函数中使用每个字符串的5个值呢?
I have tried array, foreach but i cannot getting to work. 我已经尝试了数组,foreach但我无法上班。 The not working part can and probably will be my fault. 不能正常工作的部分可能并且很可能是我的错。 LOL 大声笑
print_r ("$Loncoord");
print_r ("$Latcoord");
print_r ("$gui");
//$map->formatOutput = true;
$map->addMarkerByCoords("$Loncoord","$Latcoord","$gui",'<b>Old Chicago</b>');
Can somebody give me a hint ? 有人可以给我提示吗?
To: Jonathan Sampson: outputs print_r :-5.68166666667, +24.6513888889,IMG_3308,index.html,Landschap 至:乔纳森·桑普森(Jonathan Sampson):输出print_r:-5.68166666667,+ 24.6513888889,IMG_3308,index.html,Landschap
To: Anti Veeranna I removed the " marks (and the program still works), but can you explain why this is better ? 若要:反Veeranna我删除了“标记(该程序仍然有效),但是您能解释一下为什么这样更好吗?
And to the others Thank you very very much for the effort,work and really quick responses. 和其他人非常感谢您的努力,工作和迅速的回复。
Assuming that this is PHP, you could us an array of arrays, and then loop. 假设这是PHP,则可以给我们一个数组数组,然后循环。
Something like this: 像这样:
$items = array(
array(
'long' => 12.34567,
'lat' => 34.56789,
'gui' => '????',
'location' => 'old chicago'
),
...
array(
'long' => 12.34567,
'lat' => 34.56789,
'gui' => '????',
'location' => 'old chicago 5'
)
);
foreach ($items as &$item) {
$map->addMarkerByCoords(
$item['long'],
$item['lat'],
$item['gui'],
$item['location']
);
}
unset($item);
$map->addMarkerByCoords(Array($Loncoord, $Latcoord, $gui, '<b>Old Chicago</b>));
??
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.