Skip to content

Commit

Permalink
testing dragable pins
Browse files Browse the repository at this point in the history
  • Loading branch information
katemat committed Jul 16, 2020
1 parent 5bd5333 commit 5799f81
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 14 additions & 0 deletions public/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,25 @@ const reverseGeocode = function (e) {
//Make the reverse geocode request.
searchManager.reverseGeocode(searchRequest);

// var greenPin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(center.latitude, center.longitude - 0.1), { color: '#0f0', draggable: true });
// map.entities.push(greenPin);

var pin = new Microsoft.Maps.Pushpin(e.location, {
draggable: true,
// title: address
// color: 'green'
});
map.entities.push(pin);

Microsoft.Maps.Events.addHandler(pin, 'drag', function (e) {
highlight('pushpinDrag', e);
});
Microsoft.Maps.Events.addHandler(pin, 'dragend', function (e) {
highlight('pushpinDragEnd', e);
});
Microsoft.Maps.Events.addHandler(pin, 'dragstart', function (e) {
highlight('pushpinDragStart', e);
});
console.log(map.entities);
}
};
Expand Down
3 changes: 0 additions & 3 deletions views/new-item.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
/>
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/style2.css" />
<!-- <script type='text/javascript'
src='http://www.bing.com/api/maps/mapcontrol?callback=getMap&key=AuewOzxuyMxFiwOpCiEiYyNsck-yIwg3nBqGlLukoPc6gZm-v9Eiyw3eBGpPPTDw'
async defer></script> -->
</head>
<body>
<% d = new Date()%> <% month = '' + (d.getMonth() + 1)%> <% day = '' +
Expand Down

0 comments on commit 5799f81

Please sign in to comment.