Skip to content

Commit

Permalink
[PR] Fixed map name discrepancy (#282)
Browse files Browse the repository at this point in the history
* Fixed map name discrepancy

Used buildings getter to pull building name from database instead of from Openstreetmap. This fixed the Arnold Cafeteria vs Arnold Dining Hall issue, as well as removed the need for hardcoding 'OSU Operations' building name.

* Fixed building search name discrepancy
  • Loading branch information
s-egge authored Dec 5, 2023
1 parent ada8fb7 commit be73500
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/components/map/map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,14 @@ export default {
this.building_compare_error = false
this.polyClick( e.target.feature.properties.id, e.target.feature, layer.getBounds().getCenter() )
} )
layer.on( 'mouseover', function ( e ) {
layer.on( 'mouseover', e => {
if ( !e.target.setStyle ) return
if ( e.target.feature.id === 'way/1100972272' ) {
e.target.feature.properties.name = 'OSU Operations'
}
e.target.oldStyle = {
fillColor: e.target.options.fillColor,
color: e.target.options.color
}
e.target.setStyle( { fillColor: '#000', color: '#000' } )
e.target.bindTooltip( e.target.feature.properties.name ).openTooltip()
e.target.bindTooltip( this.$store.getters['map/building']( e.target.feature.properties.id ).name ).openTooltip()
} )
layer.on( 'mouseout', e => {
if ( !e.target.setStyle ) return
Expand Down Expand Up @@ -637,9 +634,7 @@ export default {
var searchGroup = []
for ( let layer of Object.values( this.map._layers ) ) {
if ( layer.feature && layer.feature.geometry && layer.feature.geometry.type === 'Polygon' ) {
if ( layer.feature.id === 'way/1100972272' ) {
layer.feature.properties.name = 'OSU Operations'
}
layer.feature.properties.name = this.$store.getters['map/building']( layer.feature.properties.id ).name
if ( layer.feature.properties.name !== undefined ) {
if ( layer.feature.properties.name.toLowerCase().includes( v.toLowerCase() ) ) {
Expand Down

0 comments on commit be73500

Please sign in to comment.