Skip to content

Commit

Permalink
smaller icons on map too
Browse files Browse the repository at this point in the history
  • Loading branch information
karussell committed Sep 20, 2023
1 parent 555dc0d commit 5599679
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 36 deletions.
55 changes: 21 additions & 34 deletions src/api/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,40 +228,27 @@ export class ApiImpl implements Api {
routeWithDispatch(args: RoutingArgs, zoomOnSuccess: boolean) {
const routeNumber = this.routeCounter++

if (true) {
return this.mapMatch(args)
.then(result => {
if (routeNumber > this.lastRouteNumber) {
this.lastRouteNumber = routeNumber
Dispatcher.dispatch(new RouteRequestSuccess(args, zoomOnSuccess, result))
} else {
const tmp = JSON.stringify(args) + ' ' + routeNumber + ' <= ' + this.lastRouteNumber
console.log('Ignore response of earlier started route ' + tmp)
}
})
.catch(error => {})
} else {
return this.route(args)
.then(result => {
if (routeNumber > this.lastRouteNumber) {
this.lastRouteNumber = routeNumber
Dispatcher.dispatch(new RouteRequestSuccess(args, zoomOnSuccess, result))
} else {
const tmp = JSON.stringify(args) + ' ' + routeNumber + ' <= ' + this.lastRouteNumber
console.log('Ignore response of earlier started route ' + tmp)
}
})
.catch(error => {
if (routeNumber > this.lastRouteNumber) {
console.warn('error when performing /route request ' + routeNumber + ': ', error)
this.lastRouteNumber = routeNumber
Dispatcher.dispatch(new RouteRequestFailed(args, error.message))
} else {
const tmp = JSON.stringify(args) + ' ' + routeNumber + ' <= ' + this.lastRouteNumber
console.log('Ignore error ' + error.message + ' of earlier started route ' + tmp)
}
})
}
this.mapMatch(args)
// this.route(args)
.then(result => {
if (routeNumber > this.lastRouteNumber) {
this.lastRouteNumber = routeNumber
Dispatcher.dispatch(new RouteRequestSuccess(args, zoomOnSuccess, result))
} else {
const tmp = JSON.stringify(args) + ' ' + routeNumber + ' <= ' + this.lastRouteNumber
console.log('Ignore response of earlier started route ' + tmp)
}
})
.catch(error => {
if (routeNumber > this.lastRouteNumber) {
console.warn('error when performing /route request ' + routeNumber + ': ', error)
this.lastRouteNumber = routeNumber
Dispatcher.dispatch(new RouteRequestFailed(args, error.message))
} else {
const tmp = JSON.stringify(args) + ' ' + routeNumber + ' <= ' + this.lastRouteNumber
console.log('Ignore error ' + error.message + ' of earlier started route ' + tmp)
}
})
}

private getRoutingURLWithKey(endpoint: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/layers/UseQueryPointsLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function addQueryPointsLayer(map: Map, queryPoints: QueryPoint[]) {
style = new Style({
image: new Icon({
src: 'data:image/svg+xml;utf8,' + createSvg(props),
displacement: [0, MARKER_SIZE / 2],
displacement: [0, 10],
}),
})
cachedStyles[key] = style
Expand Down
2 changes: 1 addition & 1 deletion src/layers/createMarkerSVG.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const MARKER_PATH =
'M 172.968 632.025 C 26.97 291.031 0 269.413 0 192 C 0 85.961 85.961 0 192 0 S 384 85.961 384 192 C 384 269.413 357.03 291.031 213 632 C 193.781 667.361 192.57 667.361 172.968 632.025 Z'
'M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0z'
const INNER_CIRCLE = 'M192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z'

interface MarkerProps {
Expand Down

0 comments on commit 5599679

Please sign in to comment.