public QkMan(QmapMesh qmm, string datamapname, MapProvider mapprov, LatLngBox llbox, int pixelspertile = 256) { this.datamapname = datamapname; this.qmm = qmm; this.pixelspertile = pixelspertile; this.levelOfDetail = llbox.lod; this.llbox = llbox; this.ll1 = llbox.GetUpperLeft(); this.ll2 = llbox.GetBottomRight(); }
public void InitMapFromLatLongBox(LatLngBox latLngBox, int lod) { mapcoord = new MapCoordblock(this); var llbl = latLngBox.GetBottomLeft(); var llul = latLngBox.GetUpperLeft(); var llbr = latLngBox.GetBottomRight(); var llur = latLngBox.GetUpperRight(); var llmp = latLngBox.GetMidPoint(); var pixToMeters = TileSystem.GroundResolution(llmp.lat, lod); //var orgpix = llbl.GetPixelCoords(lod); var orgpix = llmp.GetPixelCoords(lod); var orgmeters = new Vector2d(orgpix.x * pixToMeters, orgpix.y * pixToMeters); mapcoord.AddRowLngLat(llbl, lod, pixToMeters, orgmeters); mapcoord.AddRowLngLat(llul, lod, pixToMeters, orgmeters); mapcoord.AddRowLngLat(llbr, lod, pixToMeters, orgmeters); mapcoord.AddRowLngLat(llur, lod, pixToMeters, orgmeters); mapcoord.AddRowLngLat(llmp, lod, pixToMeters, orgmeters); glbllm = this; maps.latmap = mapcoord.DoRegression("lat = x + z"); maps.lngmap = mapcoord.DoRegression("lng = x + z"); maps.xmap = mapcoord.DoRegression("x = lng + lat"); maps.zmap = mapcoord.DoRegression("z = lng + lat"); }