Skip to content

Fix incorrect lat lon ordering#142

Closed
Yuxian1113 wants to merge 1 commit intoAzure-Samples:mainfrom
Yuxian1113:fix-incorrect-latlng
Closed

Fix incorrect lat lon ordering#142
Yuxian1113 wants to merge 1 commit intoAzure-Samples:mainfrom
Yuxian1113:fix-incorrect-latlng

Conversation

@Yuxian1113
Copy link
Copy Markdown

@Yuxian1113 Yuxian1113 commented Aug 29, 2024

The camera view was incorrectly showing the ocean instead of Seattle when displaying search results.
image

Changes Made:

  • Modified the bounds.push call to use the correct coordinate format [lat, lon] as required by the fromLatLngs function, which sets the camera position.

Reason for the Change:
The fromLatLngs function expects coordinates in the [lat, lon] format. Previously, the code passed [lon, lat], causing the camera to focus on an unintended location.

After modification:
image

@rbrundritt
Copy link
Copy Markdown
Contributor

Thanks for raising this issue. I think this is the first time I've seen this sample. Taking a closer look at the code see a couple of issues. The solution you proposed does resolve the issue, however, the original code overall isn't great and needs to be cleaned up a lot more. With this in mind, I'm going to close this PR and make the necessary changes needed to this sample to improve it, and look at getting the tutorial docs updated as well.

Thanks again.

@rbrundritt rbrundritt closed this Aug 29, 2024
rbrundritt added a commit that referenced this pull request Aug 29, 2024
Fixed bug reported in PR #142
Cleaned up code a bit and fixed another small bug.
@rbrundritt
Copy link
Copy Markdown
Contributor

I've made the updates. It looks like this sample was updated last winter to remove the dependency on the old services module, and whoever made that change, added in a couple of bugs. All corrected now. Thanks again for highlighting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants