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

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

In this post we will give you information about How to integrate google map using gmaps.js in php example?. Hear we will give you detail about How to integrate google map using gmaps.js in php example?And how to use it also give you demo for it if it is necessary.

Today, i am going to show you how to create simple google map in PHP. In this example i use gmaps.js plugin for integrate google map with marker of your location. You can simply generate google map in your any php framework like laravel framework, codeigniter framework, zend framework, cakephp framework etc.

Gmaps.js plugin provide us map events, markers, Geolocation, Geolocation etc. you can use very simply and use your project.

Bellow example you can see i added one marker on my location and also setted title, so you can also see demo and preview after bellow example file.

Preview:

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: 21.170240,

lng: 72.831061,

zoom:6

});


mymap.addMarker({

lat: 21.170240,

lng: 72.831061,

title: 'Surat',

click: function(e) {

alert('This is surat, gujarat from India.');

}

});


</script>


</body>

</html>

You can get more information about gmaps.js plugin from here : Gmaps JS.

Hope this code and post will helped you for implement How to integrate google map using gmaps.js in php example?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

3  +  5  =  

We accept paid advance and paid guest Posting on our Site : Contact US