小编use*_*590的帖子

带有多边形的Google Maps API

(请原谅我的英语不好)我的多边形的顶部存储在我的数据库中(纬度,经度).所以我在一张桌子上恢复了纬度和经度,然后画了我的多边形.我的问题是,3个顶部它工作正常,但当它超过3时,它给出了这个结果:

地图

这是我的代码:

success: function(data) {
                             //   alert(data); 
                    var tableauPointsPolygone = new Array ();                          
                    var j=0;
                    var somme=0;
                    $.each(data, function(i, item) {
                                tableauPointsPolygone.push(new google.maps.LatLng(item.latitude, item.longitude));
                                somme+= parseInt(item.valeur);
                                j++;
                                addMarker(item.latitude,item.longitude,item.adr);
                                center = bounds.getCenter();
                                map.fitBounds(bounds);
                    // alert(item.latitude);
});
var monPolygone = new google.maps.Polygon();
monPolygone.setPaths( tableauPointsPolygone );
monPolygone.setMap( map );
if (somme/j<5)
monPolygone.setOptions({strokeWeight: 3,strokeColor: '#582900' ,fillColor: '#1FA055'});
else
monPolygone.setOptions({strokeWeight: 3,strokeColor: '#582900' ,fillColor: '#A91101'});
                                },
Run Code Online (Sandbox Code Playgroud)

javascript google-maps google-maps-api-3

6
推荐指数
1
解决办法
268
查看次数

如何用MySQL数据库创建角色

有没有办法使用CREATE ROLEMySQL?

可以使用PostgreSQL创建角色,但是当我尝试使用MySQL时,它会返回以下错误消息:

#1064 - 您的SQL语法有错误; 检查与MySQL服务器版本对应的手册,以便在第1行的'role famille'附近使用正确的语法

mysql roles grant

3
推荐指数
2
解决办法
1万
查看次数

[Ljava.lang.Object; 不能被误导

我得到了一份清单query.list().之后,我想在此列表中显示该对象,但我在此行中收到此错误for(Commerce[] c: this.newsList) {

java.lang.ClassCastException:[Ljava.lang.Object; 不能投[Lcom.model.Commerce; com.action.CommerceAction.searchCommerces(CommerceAction.java:35)

这是我的代码:

我的商业服务

public List<Commerce[]> getCommercesBySearch(String categorie, String lieux) {
    Query query = hibUtil.getSession().createQuery("from Commerce c, Categorie ca,Lieux l "
            + "where c.categorie=ca.idCategorie and c.lieux=l.idLieux and"
            + " ca.libelle='" + categorie + "' and l.ville='" + lieux + "' ");
    List<Commerce[]> tuples = (List<Commerce[]>) query.list();
    return tuples;
}
Run Code Online (Sandbox Code Playgroud)

我的动作课

private CommerceService service;
private Commerce commerce = new Commerce();
private List<Commerce[]> newsList;
public String searchCommerces() {
    String libelle = ServletActionContext.getRequest().getParameter("libelle");
    String ville …
Run Code Online (Sandbox Code Playgroud)

java hibernate

3
推荐指数
1
解决办法
2万
查看次数