Dynamic Google Map
Autor: Dave R.
Besucht 1218,
Followers 1,
Geteilt 0
I have a website which allows users to select a specific street address from a list. Details are then displayed.
I would like a google maps link to the specific street address being displayed.
Can this be done dynamically?
Thanks in anticipation.
Gepostet am
Hello Dave
Yes - this can be done.
On the page where you have the list, you should also have an iframe you give an ID/name.
Then in the listb make a targeted link that opens in the iframe.
I have an example:
Herer: https://www.bramminginfo.dk/sneum-digeso.html
Near bottom of the page is a blue bar.
Clicking this bar "Klik her for at vælge en video...."
Clicking the bar will open a list.
Clicking on a line in the list (the list could have been made with more fields) will open the YouTube link in the iframe below.
Hope it was something like this you meant
Another way could be to use a database, where you to the left show a list of records - and then to the right show a detail view of a record that is selected in the list.
Example of that here: http://eksempelsite.dk/udstillinger/Udstilling_view.php
I studied your map-image one more time.
If what you want is a link in the detail view that opens a map, then you could have another iframe or use the same.
The link could be constructed as they show here: https://www.w3schools.com/tags/att_a_target.asp
You could also in the detail view have an iframe that shows the map.
Is your data coming from a CSV-file or a database or...?
You could also use something like this: https://pindown.eu/predemo/index.php?fpath=pdfiles
Try the "List view" and then imagine that it was the detail information you saw. Then try to click on a marker/image and see a fly to the location.
There is a lot of possibilities - the difficulty is to find the right one.
Autor
Thanks John, I've been distracted as something more impotant (and urgent!) turned up. I won't get a chance to look at this now until next week. I will keep you informed.
Dave
Autor
PS data from mySQL database
Autor
A lightbulb moment!
I already have latitude and longitude stored with the address, so the answer is blindingly obvious, and I should have spotted this at the begining instead of looking for the wrong answer!
Thanks for your help, and happy midwinter to all