Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 1    Views: 46

GJvanWijk
I hate code!
Profile
Posts: 95
Reg: Dec 19, 2011
location unknow...
6,000
03/06/14 03:45 AM (10 years ago)

Navigation question for Location Map plugin.

I'm using this nice peace of code to display a list of locations on a map. This works fine but I would like to add an extra feature to this location list. When someone taps one of the pins I would like to get the 'navigate to' dialog. I know this is possible with a single location I add in the plugin screen but I don't know how to manage this behaviour from a table containing all the locations. Any idea. Thx in advance. Gert-Jan ________ the code I'm using now ____________ <?php $db = mysql_connect("localhost", "dbuser", "password"); mysql_select_db("dbnamel",$db); $result = mysql_query("SELECT ID, Latitude, Longitude, Description from theguide",$db); $num = mysql_num_rows($result); $i = 1; print "{"childItems":["; if ($myrow = mysql_fetch_array($result)) do { printf("{"itemId":"%s",", $myrow["ID"]); print ""itemType":"BT_MapLocation","; printf(""latitude":"%s",", $myrow["Latitude"]); printf(""longitude":"%s",", $myrow["Longitude"]); printf(""title":"%s"}", $myrow["Description"]); if ($num > $i) printf(","); $i++; } while ($myrow = mysql_fetch_array($result)); else { echo "Sorry, nothing there to see!"; } print "]}"; ?>
 
GJvanWijk
I hate code!
Profile
Posts: 95
Reg: Dec 19, 2011
location unknow...
6,000
like
03/06/14 03:48 AM (10 years ago)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.