Skip to content

Commit

Permalink
off center on click for search
Browse files Browse the repository at this point in the history
  • Loading branch information
solderq35 committed Sep 14, 2023
1 parent 477d83d commit d6963f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=600px, initial-scale=0, user-scalable=no;user-scalable=0;"/>
<meta name="viewport" content="width=600px, initial-scale=0, user-scalable=no;user-scalable=0;" />
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-74257268-2"></script>
<script>
Expand Down
9 changes: 6 additions & 3 deletions src/components/map/map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{ searchGroup.feature.properties.name }}
</p>
</div>
<el-input v-model="search" class="searchMapInput" placeholder = "Search for buildings">
<el-input v-model="search" class="searchMapInput" placeholder="Search for buildings">
<i class="el-icon-search el-input__icon" slot="prefix"></i>
</el-input>
<switchButtons :titles="['Category', 'Energy Trend']" v-model="grouping" />
Expand Down Expand Up @@ -279,8 +279,11 @@ export default {
}
},
getResult ( searchResult ) {
console.log(searchResult.getBounds().getCenter())
this.map.setView( L.latLng( searchResult.getBounds().getCenter() ), 15.5 )
console.log( searchResult.getBounds().getCenter() )
let searchLatLng = searchResult.getBounds().getCenter()
searchLatLng.lng = searchLatLng.lng - 0.005
console.log( searchLatLng )
this.map.setView( L.latLng( searchLatLng ), 15.5 )
console.log( searchResult.feature.properties.name )
searchResult
.bindTooltip( searchResult.feature.properties.name, { permanent: true, fillColor: '#000', color: '#000' } )
Expand Down

0 comments on commit d6963f7

Please sign in to comment.