Subversion Repositories eFlore/Applications.cel

Rev

Rev 3866 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3866 Rev 3867
Line 147... Line 147...
147
            suggestion = lthis.searchResults.find(suggestion => suggestion['place_id'] === $thisSuggestion.data('placeId'));
147
            suggestion = lthis.searchResults.find(suggestion => suggestion['place_id'] === $thisSuggestion.data('placeId'));
Line 148... Line 148...
148
 
148
 
Line 149... Line 149...
149
        evt.preventDefault();
149
        evt.preventDefault();
150
 
-
 
151
        lthis.places.val($thisSuggestion.text());
-
 
152
 
150
 
153
        suggestion.geojson.coordinates = lthis.formatCoordinatesArray(suggestion.geojson);
151
        lthis.places.val($thisSuggestion.text());
Line 154... Line 152...
154
        lthis.clientCallback(suggestion);
152
        lthis.clientCallback(suggestion);
155
        lthis.placesCloseButton.trigger('click');
153
        lthis.placesCloseButton.trigger('click');
Line 174... Line 172...
174
            lthis.places.focus();
172
            lthis.places.focus();
175
        }
173
        }
176
    });
174
    });
177
};
175
};
Line 178... Line -...
178
 
-
 
179
TbPlaces.prototype.formatCoordinatesArray = function(geojson) {
-
 
180
    const coordinatesArray = geojson.coordinates,
-
 
181
        geojsonType = geojson.type,
-
 
182
        coordinatesArrayLength = coordinatesArray.length;
-
 
183
 
-
 
184
    if ('Point' === geojsonType) {
-
 
185
        coordinatesArray.reverse();
-
 
186
    } else if (0 > coordinatesArrayLength) {
-
 
187
        for (let i = 0; i <= coordinatesArrayLength; i++) {
-
 
188
            coordinatesArray[i].reverse();
-
 
189
        }
-
 
190
    }
-
 
191
 
-
 
192
    return coordinatesArray;
-
 
193
}
-
 
194
 
176
 
195
TbPlaces.prototype.resetOnClick = function () {
177
TbPlaces.prototype.resetOnClick = function () {
Line 196... Line 178...
196
    const lthis = this;
178
    const lthis = this;
197
 
179