Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HEREMap.prototype.addMarker = function(coordinates, icon) {
- var markerOptions = {};
- var icons = {
- iceCream: {
- url: './images/marker-gelato.svg',
- options: {
- size: new H.math.Size(26, 34),
- anchor: new H.math.Point(14, 34)
- }
- },
- origin: {
- url: './images/origin.svg',
- options: {
- size: new H.math.Size(30, 36),
- anchor: new H.math.Point(12, 36)
- }
- },
- destination: {
- url: './images/destination.svg',
- options: {
- size: new H.math.Size(30, 36),
- anchor: new H.math.Point(12, 36)
- }
- }
- };
- if (icons[icon]) {
- markerOptions = {
- icon: new H.map.Icon(icons[icon].url, icons[icon].options)
- };
- }
- var marker = new H.map.Marker(coordinates, markerOptions);
- this.map.addObject(marker);
- return marker;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement