Skip to content

Commit

Permalink
fix(map): fix jump to incident center
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo014 committed Feb 6, 2025
1 parent 9f74fc5 commit 416c62f
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/pages/phone/PhoneSystem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1285,28 +1285,15 @@ export default defineComponent({
}

Check warning on line 1285 in src/pages/phone/PhoneSystem.vue

View check run for this annotation

Codecov / codecov/patch

src/pages/phone/PhoneSystem.vue#L1284-L1285

Added lines #L1284 - L1285 were not covered by tests
function fitLocation(location: Location) {
console.log(location)
mapUtils.value!.fitLocation(location);

Check warning on line 1289 in src/pages/phone/PhoneSystem.vue

View check run for this annotation

Codecov / codecov/patch

src/pages/phone/PhoneSystem.vue#L1287-L1289

Added lines #L1287 - L1289 were not covered by tests
}
function getIncidentCenter() {
const { incident_center } = Incident.find(
currentIncidentId.value,
) as Incident;
if (locationModels.length > 0) {
for (const location of locationModels) {
fitLocation(location);
}
} else {
const center = averageGeolocation(
mapUtils.value
?.getPixiContainer()
?.children.map((marker) => [marker.x, marker.y]),
);
if (center.latitude && center.longitude) {
mapUtils.value.getMap().setView([center.latitude, center.longitude], 6);
}
}
return [35.746_512_259_918_5, -96.411_509_631_256_56];
return [incident_center.coordinates[1], incident_center.coordinates[0]];

Check warning on line 1296 in src/pages/phone/PhoneSystem.vue

View check run for this annotation

Codecov / codecov/patch

src/pages/phone/PhoneSystem.vue#L1296

Added line #L1296 was not covered by tests
}
function goToIncidentCenter() {
Expand Down

0 comments on commit 416c62f

Please sign in to comment.