Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. HEREMap.prototype.addMarker = function(coordinates, icon) {
  2. var markerOptions = {};
  3.  
  4. var icons = {
  5. iceCream: {
  6. url: './images/marker-gelato.svg',
  7. options: {
  8. size: new H.math.Size(26, 34),
  9. anchor: new H.math.Point(14, 34)
  10. }
  11. },
  12. origin: {
  13. url: './images/origin.svg',
  14. options: {
  15. size: new H.math.Size(30, 36),
  16. anchor: new H.math.Point(12, 36)
  17. }
  18. },
  19. destination: {
  20. url: './images/destination.svg',
  21. options: {
  22. size: new H.math.Size(30, 36),
  23. anchor: new H.math.Point(12, 36)
  24. }
  25. }
  26. };
  27.  
  28. if (icons[icon]) {
  29. markerOptions = {
  30. icon: new H.map.Icon(icons[icon].url, icons[icon].options)
  31. };
  32. }
  33.  
  34. var marker = new H.map.Marker(coordinates, markerOptions);
  35. this.map.addObject(marker);
  36.  
  37. return marker;
  38. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement