I need to know how to create a proj4.js and proj4leaflet.js which requires me to convert coordinates from EPSG:31700 to wgs84.
Both scripts I will load in leaflet script.
If you go to SpatialReference.org they maintain a list of spatial references. Through this website you can search spatial references by different criteria. On the page of each specific spatial reference they provide the spatial references in a number of formats, one of which is proj4.js.
See here for EPSG:31700 of which the proj4.js format is:
Proj4js.defs["EPSG:31700"] = "+proj=sterea +lat_0=46 +lon_0=25 +k=0.99975 +x_0=500000 +y_0=500000 +ellps=krass +units=m +no_defs";
See here for EPSG:4326 of which the proj4.js format is:
Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
Each of the different formats of representing the spatial references for the individual references are there own url and the naming of the urls are quite straight forward so you could consume the spatial reference/format url into your javascript and do it that way. For example, the url to the EPSG:31700 proj4.js (above) is:
http://spatialreference.org/ref/epsg/31700/proj4js/
And for EPSG:4326, is:
http://spatialreference.org/ref/epsg/4326/proj4js/
The urls have a set structure and are consistent.
SpatialReference.org is a wonderful resource for finding spatial references and becoming familiar with different formats to represent them.
In terms of using this in Proj4Leaflet, if you go their documentation here the first example on that page will show you have to use the proj4.js information obtained from SpatialReference.org and create an L.Proj.CRS
with Proj4Leaflet.