 |
google map ช่วยดูให้ทีครับเกี่ยวกับ polygon เกี่ยวกับ title และ infowindow |
|
 |
|
|
 |
 |
|
คือผมต้องการใส่ title ให้กับ polygon ไม่ทราบว่าต้องใส่ยังไงครับแล้ว แล้วถ้าเม้าวางเหนือ polygon ให้แสดง infowindow คือตอนนี้ถ้าเอาเม้าวางบนpolygon ทำให้เกิด action ได้แล้วแต่ ทำให้เป็น infowindow ไม่เป็น เอาเป็นให้ infowindow แสดงคำว่า สวัสดี ก็ได้ครับเดี๋ยวผมเอาไปดัดแปลงเอง ช่วยทีนะครับ
Code (JavaScript)
var polygon = new GPolygon([
new GLatLng(12.656418,100.991821), //1
new GLatLng(12.663117,100.991821),//2
new GLatLng(12.91623,101.083832), //3
new GLatLng(13.087504,101.177216), //4
new GLatLng(13.083491,101.561737), //5
new GLatLng(13.167748,101.645508), //6
new GLatLng(13.143678,101.6922), //7
new GLatLng(12.861343,101.824036), //8
new GLatLng(12.692593,101.778717), //9
new GLatLng(12.594774,101.417542), //9
new GLatLng(12.656418,100.991821) //1
], bankokcolor, 2, 1, bankokcolor, 0.3);
map.addOverlay(polygon);
GEvent.addListener (polygon,"mouseover", function () { alert('infowindow'); } );
Tag : PHP, JavaScript
|
|
 |
 |
 |
 |
Date :
2010-11-29 03:58:56 |
By :
airzio |
View :
1021 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
var polygon = new GPolygon([
new GLatLng(12.656418,100.991821), //1
new GLatLng(12.663117,100.991821),//2
new GLatLng(12.91623,101.083832), //3
new GLatLng(13.087504,101.177216), //4
new GLatLng(13.083491,101.561737), //5
new GLatLng(13.167748,101.645508), //6
new GLatLng(13.143678,101.6922), //7
new GLatLng(12.861343,101.824036), //8
new GLatLng(12.692593,101.778717), //9
new GLatLng(12.594774,101.417542), //9
new GLatLng(12.656418,100.991821) //1
], bankokcolor, 2, 1, bankokcolor, 0.3);
map.addOverlay(polygon);
var coor;
var m;
GEvent.addListener (polygon,"mouseover", function () {
var lg = polygon.getLatLng();
coor = new GLatLng(lg.lat(),lg.lng());
m = new GMarker(coor, {draggable: false, icon:home});
m.bindInfoWindow('TEST');
map.addOverlay(m);
}
);
ยังไม่ได้ลองครับ หากผิดพลาด ขออภัย
|
 |
 |
 |
 |
Date :
2010-11-29 10:23:26 |
By :
kalamell |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คือผมไม่ต้องการ มุดอะครับเพราะว่าผมต้องสร้าง polygon หลายรูปอ่ะครับ
|
 |
 |
 |
 |
Date :
2010-11-29 11:36:12 |
By :
airzio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแล้วมันไม่ได้อ่ะครับ
|
 |
 |
 |
 |
Date :
2010-11-29 11:40:01 |
By :
airzio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|