google maps from address with jquery

One of my client need this feature of google maps from address so he must be able to enter the address in its admin panel and he want to show it as google map on front end.So i made this option for him and new post for my blog.you can use this code with any language like php c# java etc or any framework.googlemap by address

Google maps from address with jquery and map api

The idea behind google map from address is simple.It is based on reverse geocoding google map.I am using google map v3 api.

Lets get right to the topic

we will use google map api
https://maps.googleapis.com/maps/api/js?sensor=false
and jquery
https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js

To get map from google you need location’s longitude latitude
you can get location geocode from google map Geocoder function.

How google maps from address works

google map latitude longitude

Stage 1 : Your Address goes to geocoder.
address includes address, city/town , State, postalcode and country.
Function : google.maps.Geocoder();

Stage 2 : Geocoder fetch your address’s latitude and longitude.

Stage 3: These latitude and longitude value passed to the google map function.
Function : google.maps.Map();

Stage 4: The google map then represent these latitude and longitude value in map.
you can design your info window of address here by
Function : google.maps.InfoWindow()

Also you can set the title of your location by marker function.
Function : google.maps.Marker()

Feature of google maps from address widget

  • You can select from all the four view of google map.
    ROADMAP displays the normal, default 2D tiles of Google Maps.
    SATELLITE displays photographic tiles.
    HYBRID displays a mix of photographic tiles and a tile layer for prominent features.
    TERRAIN displays physical relief tiles for displaying elevation and water features.
  • You can set the zoom level of the map.
  • You can get longitude latitude from google maps address(can find geocode).
  • Find location by latitude longitude google map.

Download section

Live Demo Download Source

Login with facebook and google php script

Login with Facebook and Google is not so much tricky .In this post we will discuss about facebook and google login in php with OAuth2 and at the end of the post you can download the utility( Login with Facebook and Google php script ).login with facebook and google php script free

while i was working on this project i encountered with some errors like:

  • Fatal error: Uncaught exception ‘Google_AuthException’ with message ‘Error fetching OAuth2 access token, message: ‘invalid_grant’
  • Page is not redirect properly during facebook login.

well “Fatal error: Uncaught exception ‘Google_AuthException’” this error was nothing but confliction of google OAuth with facebook login To resolve this we use a two way switch method.
when user login with facebook then we lock Google login and when user login with google then we lock Facebook login.

before Login with Facebook and Google You need to do some task at developer account of facebook and google

At Facebook End

  • Login your facebook.
  • Go To : Facebook Apps.
  • Now create a new apps there, in section Website with Facebook login enter the url where you want the data of Facebook user.
    login with facebook free php script

Now note api key and secret.

At Google end

  • login your google account
  • Go to manage domain
  • Add and verify your domain.after verification your domain will be active.
  • Go to google console.
  • In API Access Menu Create a client id.
  • Now check on web application , Enter your Doman and callback Uri where you want the data of google user.
    login with google phpscript free

Now note api key and secret.

How To Use login with Facebook and Google KIT

  • Open the facebook.config.php
  • Paste your apps id and secret.
require_once dirname(dirname(__FILE__)).'/facebook/facebook.php';

$facebook = new Facebook(array(

'appId' =>'your apps ID',

'secret' => 'App Secret',

'cookie' => true ,

));

?>
  • For google Login open google.config.php
  • paste your site_name,oauth2_client_id,oauth2_client_secret and oauth2_redirect_uri.
global $apiConfig;
$apiConfig = array(

'site_name' => 'enter your domain name',
'oauth2_client_id' => 'client id',
'oauth2_client_secret' => 'client secret',
'oauth2_redirect_uri' => 'redirect uri',
'use_objects' => false,

for local database setup
edit config.php

$host = "your host";
$data_b ="your database name";
$db_user ="db username";
$db_pwd ="db password";

this Login with facebook and google php script is free and can be integrated with mvc system easily.
Now download for free happy coding.

Live Demo Download