This (roll your own) may be the way to go for basic visualization for small areas away from the poles.
Here’s a link relating to countries on a sphere in BABYLON.
Your approach will likely depend on how big an area you’re trying to visualize. Use the above of you’re mapping the earth on a sphere. Use WGS84 = X,Y if you’re displaying a city block.
For other applications, some of the following might be helpful.
Here is how you can transform WGS84 coordinates into spherical coordinates.
For other projections, like various 2d projections, here is a javascript library that can transform geographic coordinates to different projections.
Here is a brief discussion of errors in coordinate systems relative to the size of the area being mapped.
For reference, if you assume WGS84 coordinates are equivalent to X, Y coordinates, you are effectively implementing an equirectangular projection, most likely a plate carrée projection.