Home Html How to integrate google map using gmaps.js in php example?

How to integrate google map using gmaps.js in php example?

by Shahriar Sagor

Today now in this post i will show you How to integrate google map using gmaps.js in php example? So here i am going to show you an example of how to create a simple google map in PHP. Now in this example i will be use gmaps.js plugin for integrate the google map with marker of our location. We can simply generate the google map in our any php framework as like laravel framework, codeigniter framework, or zend framework, cakephp framework or any others.

We know Gmaps.js plugin is provide us map events, markers, Geolocation, Geolocation etc. So we can use this very simply and also use our project.

Example:
<!DOCTYPE html>
<html>
<head>
  <title>Google map integration in php example</title>
  <script src="http://maps.google.com/maps/api/js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/gmaps.js/0.4.24/gmaps.js"></script>
  <style type="text/css">
    #mymap {
      border:1px solid red;
      width: 800px;
      height: 500px;
    }
  </style>
</head>
<body>
  <h1>Google map integration in php example</h1>
  <div id="mymap"></div>
  <script type="text/javascript">
    var mymap = new GMaps({
      el: '#mymap',
      lat: 23.8103,
      lng: 90.4125,
      zoom:6
    });
    mymap.addMarker({
      lat: 23.8103,
      lng: 90.4125,
      title: 'Dhaka',
      click: function(e) {
        alert('dhaka Bangladesh');
      }
    });
  </script>
</body>
</html>

Read Also: How to implement infinite ajax scroll pagination in Laravel?

Thanks for read. I hope it help you. For more you can follow us onĀ facebook

close

You may also like