kartena/Proj4Leaflet — Issue #5: Support for EPSG7128 projection and WMS layer
Author: dicoy
Created: 2011-12-27 15:46:11+00:00
State: open

Hi, first of all, thankyou for this. It's a mayor lifesaver for me if I can make this work.

I'm trying to fit my map into the example I downloaded from you guys and I can't seem to make it work, below you'll find the script.js file with my data.
Also I have to examples of my map working in openlayers in case you want to take a peek:
http://mapa.buenosaires.gov.ar/
http://usig.buenosaires.gov.ar/m/ (mobile version, still under development, but a much simpler code)

I just want to know if there's something I might me doing wrong, but I can't seem to find anything

var res = [90, 50, 30, 15, 7.5, 4, 2, 1, 0.5, 0.2]
,start = new L.LatLng(-34.629243, -58.463196)
,map = new L.Map('map', {
crs: L.CRS.proj4js('EPSG:7128'
,'+lon_0=-58.463196 +lat_0=-34.629243 +k=0.999998 +x_0=100000.0 +y_0=100000.0 +proj=tmerc +ellps=intl +units=m +no_defs'
,new L.Transformation(1, 0, -1, 0))
,scale: function(zoom) {
return 1 / res[zoom];
}
,continuousWorld: false
})
,mapUrl = 'http://tiles1.mapa.buenosaires.gob.ar/tilecache/'
,attrib = 'Map data © 2011 USIG, Imagery © 2011 USIG'
,tilelayer = new L.TileLayer.WMS(mapUrl, {
scheme: 'tms'
,maxZoom: 18
,minZoom: 1
,continuousWorld: false
,format: 'image/png'
,transparent: true
,attribution: attrib
,layers: 'mapabsas_default'
});
map.addLayer(tilelayer);
map.setView(start, 5);