javascript를 사용하여 빙 API를 통해 드래그 가능한 압핀을 넣을 방법이 있습니까? 그 API (자바 스크립트)를 통해 해당 기능을 가질 수 있습니까?javascript bing지도에서 드래그 가능하고 클릭 할 수있는 고정 핀
0
A
답변
1
답변이 있습니다. http://www.bingmapsportal.com/ISDK/AjaxV7#Pushpins13
var pushpinOptions = {icon: 'poi_custom.png', draggable:true};
var pushpin= new Microsoft.Maps.Pushpin(map.getCenter(), pushpinOptions);
pushpindragend= Microsoft.Maps.Events.addHandler(pushpin, 'dragend', enddragDetails);
map.entities.push(pushpin);
0
아직 드래그 압정 및 드래그 인포 박스와 다른 용액
<!DOCTYPE html>
<html>
<head>
<title>pushpinDragEventsHTML</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<style type='text/css'>body{margin:0;padding:0;overflow:hidden;font-family:'Segoe UI',Helvetica,Arial,Sans-Serif}</style>
</head>
<body>
<div id='printoutPanel'></div>
<div id='myMap' style='width: 100vw; height: 100vh;'></div>
<script type='text/javascript'>
function loadMapScenario() {
var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {});
var center = map.getCenter();
var Events = Microsoft.Maps.Events;
var Location = Microsoft.Maps.Location;
var Pushpin = Microsoft.Maps.Pushpin;
var pins = [
new Pushpin(new Location(center.latitude, center.longitude), { color: '#00F', draggable: true }),
];
// Setting up the pin_coordinates printout panel
document.getElementById('printoutPanel').innerHTML = '<div id="pushpinDragEnd">' + center +'</div>';
var infobox = new Microsoft.Maps.Infobox(
center, {
title: 'Map Center',
description: 'Initail Lable' });
infobox.setMap(map);
map.entities.push(pins);
// Binding the events for the pin
Events.addHandler(pins[0], 'dragend', function() { displayPinCoordinates('pushpinDragEnd'); });
function displayPinCoordinates(id) {
infobox.setMap(null); // delete infobox
var pin_location =pins[0].getLocation();
document.getElementById(id).innerHTML =pin_location; // display pin coordinates in printout panel
// display dragged infobox
infobox = new Microsoft.Maps.Infobox(
pin_location, {
title: 'Pin Center',
description: 'Dragable Lable' });
infobox.setMap(map);
}
}
</script>
<script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?key=yourBingMapsKey&callback=loadMapScenario' async defer></script>
</body>
</html>
관련 문제
- 1. 고정 핀 클릭 이벤트
- 2. scriptaculous에서 핀/고정 드래그 가능한 div
- 3. 고정 된지도에서 고정 핀 누르기 처리
- 4. div의 내부에 드래그 가능하고 크기를 조정할 수있는 텍스트 영역
- 5. GWT 잠금/고정/핀 행
- 6. 지도 뷰의 드래그 가능 핀
- 7. Windows Phone 고정 핀 오버랩
- 8. 자바 스크립트가있는 ArcGIS지도의 고정 핀
- 9. 고정 핀 문자 색 변경
- 10. Javascript div가 서로 위에있을 때 드래그 할 수있는 방법은 무엇입니까?
- 11. Silverlight Bing Maps 고정 핀 스타일
- 12. javascript를 사용하여 줌 가능하고 클릭 할 수있는 불규칙한 모양의 이미지 맵?
- 13. bing지도에서 EntityCollection 클래스로 대체
- 14. 클릭 할 수있는 슬라이드 쇼
- 15. jQuery에서 드래그 할 수있는 정확도
- 16. 클릭 할 수있는 gridview
- 17. jQuery를 사용하여 드래그 가능하고 크기를 조정할 수있는 텍스트 상자/텍스트 영역이 가능합니까?
- 18. JavaScript 드래그 문서/파일을 드래그
- 19. Bing지도 silverlight 컨트롤 맞춤형 고정 핀
- 20. 핀 프로그래밍
- 21. jQuery 드래그 할 수있는 위치 값
- 22. JavaScript Mobile 드래그 앤 드롭
- 23. 안드로이드 : 현재 위치 고정 핀 크기의 정확성
- 24. iPhone SDK의 스크롤 가능하고 클릭 가능한 텍스트
- 25. 클릭 및 드래그
- 26. Dojo에서 스크롤 가능하고 클릭 할 수있는 항목 목록을 만드는 방법은 무엇입니까?
- 27. 사용자가 핀 주석을 클릭 할 때보기를 표시하는 방법은 무엇입니까?
- 28. Qt 클릭 할 수있는 캔버스
- 29. DataGrid 클릭 할 수있는 행
- 30. 클릭 할 수있는 콤보 박스