How do you pass in array of points to a spline mesh component

I see the error:

let Xnew = (((MapSizeUE - 1) * Scale) / MapRangeX) * (Long - Xm)
let Ynew = (((MapSizeUE - 1) * Scale) / MapRangeY) * (Lat - Ym) * -1

you have to use
let Xnew = ((((MapSizeUE - 1) * Scale) / MapRangeX) * Long) - Xm
let Ynew = ((((MapSizeUE - 1) * Scale) / MapRangeY) * Lat) - Ym) * -1

Changed to

  //Lng/Lat Points converted to UE XY
  let Xnew = ((((MapSizeUE - 1) * Scale) / MapRangeX) * Long) - Xm
  let Ynew = (((((MapSizeUE - 1) * Scale) / MapRangeY) * Lat) - Ym) * -1

Xnew and Ynew

UEx: -48232072.331334196 UEy: -70635940.09160204

Still off.

Thank you for helping with this.

MapboxTest.zip (45.6 KB)

Can you copy this into your content folder and have a look at it?

Yes

You are awesome. That seems to work perfectly. I selected to top of the mountain in the crater and after entering lng/lat into your function it moved the cube to that location.

Hey if you like this project I would welcome any input or help on what I should add to it. Now I can parse my geoson and just feed in the lng/lat to your BP and then pass that to the SplineGenerator. So cool! Cheers!!!

1 Like

It is still slightly off. Very close but is there any way to increase the accuracy since I need it to draw roads?

mapbox - YouTube

Wait. After looking at the BP, I still need to pass in from the Mapbox app the Map Range and Map Middle? In your example this was hardcoded?

This was hardcoded for the example area, yes

1 Like

It is very close but still off a bit. I added your function to the Mapbox_BP. Everything is hooked up so when you Send the Map to Unreal all the lng/lat data needed is also sent.

See: mapbox - YouTube

Updated Projedct:

TY.

Thank you again for the help, we are almost there. So close.

Would you please compare the MouseLocation inside the UnrealMapboxBridge for the same location with different zoom?

On it.

I tried to click the same location when zoomed at different level, but the values are slightly off. I don’t think the Zoom level changes the lng/lat. I think I just clicked slightly off the point.

Both times clicked on the top of the mountain (Mt Rainer)

That would be there:

When clicking the mouse on a location on the map, a cm in one direction would make that same change in lng/lat. How can you verify that you are clicking the exact same spot when you zoom?


Red = Mouse, where I click
Yellow = shown coordinates

Try this map from Mapbox. The lng/lat do not seem to change when zooming. I am using the same code.

Get coordinates of the mouse pointer | Mapbox GL JS | Mapbox

Mouse on Seattle:
image

image

image

Ok, thanks, I will dig into this.

You can also use the coordinates from your link

get the position und use these coordinates in Unreal. Then the cube will be at the exact position.