angular-heremaps
Version:
Angular directive for working with Nokia Here Maps
35 lines (26 loc) • 769 B
JavaScript
module.exports = function(){
function MarkerInterface(){
throw new Error('Abstract class! The Instance should be created');
}
var proto = MarkerInterface.prototype;
proto.create = create;
proto.setCoords = setCoords;
proto.addInfoBubble = addInfoBubble;
function Marker(){}
Marker.prototype = proto;
return Marker;
function create(){
throw new Error('create:: not implemented');
}
function setCoords(){
this.coords = {
lat: this.place.pos.lat,
lng: this.place.pos.lng
}
}
function addInfoBubble(marker){
if(!this.place.popup)
return;
marker.setData(this.place.popup)
}
}