Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. /**
  2. * Mocking fake map for testing
  3. */
  4. function MapboxGLMockMap() {
  5. this.style = {
  6. getLayer: function() { },
  7. removeLayer: function() { }
  8. };
  9. this.transform = {
  10. bearing: 0,
  11. center: { lat: 0, lng: 0 },
  12. zoom: 0
  13. };
  14. }
  15.  
  16. MapboxGLMockMap.prototype.on = function() { return this; };
  17. MapboxGLMockMap.prototype.off = function() { return this; };
  18. MapboxGLMockMap.prototype.remove = function() { return this; };
  19. MapboxGLMockMap.prototype.resize = function() { return this; };
  20. MapboxGLMockMap.prototype.setLayoutProperty = function() { };
  21. MapboxGLMockMap.prototype.setPaintProperty = function() { };
  22. MapboxGLMockMap.prototype.setStyle = function() { };
  23. MapboxGLMockMap.prototype.setView = function() { };
  24. MapboxGLMockMap.prototype.getBearing = function() { return 0; };
  25. MapboxGLMockMap.prototype.getCenter = function() { return { lat: 0, lng: 0 }; };
  26. MapboxGLMockMap.prototype.featuresAt = function(point, opts, cb) {
  27. cb([]);
  28. };
  29.  
  30. module.exports.Map = MapboxGLMockMap;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement