2

I am looking for a way to visualize data from Postgres in Google Maps, but I have only figured out how to do this for Markers. I am using PHP to retrieve the data in JSON, which I then request from Google Maps, but I can only find examples for doing this with point data.

  var geocoderFunction = function () { 
        geocoder.geocode({ 'address': road[index] }, 
           function (results, status) {
              if (status == google.maps.GeocoderStatus.OK) {
                 new google.maps.Marker({
                    map: map, 
                    position: results[0].geometry.location
                 });
           }             
   }
1
  • 1
    Look at DataLayers. There are full code samples there for loading, styling and interacting with GeoJSON. Commented Oct 18, 2014 at 8:47

1 Answer 1

1

I don't understand your question very well.

If you are asking how to display a line with the Google Maps API i think that you should check the documentation about Polyline or check the code samples like this one.

4
  • Yes this is i want to make but i have a problem with cordinates i have in 4120 system and i try to convert in 4326 with this query 'ALTER TABLE my_table ALTER COLUMN geom TYPE geometry(Point,4326) USING ST_Transform(geom,4326);' but i take the cordinates as 4120 what i can make because the google maps use 4326 system.
    – vagelis
    Commented Oct 18, 2014 at 14:33
  • That's a different question. Check this answer gis.stackexchange.com/a/70668/4177 or open a new question. As mark this as resolved if it solves your first question Commented Oct 18, 2014 at 17:04
  • Yes Francisco is resolved how i can this question as resolved
    – vagelis
    Commented Oct 18, 2014 at 17:35
  • @vagelis click the check mark in my answer gis.stackexchange.com/help/someone-answers Commented Oct 19, 2014 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.