如何添加星级评分系统

编程入门 行业动态 更新时间:2024-10-27 17:15:59
本文介绍了如何添加星级评分系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨到目前为止,我正在使用谷歌地图,我从帮助中获得的是用户可以向地图添加位置。我想要一个星级评分系统,我看了几个在线论坛,但不太明白。以下是我的代码

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

<!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="maps.googleapis/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

推荐答案

更多推荐

如何添加星级评分系统

本文发布于:2023-11-25 01:30:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627760.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:星级   评分   系统

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!