abent
abent

Reputation: 319

Create link google maps from place content json list

I used googlemaps API to get places content:

 {
     "geometry" : {
        "location" : {
           "lat" : 21.007178,
           "lng" : 105.854556
        }
     },
     "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
     "id" : "3c82fb7ade3d148ede6360226e0043397e4ce135",
     "name" : "18, 51",
     "place_id" : "ChIJNytjYvWrNTERfKb-r2Bqdv4",
     "reference" : "CnRpAAAAI5c1ZenSc5l8H0Z71O4McKgBI9UjwVcP410JS7Fsc7LGTPx5UtphSud62OLNgADhIYVeXrkCbDPGf3_9aZUxbGyrvqB-JrcuPFVgtFd-lZfMt2fMEmVq6lYBVZfdj2gbW7WwqXsOkVRlsJjgjaQg6hIQQ_fR8a31Skpt8akDUt5CmxoUtNs983MCedA0LZCfivETQ0lpqCI",
     "scope" : "GOOGLE",
     "types" : [ "bus_station", "transit_station", "establishment" ],
     "vicinity" : "40 Võ Thị Sáu, Thanh Nhàn"
  }

How can I create place link to navigate to google maps by web browser from above infomation.

Upvotes: 0

Views: 623

Answers (1)

AniV
AniV

Reputation: 4037

Looks like you are using the Google Places API webservice to get the JSON data. Now if you want to display the data on Maps you have to pass each JSON object (Place or location) in a marker and then initialize that inside a Google Map object.

Instead of doing all this hard work you can directly use the Google Maps Places Library for Javascript API V3 inside your app project. This would automatically enable your application to search for places (defined in this API as establishments, geographic locations, or prominent points of interest) contained within a defined area, such as the bounds of a map, or around a fixed point.

You can find all the information of how to implement it and display it inside the browser by clicking this link.

Hope this would Help!!

Upvotes: 2

Related Questions