MapInfo2leafletjs tool

المشرف العام

Administrator
طاقم الإدارة
I've downloaded a tool to export a table from MapIngo GIS to leafletjs. The base map from Openstreetmap has been created, but the choropleth map of regions is not being displayed. One possible reason could be the difference in projections - the base map is defined in lat/long projection as follows in the source code:

// The layer planning4care_over65_dataLayer is referred to as 'L1', i.e. all functions and variables specific to this layer have the suffix L1 // These are the bounds of the planning4care_over65_data dataset, plus a margin var southWest = L.latLng(52.6767, -1.45231), northEast = L.latLng(53.6135, -0.554333), bounds = L.latLngBounds(southWest, northEast);

var map = L.map('map').fitBounds([[52.8845, -1.67293], [53.4984, -0.368658]]).setMaxBounds(bounds);

whereas in the Geojson file the projections for the individual polygons are in Long/Lat (as is custom in MapInfo WSG 84):

{"type":"Feature","properties":{"cmwd11nm":"Polygon 1","__no_car":0.699764,"popupContent":"Cmwd11nmPolygon 1 no car0.699764"},"geometry":{"type":"Polygon","coordinates":[[ [-1.200433, 53.036931], [-1.20156, 53.035676], [-1.2019, 53.035271], [-1.202212, 53.034933], [-1.202279, 53.034847],

There is a command in Leafletjs which can rectify this, but I'm not too sure where it would go - in the base html file or in the GeoJson file:

coordsToLatLng( coords ) Function that will be used for converting GeoJSON coordinates to LatLng points (if not specified, coords will be assumed to be WGS84 — standard [longitude, latitude] values in degrees).

Any views on this?Jonno1



أكثر...
 
أعلى