Converting between coordinate systems

I’m using a modified version of np-gangmap (GitHub - skyrossm/np-gangmap: Territory map for NoPixel GTA RP) to create a gang territories/neighbourhoods system, but need to be able to get the territory that a player is currently within from ingame, with the gang map hosted elsewhere.

In order to do this, I reckon I would need to be able to convert from the coordinate system on np-gangmap (latitude/longitude) to the coordinate system in GTA. I’ve tried using a system of “normalising” the lat/long coordinates, and whilst this seems to be close/along the right lines, I end up with coordinates which are the right shape/size but off in terms of the actual location.

The first screenshot shows blips created at the corner coordinates that I’ve calculated ingame, and then the second shows the actual location (I’ve circled the one which is actually displayed in the ingame screenshot):

My current Lua code is:

function NormaliseCoordinate(val, min, max)
    return (val - min) / (max - min)
end

function DestinationCoordinate(val, min, max)
    return val * (max - min) + min
end

-- This section then gets the lat and long values and uses the functions
local areas = jsonutil.parse(v.latlngarray)
v.coordarray = {}
for k1, v1 in pairs(areas) do
    local normalisedlng, normalisedlat =
        NormaliseCoordinate(v1.lng, -114, 180),
        NormaliseCoordinate(v1.lat, -80, 83.73)

    local xcoord, ycoord =
        DestinationCoordinate(normalisedlng, -3430, 6010),
        DestinationCoordinate(normalisedlat, -4000, 6623)

    v.coordarray[k1] = vector3(xcoord, ycoord, 0)

    local blip = AddBlipForCoord(v.coordarray[k1].x, v.coordarray[k1].y, v.coordarray[k1].z)
end

Any thoughts or help would be very much appreciated, as this has been driving me absolutely mental <3