-3

Friends, I'm novice in googlmap api I want to use google maps to show location of places, while I only have places names in database, basically I want to put a marker on the given name of location in database. I'm using php, mysql, javascript. thanks.

  • 2
    Okay, what have you tried so far? – Epodax May 18 '15 at 13:32
  • @Epodax I'm searching way as I don't have prior knowledge of google map usage. So I'm still learning ways and searching. haven't done anything else. – Muzammil Hussnain May 18 '15 at 13:35
  • 1
    SO isn't going to code it for you, give it a try yourself and come back if you run into a error. (And no, we can't offer guides / How-to's either, it's off-topic). – Epodax May 18 '15 at 13:37

1 Answers1

1

You could use an iframe with the Google Maps url in it. In that url, you can add a database value by a php variable. Don't forget you need a google api key!

An example iframe:

<iframe
  width="600"
  height="450"
  frameborder="0" style="border:0"
  src="https://www.google.com/maps/embed/v1/place?q=Brugge,+België&key=...">
</iframe>

In php, you could add a dynamic database value into the url after 'q'. An example:

<?php
    echo '<iframe
       width="600"
       height="450"
       frameborder="0" style="border:0"
       src="https://www.google.com/maps/embed/v1/place?q=' .placevariable. '&key=...">
    </iframe>';
?>
Laurent
  • 523
  • 6
  • 15
  • Dear Thanks for your reply, i have tried given code but it says `The Google Maps API server rejected your request. Invalid request. Invalid 'q' parameter.` again thanks for your reply – Muzammil Hussnain May 18 '15 at 15:35
  • 1
    ow, ofcourse, you don't need the "" in the src. I will update the answer. – Laurent May 19 '15 at 12:40
  • Dear Freind I'm getting api key rejection I'm trying to get api key which I got is not working I'm getting key for Google Maps Embed API. with Thanks dear I'm grateful to your help – Muzammil Hussnain May 19 '15 at 13:54
  • you could try this wizard. It then give you the chance to create an api key: https://developers.google.com/maps/documentation/embed/start?hl=nl – Laurent May 19 '15 at 13:59
  • Thanks It helped a lot. friend in my problem scenario I have to show multiple places while iframe can display only one place – Muzammil Hussnain May 19 '15 at 14:25