tags:

views:

36

answers:

0

hi i am new to google maps api. i have a social app that diasplays the registerd user on a google map. App is based on Django. I have a little snippet to display the google maps. here is the code.

  <html style="height:100%;">
  <head>
  <title>HOtNet MAP</title>
  <script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;" type="text/javascript">
  </script>
  </head>
  <body onload="" onunload="GUnload()" style="height:100%;padding:0;margin:0;">
  <script type="text/javascript">
  var map_long = 73.045471;
  var map_lat = 33.663864;
  var map_zoom = 5;
  var registers = [{% for hotnet in friends_list %}[{{hotnet.longitude}}, {{hotnet.latitude }},'{{ hotnet.user }}','{{ hotnet.Status }}','{{ hotnet.Availability }}']{% if not forloop.last %},{% endif %}{% endfor %}];
  </script>

 <div id="map" style="height:100%;width:100%;">
</div>

<script type="text/javascript">
function addregisterMarker(lng, lat, username,Status, Availability) {
var markerpt = new GPoint(lng, lat);
var marker = new GMarker(markerpt);
var html = '<b>' + username + '</b><br>' +  Status + '</b><br>'+Availability 
GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); });
map.addOverlay(marker);
}

if (GBrowserIsCompatible()) {
var map_div = document.getElementById("map");
var map = new GMap2(map_div);

map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());

var pt = new GLatLng(top.map_lat, top.map_long);
map.setCenter(pt, 17 - top.map_zoom);

if (registers) {
    for (var i=0; i < registers.length; i++) {
        addregisterMarker(registers[i][0], registers[i][1], registers[i][2], registers[i][3], registers[i][4]);
      }
      }
    }
   </script>

   </body>
  </html>

Now i want here is to change the marker colour for each user, suppose for user 1 marker color may be blue and for user2 marker color is pink and soo on. i need it for just 10 users. any idea what i have to modify in the above code