|
|
@ -98,7 +98,7 @@ export class RouterGISComponent implements OnInit { |
|
|
|
that.map = new AMap.Map('map',{ |
|
|
|
that.map = new AMap.Map('map',{ |
|
|
|
layers:[layer], //当只想显示标准图层时layers属性可缺省,
|
|
|
|
layers:[layer], //当只想显示标准图层时layers属性可缺省,
|
|
|
|
}); |
|
|
|
}); |
|
|
|
that.map.setCity('上海市'); |
|
|
|
that.map.setCity('株洲市');; |
|
|
|
AMap.plugin('AMap.Driving', function() { |
|
|
|
AMap.plugin('AMap.Driving', function() { |
|
|
|
that.startCoordinate && that.endCoordinate? that.queryGISRoute() : null |
|
|
|
that.startCoordinate && that.endCoordinate? that.queryGISRoute() : null |
|
|
|
}) |
|
|
|
}) |
|
|
@ -179,7 +179,7 @@ export class RouterGISComponent implements OnInit { |
|
|
|
this.endCoordinate = null |
|
|
|
this.endCoordinate = null |
|
|
|
this.routeGIS? this.routeGIS.clear() : null |
|
|
|
this.routeGIS? this.routeGIS.clear() : null |
|
|
|
this.routes = { distance: 0, time: 0, steps: [], } |
|
|
|
this.routes = { distance: 0, time: 0, steps: [], } |
|
|
|
this.map.setCity('上海市'); //设置地图中心点
|
|
|
|
this.map.setCity('株洲市'); //设置地图中心点
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//交换起始点
|
|
|
|
//交换起始点
|
|
|
|