Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
GoogleMAPAPI question

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
rts5678
Smarty n00b


Joined: 08 Aug 2006
Posts: 2

PostPosted: Sun Aug 13, 2006 9:35 pm    Post subject: GoogleMAPAPI question Reply with quote

Hi,

On any page where I wish to show the map, part of the code I have is given below:

$map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>');


Is there a way for me to insert the address "621 N 48th St # 6 Lincoln NE 68502" in the above line dynamically?

The thing is I am displaying addresses dynamically from a database, so I can't hardcode the address as shown above.

Is there a way for the GoogleMapAPI to accept address that I generate dynamically and if so...how? Can I get any pointers?

Thank you very much in advance.


Last edited by rts5678 on Wed May 05, 2010 11:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
shannera
Administrator


Joined: 13 Feb 2006
Posts: 802
Location: Edertal, Germany

PostPosted: Mon Aug 14, 2006 7:47 am    Post subject: Reply with quote

Have you already tried to replace the adress string with a variable with the same content? If not, why not?

It is normal php behaviour that a function doesn't care if it is called with a string in slashes or with a string variable, as long as a string is supplied.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7036
Location: Lincoln Nebraska, USA

PostPosted: Mon Aug 14, 2006 1:31 pm    Post subject: Reply with quote

This is php ya know Wink

[php:1:02be1bd807]$map->addMarkerByAddress($address,$name,$name);[/php:1:02be1bd807]
Back to top
View user's profile Send private message Visit poster's website
ronberry
Smarty n00b


Joined: 10 Oct 2007
Posts: 3

PostPosted: Thu Oct 11, 2007 4:34 pm    Post subject: dynamic addresses - resolved Reply with quote

Found my answer...thx

I have tried adding addresses dynamically with an included text file - no go

It just echos the contents to the top of the page with no results on the map
and no map, just the frame.

I have tried adding them with a file_get_contents (same text file) then exploding the contents and using a foreach statement to cycle through the addresses into a $map->addMarkerByAddress($streetname); statement - no go

Is the following line a smarty statement?
[php:1:02be1bd807]$map->addMarkerByAddress($address,$name,$name);[/php:1:02be1bd807]

I'm not familiar with the [php:1:02be1bd807] portion.

Thanks in advance

Ron
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP