I want to convert longitude and latitude coordinates from WSG84 to Google Mercator. The following code-samples show my coordinates in a KML/KMZ file and where I need the coordinates in the javascript file.
<LatLonBox>
<north>50.0</north>
<south>46.0</south>
<east>18.0</east>
<west>13.0</west>
</LatLonBox>
new ol.layer.Image({
source: new ol.source.ImageStatic({
url: 'file:///C:/Users/Xhy/Desktop/cubic.png',
imageExtent:[1447153.38031, 5780349.22026, 2003750.83428, 6446275.84102]
})
})
I am currently using this site here to convert my coordinates from WSG84 to Google Mercator.
I need to automate these conversion, since I have to create OSM-files with different image layers. I have the latitude and longitude in a KML/KMZ file, I can read out of it, and use the coordinates.
My problem is, these coordinates I extract from the KML/KMZ files are WSG84 but for java-script I need the coordinates in Google Mercator.
Any ideas how I can make this conversion inside the javascript file?