|
 |
|
รบกวนหน่อยคะอยากทราบเรื่องการปักหมุดบน googlemap เมื่อปักหมุดแล้วมาแสดงเป็นชื่ออำเภอของสถานที่นั้น โดยมาแสดงที่ textbox |
|
 |
|
|
 |
 |
|
รบกวนหน่อยคะอยากทราบเรื่องการปักหมุดบน googlemap เมื่อปักหมุดแล้วมาแสดงเป็นชื่ออำเภอของสถานที่นั้น โดยมาแสดงที่ textbox
โดยมีสคริปต์แบบนี้คะ แต่สคริปต์นี้ยังขาด ส่วนเกี่ยวกับการ geocoder อะคะ
ไฟล์ Map.js
var map;
var marker = [];
var count;
var geocoder;
function initialize() {
count = 0;
geocoder = new google.maps.Geocoder(); // เรียกใช้งานข้อมูล Geocoder ของ Google Map
var myLatlng = new google.maps.LatLng(9.134639, 99.316406);
var myOptions = {
zoom: 8,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
google.maps.event.addListener(map, 'rightclick', function (event, latLng) {
placeMarker(event.latLng);
});
}
function placeMarker(location) {
marker[count++] = new google.maps.Marker({
position: location,
draggable: true, //ลาก marker ได้
map: map
});
map.setCenter(location);
}
function getCoor(index, field) {
if (parseInt(index) < parseInt(count)) {
document.getElementById(field).value = marker[index].getPosition().toUrlValue();
}
}
function ReMaps() {
if (map != null) {
google.maps.event.trigger(map, 'resize');
}
}
Tag : .NET, JavaScript, VS 2010 (.NET 4.x)

|
|
 |
 |
 |
 |
Date :
2012-09-15 03:57:07 |
By :
neel |
View :
1274 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองดูบทความคุณเดี่ยวหรือยังครับ เขียนตัวอย่างไว้หลายตัวครับ ลองค้นหาดูก็ได้ครับ 
|
 |
 |
 |
 |
Date :
2012-09-18 11:41:53 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|