Skip to content

Commit

Permalink
fix for lat and lng
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanistHere committed Aug 1, 2021
1 parent 69b7199 commit ce4f64b
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion back-end/controllers/geo.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ exports.geo_add = async (req, res, next) => {
return res.status(400).json({ error: "User is not logged in" })

const userID = req.session.userID
// body.location.coordinates = [body.location.coordinates[1], body.location.coordinates[0]]
body.location.coordinates = [body.location.coordinates[1], body.location.coordinates[0]]

try {
const user = await User.findOne({ email: userID })
Expand Down
6 changes: 6 additions & 0 deletions css/main-non-crit.css
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,12 @@ textarea {
list-style-type: square;
}

.settings__highlight {
font-weight: bold;
font-size: 80%;
font-style: italic;
}

.setting__item {
width: 100%;
}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ <h2 class="rating__title title rating__item_text settings__title sidebar__title"
<hr>
<ul class="settings__list">
<li class="setting__item">
<a href="#" class="settings__link rating__title openFiltersBtn">Filters</a>
<a href="#" class="settings__link rating__title openFiltersBtn">Filters <span class="settings__highlight">(new)</span></a>
</li>
<li class="setting__item">
<a href="#" class="settings__link rating__title vizualizeLoadingBtn">
Expand Down
4 changes: 2 additions & 2 deletions js/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ const getSinglePointData = async (latlng) => {
// }

const fetchBoundsData = async (box, zoom, filtersObj = null) => {
// preparedBox = box.map(item => [item[1], item[0]])
const bounds = JSON.stringify(box)
preparedBox = box.map(item => [item[1], item[0]])
const bounds = JSON.stringify(preparedBox)
const filters = JSON.stringify(filtersObj)
const url = `${path}/geo/read_bounds/${new URLSearchParams({ bounds, zoom, filters })}`

Expand Down
2 changes: 1 addition & 1 deletion js/mapOptimization.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const addDataAndDisplay = data => {
const newObj = {
...item,
geometry: {
coordinates: item['location']['coordinates'].reverse(),
coordinates: item['location']['coordinates'],
type: 'Point'
},
type: "Feature"
Expand Down
2 changes: 1 addition & 1 deletion js/places.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const initPlaces = async () => {

for (let i = 0; i < length; i++) {
const { coordinates } = places[i].location
const [ lat, lng ] = coordinates
const [ lng, lat ] = coordinates

const newItem = document.createElement('li')
newItem.classList.add('places__item')
Expand Down
2 changes: 1 addition & 1 deletion js/showRatings.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const initRatingPopup = async ({ latlng }) => {
addClass(ratePopup, 'rating-active')
$('.rate__popup').focus()

const { error, data } = await getSinglePointData([ latlng.lat, latlng.lng ])
const { error, data } = await getSinglePointData([ latlng.lng, latlng.lat, ])

if (error === 'Location not found') {
showError('locationNotFound')
Expand Down
2 changes: 1 addition & 1 deletion ru/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ <h2 class="rating__title title rating__item_text settings__title sidebar__title"
<hr>
<ul class="settings__list">
<li class="setting__item">
<a href="#" class="settings__link rating__title openFiltersBtn">Фильтры</a>
<a href="#" class="settings__link rating__title openFiltersBtn">Фильтры <span class="settings__highlight">(new)</span></a>
</li>
<li class="setting__item">
<a href="#" class="settings__link rating__title vizualizeLoadingBtn">
Expand Down

0 comments on commit ce4f64b

Please sign in to comment.