Skip to content

Commit

Permalink
update query for location
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiaifrim committed Sep 21, 2020
1 parent deae944 commit 55e1646
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,15 +513,15 @@ const OpenlayersMapView = (props) => {
axios
.get(
encodeURI(
`${settings.providerUrl}?query=SELECT DISTINCT * FROM [IED].[latest].[Browse3_4_infotable] WHERE site LIKE '%${stateRef.current.siteTerm}%' ORDER BY [reportingYear] DESC`,
`${settings.providerUrl}?query=SELECT shape_wm.STX as x, shape_wm.STY as y from [IED].[latest].[SiteMap] WHERE siteName LIKE '%${stateRef.current.siteTerm}%' ORDER BY [Site_reporting_year] DESC`,
),
)
.then((response) => {
const data = JSON.parse(response.request.response);
const item = data.results?.[0];
if (item) {
const x_3857 = item.x_3857;
const y_3857 = item.y_3857;
const x_3857 = item.x;
const y_3857 = item.y;
stateRef.current.map.element.getView().animate({
center: [x_3857, y_3857],
duration: filterSource !== 'query_params' ? 1000 : 0,
Expand Down

0 comments on commit 55e1646

Please sign in to comment.