Skip to content

Commit

Permalink
Merge pull request #113 from armada-ths/feat/map
Browse files Browse the repository at this point in the history
Fix map according to feedbacks
  • Loading branch information
hampfh authored Nov 16, 2024
2 parents 7ea25eb + f16cff8 commit db891d6
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 74 deletions.
Binary file added public/map_icons/startup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
170 changes: 106 additions & 64 deletions src/app/student/map/data/booths.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"properties": {
"id": 32,
"location": "nymble/2",
"exhibitorId": 1524
"exhibitorId": 1590
},
"geometry": {
"coordinates": [
Expand Down Expand Up @@ -175,7 +175,7 @@
"properties": {
"id": 35,
"location": "nymble/2",
"exhibitorId": 1590
"exhibitorId": 1524
},
"geometry": {
"coordinates": [
Expand Down Expand Up @@ -400,27 +400,6 @@
"type": "Polygon"
}
},
{
"id": 48,
"type": "Feature",
"properties": {
"id": 48,
"location": "nymble/2",
"exhibitorId": 1487
},
"geometry": {
"coordinates": [
[
[18.070603683430306, 59.3472623523424],
[18.070645737835235, 59.34727624464375],
[18.070667817921787, 59.34725935264041],
[18.07062534902451, 59.34724524753841],
[18.070603683430306, 59.3472623523424]
]
],
"type": "Polygon"
}
},
{
"id": 49,
"type": "Feature",
Expand All @@ -432,11 +411,11 @@
"geometry": {
"coordinates": [
[
[18.070646141705737, 59.34727618536243],
[18.070686940191678, 59.34728977072399],
[18.07071039950401, 59.34727339749281],
[18.070668329675584, 59.347259436550814],
[18.070646141705737, 59.34727618536243]
[18.07062989277054, 59.347270662509004],
[18.07067069125648, 59.34728424787056],
[18.070693326132158, 59.34726779057368],
[18.070652080740388, 59.34725391369739],
[18.07062989277054, 59.347270662509004]
]
],
"type": "Polygon"
Expand Down Expand Up @@ -469,7 +448,7 @@
"properties": {
"id": 51,
"location": "nymble/2",
"exhibitorId": 1555
"exhibitorId": 1487
},
"geometry": {
"coordinates": [
Expand Down Expand Up @@ -789,11 +768,11 @@
"geometry": {
"coordinates": [
[
[18.070644291377675, 59.34729907217397],
[18.07059525520171, 59.34728312103951],
[18.07061781644481, 59.34726743768326],
[18.0706669031388, 59.34728355765816],
[18.070644291377675, 59.34729907217397]
[18.070650169668113, 59.347301778895115],
[18.07061570821037, 59.34729042237609],
[18.070638169289623, 59.34727439683613],
[18.07067336242531, 59.34728591879852],
[18.070650169668113, 59.347301778895115]
]
],
"type": "Polygon"
Expand Down Expand Up @@ -999,11 +978,11 @@
"geometry": {
"coordinates": [
[
[18.070309559441995, 59.347305940273486],
[18.070343973268052, 59.34728930691935],
[18.070293935400684, 59.34726341318],
[18.070259004538542, 59.34728050531035],
[18.070309559441995, 59.347305940273486]
[18.070299870862755, 59.347299536951084],
[18.070334284688812, 59.34728290359695],
[18.070284246821444, 59.3472570098576],
[18.070249315959302, 59.34727410198795],
[18.070299870862755, 59.347299536951084]
]
],
"type": "Polygon"
Expand All @@ -1020,11 +999,11 @@
"geometry": {
"coordinates": [
[
[18.07027426743838, 59.34732311214046],
[18.070309570194922, 59.34730592962498],
[18.070258902884063, 59.34728051922781],
[18.07022534722202, 59.34729744033541],
[18.07027426743838, 59.34732311214046]
[18.07026454267725, 59.347316635410635],
[18.070299845433794, 59.34729945289516],
[18.070249178122936, 59.347274042497986],
[18.070215622460893, 59.34729096360559],
[18.07026454267725, 59.347316635410635]
]
],
"type": "Polygon"
Expand Down Expand Up @@ -2301,11 +2280,11 @@
"geometry": {
"coordinates": [
[
[18.07157217325343, 59.34811724310683],
[18.07156065379536, 59.348091153391124],
[18.07160381163493, 59.34808625228709],
[18.07161472984714, 59.34811246682298],
[18.07157217325343, 59.34811724310683]
[18.071576968023805, 59.34812151088934],
[18.071566465701977, 59.348097806546036],
[18.071609623541548, 59.348092905442],
[18.071619570020317, 59.34811676331407],
[18.071576968023805, 59.34812151088934]
]
],
"type": "Polygon"
Expand All @@ -2322,11 +2301,11 @@
"geometry": {
"coordinates": [
[
[18.071574012287755, 59.34808968874475],
[18.071564103088207, 59.34806971847385],
[18.07162541021617, 59.348061722760605],
[18.071634936072087, 59.34808227519326],
[18.071574012287755, 59.34808968874475]
[18.071610074461347, 59.34809260878603],
[18.071598106015585, 59.348067527356136],
[18.07164025647532, 59.34806246710119],
[18.071651813774707, 59.34808762867556],
[18.071610074461347, 59.34809260878603]
]
],
"type": "Polygon"
Expand All @@ -2343,11 +2322,11 @@
"geometry": {
"coordinates": [
[
[18.07161469136588, 59.34811248307426],
[18.07165561203493, 59.34810796351917],
[18.071645656224945, 59.348081008856354],
[18.07160390767939, 59.348085985062056],
[18.07161469136588, 59.34811248307426]
[18.071619775242482, 59.348116681692545],
[18.07166096922029, 59.348111594894135],
[18.071651623692304, 59.34808780344332],
[18.07160987514675, 59.34809277964902],
[18.071619775242482, 59.348116681692545]
]
],
"type": "Polygon"
Expand Down Expand Up @@ -2511,11 +2490,11 @@
"geometry": {
"coordinates": [
[
[18.070545843265762, 59.347267161600826],
[18.070595067707075, 59.34728322008746],
[18.07061762592008, 59.34726742687704],
[18.07056919479234, 59.34725149539676],
[18.070545843265762, 59.347267161600826]
[18.0705777350216, 59.34727814334386],
[18.07061571017792, 59.347290476172816],
[18.070638160154346, 59.34727437013717],
[18.07060057126469, 59.34726174399793],
[18.0705777350216, 59.34727814334386]
]
],
"type": "Polygon"
Expand All @@ -2541,6 +2520,69 @@
],
"type": "Polygon"
}
},
{
"id": 166,
"type": "Feature",
"properties": {
"id": 166,
"location": "nymble/2",
"exhibitorId": 1545
},
"geometry": {
"coordinates": [
[
[18.070314374441978, 59.34733703358887],
[18.070360209813714, 59.34731416261371],
[18.0703329351648, 59.34729861034211],
[18.07028628115981, 59.34732166429538],
[18.070314374441978, 59.34733703358887]
]
],
"type": "Polygon"
}
},
{
"id": 167,
"type": "Feature",
"properties": {
"id": 167,
"location": "nymble/2",
"exhibitorId": 1555
},
"geometry": {
"coordinates": [
[
[18.070577776242374, 59.347278163210945],
[18.070600571457646, 59.347261732524174],
[18.07056327990415, 59.34724963692278],
[18.07053957829507, 59.34726591013637],
[18.070577776242374, 59.347278163210945]
]
],
"type": "Polygon"
}
},
{
"id": 168,
"type": "Feature",
"properties": {
"id": 168,
"location": "library",
"exhibitorId": 1638
},
"geometry": {
"coordinates": [
[
[18.071566649991894, 59.34809760531596],
[18.07160982096704, 59.348092740668704],
[18.071598068222414, 59.348067527546135],
[18.071555129974143, 59.34807340072231],
[18.071566649991894, 59.34809760531596]
]
],
"type": "Polygon"
}
}
]
}
8 changes: 4 additions & 4 deletions src/app/student/map/data/nymble.plan2.routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
[18.0705060363941, 59.3472666010876],
[18.0703691720102, 59.3472042429081],
[18.0702823047917, 59.3472485307412],
[18.0701954375732, 59.3472928185744],
[18.0702798572654, 59.3473386559583],
[18.0703707806626, 59.3472932286464],
[18.0702032446519, 59.3472897441877],
[18.0702707549943, 59.3473253233648],
[18.0703481568565, 59.3472863832737],
[18.0703047913742, 59.3472595120782],
[18.0702822702433, 59.3472484401217]
[18.0702828916855, 59.3472483640108]
]
},
"id": "84a8f014-635a-4dc4-97b0-00fbf8e4754c",
Expand Down
11 changes: 11 additions & 0 deletions src/app/student/map/data/nymble.plan3.json
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,17 @@
"pointType": "Exit"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [18.0706162227062, 59.3473913156493]
},
"id": "d9fc8fe0-a883-4ba6-bf0d-d0cf0eb2109c",
"properties": {
"pointType": "StartUp"
}
},
{
"type": "Feature",
"geometry": {
Expand Down
8 changes: 6 additions & 2 deletions src/app/student/map/data/nymble.plan3.rooms.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"type": "Polygon",
"coordinates": [
[
[18.070733018168, 59.3473107161555],
[18.0707331318445, 59.34731063284],
[18.0708098262436, 59.3473340636232],
[18.0706893440628, 59.3474033406784],
[18.0706720326238, 59.3474109264896],
Expand All @@ -86,7 +86,11 @@
[18.0703948237239, 59.3474351586535],
[18.070438691685, 59.347419076346],
[18.0704735055337, 59.347445429803],
[18.070733018168, 59.3473107161555]
[18.070505944613, 59.3474285905971],
[18.0705470045807, 59.3474495899601],
[18.0707339115286, 59.347351314644],
[18.0706926671607, 59.3473314634178],
[18.0707331318445, 59.34731063284]
]
]
},
Expand Down
9 changes: 7 additions & 2 deletions src/app/student/map/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const style = {
routeWidth: 1,

routeHintColor: "#F3ECC3",
routeHintWidth: 0,
routeHintWidth: 1,

roomBackgroundColor: "#1f2b24",

Expand All @@ -70,7 +70,8 @@ export enum PointType {
Door = "Door",
WC = "WC",
Stair = "Stair",
Disability = "Disability"
Disability = "Disability",
StartUp = "StartUp"
}

// Function to add icon assets after map is loaded
Expand All @@ -90,12 +91,14 @@ export async function addMapIconAssets(
const wcIcon = await loadImage("/map_icons/wc.png")
const stairIcon = await loadImage("/map_icons/stair.png")
const disabilityIcon = await loadImage("/map_icons/disability.png")
const startUpIcon = await loadImage("/map_icons/startup.png")

map.addImage("exit-icon", exitIcon)
map.addImage("door-icon", doorIcon)
map.addImage("wc-icon", wcIcon)
map.addImage("stair-icon", stairIcon)
map.addImage("disability-icon", disabilityIcon)
map.addImage("startup-icon", startUpIcon)
} catch (error) {
console.error("Error loading icons:", error)
}
Expand Down Expand Up @@ -221,6 +224,8 @@ export const symbolLayerStyle: SymbolLayer = {
"stair-icon",
["==", ["get", "pointType"], PointType.Disability],
"disability-icon",
["==", ["get", "pointType"], PointType.StartUp],
"startup-icon",
"default" // fallback icon
],
"icon-size": 0.6, // Adjust icon size
Expand Down
4 changes: 2 additions & 2 deletions src/app/student/map/lib/locations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ const libraryCenter = {
export const locations: Location[] = [
{
id: "nymble/2",
label: "Nymble-F2",
label: "Nymble-floor2",
center: nymbleCenter
},
{
id: "nymble/3",
label: "Nymble-F3",
label: "Nymble-floor3",
center: nymbleCenter
},
{
Expand Down

0 comments on commit db891d6

Please sign in to comment.