pubnub / eon-map

Realtime maps with PubNub and MapBox.
https://www.pubnub.com/developers/eon/
MIT License
135 stars 51 forks source link

Uncaught TypeError: L.RotatedMarker is not a constructor #16

Closed rajnesh0409 closed 7 years ago

rajnesh0409 commented 7 years ago

Uncaught TypeError: L.RotatedMarker is not a constructor.

rajnesh0409 commented 7 years ago

var map = eon.map({ pubnub: pn, id: 'map', mbId: 'ianjennings.l896mh2e', mbToken: 'pk.eyJ1IjoiaWFuamVubmluZ3MiLCJhIjoiZExwb0p5WSJ9.XLi48h-NOyJOCJuu1-h-Jg', channels:[channel], connect: connect,

    marker: function (latlng, data) {

  var marker = new L.RotatedMarker(latlng, {
    icon: L.icon({
      iconUrl: 'http://i.imgur.com/2fmFQfN.png',
      iconSize: [9, 32]
    })
  });

  marker.bindPopup('Route ' + data.routeTag.toUpperCase());

  return marker;

},
    message: function (data) {
      map.setView(data[3].latlng, 13);
    }
  });
rajnesh0409 commented 7 years ago

i resolved that one by including - L.RotatedMarker = L.Marker.extend({ options: { angle: 0 }, _setPos: function(pos) { L.Marker.prototype._setPos.call(this, pos); if (L.DomUtil.TRANSFORM) { // use the CSS transform rule if available this._icon.style[L.DomUtil.TRANSFORM] += ' rotate(' + this.options.angle + 'deg)'; } else if (L.Browser.ie) { // fallback for IE6, IE7, IE8 var rad = this.options.angle * L.LatLng.DEG_TO_RAD, costheta = Math.cos(rad), sintheta = Math.sin(rad); this._icon.style.filter += ' progid:DXImageTransform.Microsoft.Matrix(sizingMethod=\'auto expand\', M11=' + costheta + ', M12=' + (-sintheta) + ', M21=' + sintheta + ', M22=' + costheta + ')'; } } });

Uncaught TypeError: Cannot read property 'routeTag' of undefined - how should i include mapbox functions - i am new to both mapbox and pubnub. i want embed mapbox other functionality to eol map. any docs.