show points on google map

google-maps, php

Solution

It's very easy, just read data from database, send it to client in json format and plot it in mail

refer following link,

https://developers.google.com/maps/documentation/javascript/markers

sample data

[{'latitude':'59.327383','longitude':'18.06747','title':'test'}....]

following is sample code

var center = new google.maps.LatLng('center latitude','center longitude'); // set center location

var mapOptions = {
  zoom: 4,
  center: center
}

var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);

for(var m in points) {
    var myLatlng = new google.maps.LatLng(points[m].latitude,points[m].longitude);

    // To add the marker to the map, use the 'map' property
    var marker = new google.maps.Marker({
        position: myLatlng,
        map: map,
        title:points[m].title
    });
}

Problem

I have list of coordinates in my database, I want to show that list of property on Google map using API, like this: red mark are my coordinates/places how is it possible any idea.

Original source