Commit 76a4f07b by niuxiaolin

latest ui 08/06/2019 19:16:14

parent e768663a
...@@ -36,6 +36,7 @@ import { Scetion } from '../model/scetion'; ...@@ -36,6 +36,7 @@ import { Scetion } from '../model/scetion';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration'; import { Configuration } from '../configuration';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
//import {environment} from '../../../environments'; //import {environment} from '../../../environments';
@Injectable() @Injectable()
...@@ -48,13 +49,18 @@ export class DefaultService { ...@@ -48,13 +49,18 @@ export class DefaultService {
public configuration = new Configuration(); public configuration = new Configuration();
constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
if (basePath) { if(environment.production){
this.basePath = basePath; this.basePath="/";
} }else{
if (configuration) { this.basePath = "https://localhost:443";
this.configuration = configuration; }
this.basePath = basePath || configuration.basePath || this.basePath; // if (basePath) {
} // this.basePath = basePath;
// }
// if (configuration) {
// this.configuration = configuration;
// this.basePath = basePath || configuration.basePath || this.basePath;
// }
} }
/** /**
......
...@@ -489,6 +489,14 @@ ...@@ -489,6 +489,14 @@
} }
var index = 1; var index = 1;
var step = 0.5; var step = 0.5;
var currency = 1;
if(map.getZoom()>=10){
step = 2;
currency=1.4;
}else{
step = 0.5;
currency = .5;
}
var current = Object.assign({},points[0]); var current = Object.assign({},points[0]);
var movStart = Object.assign({},points[0]); var movStart = Object.assign({},points[0]);
var next = points[index]; var next = points[index];
...@@ -550,7 +558,7 @@ ...@@ -550,7 +558,7 @@
next = points[index]; next = points[index];
} }
// console.log(Math.sqrt(Math.pow((current.x - next.x), 2) + Math.pow((current.y - next.y), 2))) // console.log(Math.sqrt(Math.pow((current.x - next.x), 2) + Math.pow((current.y - next.y), 2)))
if (Math.sqrt(Math.pow((current.x - next.x), 2) + Math.pow((current.y - next.y), 2)) > 1) { if (Math.sqrt(Math.pow((current.x - next.x), 2) + Math.pow((current.y - next.y), 2)) > currency) {
drawLine(movStart,current); drawLine(movStart,current);
current.x += getStep(movStart, next).stepx; current.x += getStep(movStart, next).stepx;
current.y += getStep(movStart, next).stepy; current.y += getStep(movStart, next).stepy;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment