Click here to Skip to main content
15,888,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi I am working on google maps so far what i have achieved from help is that a user can add locations to the map. I want to have a star rating system, i ahve looked at few online forums but cannot quite understand it. Below is my code
JavaScript
<!DOCTYPE html>
<html>
  <head>
    <title>Accessing arguments in UI events</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
    <script>
var index=0;
function initialize() {
  var mapOptions = {
    zoom: 4,
    center: new google.maps.LatLng(65.0126304,25.4703071)
  };
  var map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);

  google.maps.event.addListener(map, 'click', function(e) {
    placeMarker(e.latLng, map);
  });
}

function placeMarker(position, map) {
  var marker = new google.maps.Marker({
    position: position,
    map: map
  });
var infowindow = new google.maps.InfoWindow({ content : "<input id='myText" + index + "' type='text'>", id : index
});

  map.panTo(position);
google.maps.event.addListener( marker, "click", function() {
   infowindow.open( map, marker );
});
google.maps.event.addListener( infowindow, "closeclick", function(e) { infowindow.setContent("<input id='myText" + infowindow.id + "' type='text' value='" + document.getElementById("myText" + infowindow.id).value + "'>"); });
index++;
}
google.maps.event.addDomListener(window, 'load', initialize);

index++;
    </script>
  </head>
  <body>
    <div id="map-canvas"></div>
  </body>
</html>


Thanks anyways guys
Posted
Comments
Krunal Rohit 17-Mar-14 5:57am    
You're looking for this :
http://www.aspdotnet-suresh.com/2013/06/7-jquery-star-rating-plugin-examples.html

-KR

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900