BMapModel.js 805 B

1234567891011121314151617181920212223242526272829303132333435
  1. define(function (require) {
  2. function v2Equal(a, b) {
  3. return a && b && a[0] === b[0] && a[1] === b[1];
  4. }
  5. return require('echarts').extendComponentModel({
  6. type: 'bmap',
  7. getBMap: function () {
  8. // __bmap is injected when creating BMapCoordSys
  9. return this.__bmap;
  10. },
  11. setCenterAndZoom: function (center, zoom) {
  12. this.option.center = center;
  13. this.option.zoom = zoom;
  14. },
  15. centerOrZoomChanged: function (center, zoom) {
  16. var option = this.option;
  17. return !(v2Equal(center, option.center) && zoom === option.zoom);
  18. },
  19. defaultOption: {
  20. center: null,
  21. zoom: 1,
  22. mapStyle: {},
  23. roam: false
  24. }
  25. });
  26. });