![]() |
Question on infowindow_content of Google Map API V3 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Question on infowindow_content of Google Map API V3 (/showthread.php?tid=48946) |
Question on infowindow_content of Google Map API V3 - El Forum - 02-02-2012 [eluser]Desmond[/eluser] Hello everyone, currently I am working on a project of map search. I am using the google map library from Steve (http://biostall.com/codeigniter-google-maps-v3-api-library]http://biostall.com/codeigniter-google-maps-v3-api-library) It's really great library. However, I faced with two problems. I will be very pleased if you can help me. 1. I tried to add the hyperlink into info_window, but it can't be worked, no google map shown. Code: $marker['infowindow_content']='<a href="http://www.google.com">Google</a>' However, when I changed to Code: $marker['infowindow_content']='<h1>Hello World</h1>' How can I add the hyperlink into info_window by a correct way? 2. I have several shop address at the same building that is using the same latitude and longitude. How can I show their info on the same $infowindow_content? Currently, I am using the code: Code: foreach ($query->result() as $row) { However, the old infowindow_content will be replaced by new infowindow_content using this method. Any idea of how can we show multi-information into the same infowindow when using the same latitude and longitude? Thanks so so much in advance. Question on infowindow_content of Google Map API V3 - El Forum - 02-02-2012 [eluser]BIOSTALL[/eluser] Hi Desmond, Thanks for using my library. I hope it's working OK for you. Please find below the answers to your questions: 1. Adding a link to an infowindow The problem here is your using double quotes which, if you view the source of your page, you'll see need to be escaped. Admittedly the library should handle this so I'll add this in as an amendment and put a new version up for download. In the meantime you can get around this by swapping you single quotes for double quotes and your double quotes for single quotes. I did try and put an example here but it kept getting stripped... 2. Multiple markers at the same location This is a bit more tricky. If it was me however I would recommend trying something like so: Code: // get your list of shop addresses from the database ordered by 'lat' primarily, then 'lng' I haven't tested that code so no doubt some amendments will be needed but it should put you on the right path. Give me a shout if I can be of any more help ![]() Good luck! Steve Question on infowindow_content of Google Map API V3 - El Forum - 02-03-2012 [eluser]Desmond[/eluser] Thanks so so much, Steve. It works perfectly !! You save my life ! :lol: Really great works and logic, please keep going ;-) I do very enjoy using your library, it's simple to use and working very well. Question on infowindow_content of Google Map API V3 - El Forum - 02-03-2012 [eluser]Desmond[/eluser] Hi Steve, I have one more question but it's not codeIgniter, it's about SQL. I am a newbie. Sorry for keep asking questions. I have searched the solution for two days. I will be very grateful if you can help me. In my phpmyadmin SQL database, I have hundreds of Google map URL. I want to change them into lag and lng automatically. For example: http://maps.google.com.hk/maps?f=q&source=embed&hl=zh-TW&geocode;=&q=軒尼詩道+438+號&aq;=&sll=22.279427,114.181616&sspn=0.012191,0.016544&brcurrent=3,0x34040055b36dac7f:0x23fa8b1e7120c6a,0,0x3404004c435d4ad9:0x6e0e524894ae1a66&ie=UTF8&hq;=&hnear;=軒尼詩道438號&ll=22.279429,114.181622&spn=0.000496,0.000587&z=19&iwloc=A How can I write a SQL instruction to extract lag and lng out of it? Seems all lag and lng are after & ll= In the example: &ll=22.279429,114.181622 Thanks so much if anyone could help ;-) |