dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
core.cpp
Go to the documentation of this file.
1 
14 /*
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * for more details.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, see <http://www.gnu.org/licenses/>
27 */
28 #include "core.h"
29 
30 #ifdef DEBUG_CORE
31 qlonglong internals::Core::debugcounter=0;
32 #endif
33 
34 using namespace projections;
35 
36 namespace internals {
37  Core::Core():started(false),MouseWheelZooming(false),currentPosition(0,0),currentPositionPixel(0,0),LastLocationInBounds(-1,-1),sizeOfMapArea(0,0)
38  ,minOfTiles(0,0),maxOfTiles(0,0),zoom(0),isDragging(false),TooltipTextPadding(10,10),mapType(MapType::None),loaderLimit(5),maxzoom(21),runningThreads(0)
39  {
40  mousewheelzoomtype=MouseWheelZoomType::MousePositionAndCenter;
42  this->setAutoDelete(false);
43  ProcessLoadTaskCallback.setMaxThreadCount(10);
44  renderOffset=Point(0,0);
45  dragPoint=Point(0,0);
46  CanDragMap=true;
47  tilesToload=0;
48  TLMaps::Instance();
49  }
51  {
52  ProcessLoadTaskCallback.waitForDone();
53  }
54 
55  void Core::run()
56  {
57  MrunningThreads.lock();
58  ++runningThreads;
59  MrunningThreads.unlock();
60 #ifdef DEBUG_CORE
61  qlonglong debug;
62  Mdebug.lock();
63  debug=++debugcounter;
64  Mdebug.unlock();
65  qDebug()<<"core:run"<<" ID="<<debug;
66 #endif //DEBUG_CORE
67  bool last = false;
68 
69  LoadTask task;
70 
71  MtileLoadQueue.lock();
72  {
73  if(tileLoadQueue.count() > 0)
74  {
75  task = tileLoadQueue.dequeue();
76  {
77 
78  last = (tileLoadQueue.count() == 0);
79 #ifdef DEBUG_CORE
80  qDebug()<<"TileLoadQueue: " << tileLoadQueue.count()<<" Point:"<<task.Pos.ToString()<<" ID="<<debug;;
81 #endif //DEBUG_CORE
82  }
83  }
84  }
85  MtileLoadQueue.unlock();
86 
87  if(task.HasValue())
88  if(loaderLimit.tryAcquire(1,TLMaps::Instance()->Timeout))
89  {
90  MtileToload.lock();
91  --tilesToload;
92  MtileToload.unlock();
93 #ifdef DEBUG_CORE
94  qDebug()<<"loadLimit semaphore aquired "<<loaderLimit.available()<<" ID="<<debug<<" TASK="<<task.Pos.ToString()<<" "<<task.Zoom;
95 #endif //DEBUG_CORE
96 
97  {
98 
99 #ifdef DEBUG_CORE
100  qDebug()<<"task as value, begining get"<<" ID="<<debug;;
101 #endif //DEBUG_CORE
102  {
103  Tile* m = Matrix.TileAt(task.Pos);
104 
105  if(m==nullptr || m->Overlays.count() == 0)
106  {
107 #ifdef DEBUG_CORE
108  qDebug()<<"Fill empty TileMatrix: " + task.ToString()<<" ID="<<debug;;
109 #endif //DEBUG_CORE
110 
111  Tile* t = new Tile(task.Zoom, task.Pos);
112  QVector<MapType::Types> layers= TLMaps::Instance()->GetAllLayersOfType(GetMapType());
113 
114  foreach(MapType::Types tl,layers)
115  {
116  int retry = 0;
117 
118  do
119  {
120  QByteArray tileImage;
121 
122  // tile number inversion(BottomLeft -> TopLeft) for pergo maps
123  if(tl == MapType::PergoTurkeyMap)
124  {
125  tileImage = TLMaps::Instance()->GetImageFromServer(tl, Point(task.Pos.X(), maxOfTiles.Height() - task.Pos.Y()), task.Zoom);
126  }
127  else if(tl == MapType::UserImage)
128  {
129  tileImage = TLMaps::Instance()->GetImageFromFile(tl, task.Pos, task.Zoom, userImageHorizontalScale, userImageVerticalScale, userImageLocation, Projection());
130  }
131  else // ok
132  {
133 #ifdef DEBUG_CORE
134  qDebug()<<"start getting image"<<" ID="<<debug;
135 #endif //DEBUG_CORE
136  tileImage = TLMaps::Instance()->GetImageFromServer(tl, task.Pos, task.Zoom);
137 #ifdef DEBUG_CORE
138  qDebug()<<"Core::run:gotimage size:"<<tileImage.count()<<" ID="<<debug;
139 #endif //DEBUG_CORE
140  }
141 
142  if(tileImage.length()!=0)
143  {
144  Moverlays.lock();
145  {
146  t->Overlays.append(tileImage);
147 #ifdef DEBUG_CORE
148  qDebug()<<"Core::run append tileImage:"<<tileImage.length()<<" to tile:"<<t->GetPos().ToString()<<" now has "<<t->Overlays.count()<<" overlays"<<" ID="<<debug;
149 #endif //DEBUG_CORE
150 
151  }
152  Moverlays.unlock();
153 
154  break;
155  }
156  else if(TLMaps::Instance()->RetryLoadTile > 0)
157  {
158 #ifdef DEBUG_CORE
159  qDebug()<<"ProcessLoadTask: " << task.ToString()<< " -> empty tile, retry " << retry<<" ID="<<debug;;
160 #endif //DEBUG_CORE
161  }
162  }
163  while(++retry < TLMaps::Instance()->RetryLoadTile);
164  }
165 
166  if(t->Overlays.count() > 0)
167  {
168  Matrix.SetTileAt(task.Pos,t);
169  emit OnNeedInvalidation();
170 
171 #ifdef DEBUG_CORE
172  qDebug()<<"Core::run add tile "<<t->GetPos().ToString()<<" to matrix index "<<task.Pos.ToString()<<" ID="<<debug;
173  qDebug()<<"Core::run matrix index "<<task.Pos.ToString()<<" as tile with "<<Matrix.TileAt(task.Pos)->Overlays.count()<<" ID="<<debug;
174 #endif //DEBUG_CORE
175  }
176  else
177  {
178  // emit OnTilesStillToLoad(tilesToload);
179 
180  delete t;
181  t = nullptr;
182  emit OnNeedInvalidation();
183  }
184 
185  // layers = null;
186  }
187  }
188 
189 
190  {
191  // last buddy cleans stuff ;}
192  if(last)
193  {
194  TLMaps::Instance()->kiberCacheLock.lockForWrite();
195  TLMaps::Instance()->TilesInMemory.RemoveMemoryOverload();
196  TLMaps::Instance()->kiberCacheLock.unlock();
197 
198  MtileDrawingList.lock();
199  {
201  }
202  MtileDrawingList.unlock();
203 
204 
205  emit OnTileLoadComplete();
206 
207 
208  emit OnNeedInvalidation();
209 
210  }
211  }
212 
213 
214 
215  }
216 #ifdef DEBUG_CORE
217  qDebug()<<"loaderLimit release:"+loaderLimit.available()<<" ID="<<debug;
218 #endif
219  emit OnTilesStillToLoad(tilesToload<0? 0:tilesToload);
220  loaderLimit.release();
221  }
222  MrunningThreads.lock();
223  --runningThreads;
224  MrunningThreads.unlock();
225  }
227  {
228  MrunningThreads.lock();
229  diag=TLMaps::Instance()->GetDiagnostics();
230  diag.runningThreads=runningThreads;
231  MrunningThreads.unlock();
232  return diag;
233  }
234 
235  void Core::SetZoom(const int &value)
236  {
237  if (!isDragging)
238  {
239 
240  zoom=value;
241  minOfTiles=Projection()->GetTileMatrixMinXY(value);
242  maxOfTiles=Projection()->GetTileMatrixMaxXY(value);
243  currentPositionPixel=Projection()->FromLatLngToPixel(currentPosition, value);
244  if(started)
245  {
246  MtileLoadQueue.lock();
247  tileLoadQueue.clear();
248  MtileLoadQueue.unlock();
249  MtileToload.lock();
250  tilesToload=0;
251  MtileToload.unlock();
252  Matrix.Clear();
254  UpdateBounds();
255  keepInBounds();
256  emit OnMapDrag();
257  emit OnMapZoomChanged();
258  emit OnNeedInvalidation();
259  }
260  }
261  }
262 
264  {
265  if(!IsDragging())
266  {
267  currentPosition = value;
268  SetCurrentPositionGPixel(Projection()->FromLatLngToPixel(value, Zoom()));
269 
270  if(started)
271  {
273  emit OnCurrentPositionChanged(currentPosition);
274  }
275  }
276  else
277  {
278  currentPosition = value;
279  SetCurrentPositionGPixel(Projection()->FromLatLngToPixel(value, Zoom()));
280 
281  if(started)
282  {
283  emit OnCurrentPositionChanged(currentPosition);
284  }
285  }
286  }
287 
289  {
290  userImageHorizontalScale=hScale;
291  }
293  {
294  userImageVerticalScale=vScale;
295  }
296  void Core::SetUserImageLocation(QString mapLocation)
297  {
298  userImageLocation=mapLocation;
299  }
300 
301  void Core::SetMapType(const MapType::Types &value)
302  {
303 
304  if(value != GetMapType())
305  {
306  mapType = value;
307 
308  switch(value)
309  {
310 
311 
312  case MapType::ArcGIS_Map:
313  case MapType::ArcGIS_Satellite:
314  case MapType::ArcGIS_ShadedRelief:
315  case MapType::ArcGIS_Terrain:
316  {
317  if(Projection()->Type()!="PlateCarreeProjection")
318  {
320  }
321  maxzoom=13;
322  }
323  break;
324  case MapType::ArcGIS_MapsLT_Map_Hybrid:
325  case MapType::ArcGIS_MapsLT_Map_Labels:
326  case MapType::ArcGIS_MapsLT_Map:
327  case MapType::ArcGIS_MapsLT_OrtoFoto:
328  {
329  if(Projection()->Type()!="LKS94Projection")
330  {
332  }
333  maxzoom=11;
334  }
335  break;
336 
337  case MapType::PergoTurkeyMap:
338  {
339  if(Projection()->Type()!="PlateCarreeProjectionPergo")
340  {
342  }
343  maxzoom=17;
344  }
345  break;
346 
347  case MapType::YandexMapRu:
348  {
349  if(Projection()->Type()!="MercatorProjectionYandex")
350  {
352  }
353  maxzoom=13;
354  }
355  break;
356 
357  case MapType::UserImage:
358  {
359  if(Projection()->Type()!="MercatorProjection")
360  {
362  }
363  maxzoom=32;
364  }
365  break;
366  default:
367  {
368  if(Projection()->Type()!="MercatorProjection")
369  {
371  }
372  maxzoom=21;
373  }
374  break;
375  }
376 
377  //Calculate the number of bits required to hold the tile size
378  quint8 numBits=1;
379  while( (1 << (numBits-1)) < projection->TileSize().Width()){
380  numBits++;
381  }
382  unsigned int bitsWithZoom = numBits + (quint8)maxzoom;
383  //Ensure that no matter what the zoom can never exceed the number of bits required to display it
384  if (bitsWithZoom > sizeof(((core::Point *) nullptr)->X())*8 - 1){ //Remove one because of the sign bit.
385  maxzoom = sizeof(((core::Point *) nullptr)->X())*8 - 1 - numBits;
386  }
387 
388  minOfTiles = Projection()->GetTileMatrixMinXY(Zoom());
389  maxOfTiles = Projection()->GetTileMatrixMaxXY(Zoom());
390  SetCurrentPositionGPixel(Projection()->FromLatLngToPixel(CurrentPosition(), Zoom()));
391 
392  if(started)
393  {
397  ReloadMap();
399  emit OnMapTypeChanged(value);
400 
401  }
402  }
403 
404  }
406  {
407  if(!started)
408  {
409  started = true;
410 
411  ReloadMap();
413  }
414  }
415 
417  {
418  PointLatLng center = FromLocalToLatLng(Width/2, Height/2);
419  Point centerPixel = Projection()->FromLatLngToPixel(center, Zoom());
420  centerTileXYLocation = Projection()->FromPixelToTileXY(centerPixel);
421  }
422 
423  void Core::OnMapSizeChanged(int const& width, int const& height)
424  {
425  Width = width;
426  Height = height;
427 
428  sizeOfMapArea.SetWidth(1 + (Width/Projection()->TileSize().Width())/2);
429  sizeOfMapArea.SetHeight(1 + (Height/Projection()->TileSize().Height())/2);
430 
432 
433  if(started)
434  {
435  UpdateBounds();
436 
437  emit OnCurrentPositionChanged(currentPosition);
438  }
439  }
441  {
443  }
444 
446  {
447  return TLMaps::Instance()->GetPlacemarkFromGeocoder(coord,status,LanguageType().toShortString(TLMaps::Instance()->GetLanguage()));
448  }
449 
450  QList<UrlFactory::geoCodingStruct> Core::GetCoordinatesFromAddress(QString const &address,GeoCoderStatusCode::Types &status)
451  {
452  return TLMaps::Instance()->GetLatLngFromGeodecoder(address,status,LanguageType().toShortString(TLMaps::Instance()->GetLanguage()));
453  }
454 
455  double Core::GetElevationFromCoordinates(PointLatLng coord,GeoCoderStatusCode::Types &status)
456  {
457  return TLMaps::Instance()->GetElevationFromCoordinate(coord,status);
458  }
459 
460  GeoCoderStatusCode::Types Core::SetCurrentPositionByKeywords(QString const& keys)
461  {
462  GeoCoderStatusCode::Types status = GeoCoderStatusCode::UNKNOWN_ERROR;
463  QList <UrlFactory::geoCodingStruct> ret=TLMaps::Instance()->GetLatLngFromGeodecoder(keys, status,LanguageType().toShortString(TLMaps::Instance()->GetLanguage()));
464  if((ret.length() > 0) && (status == GeoCoderStatusCode::OK))
465  {
466  PointLatLng pos = ret.at(0).coordinates;
467  SetCurrentPosition(pos);
468  }
469  return status;
470  }
471 
473  {
474  PointLatLng p = Projection()->FromPixelToLatLng(-renderOffset.X(), -renderOffset.Y(), Zoom());
475  double rlng = Projection()->FromPixelToLatLng(-renderOffset.X() + Width, -renderOffset.Y(), Zoom()).Lng();
476  double blat = Projection()->FromPixelToLatLng(-renderOffset.X(), -renderOffset.Y() + Height, Zoom()).Lat();
477  return RectLatLng::FromLTRB(p.Lng(), p.Lat(), rlng, blat);
478 
479  }
480  PointLatLng Core::FromLocalToLatLng(qint64 const& x, qint64 const& y)
481  {
482  return Projection()->FromPixelToLatLng(Point(x - renderOffset.X(), y - renderOffset.Y()), Zoom());
483  }
484 
485 
487  {
488  Point pLocal = Projection()->FromLatLngToPixel(latlng, Zoom());
489  pLocal.Offset(renderOffset);
490  return pLocal;
491  }
493  {
494  int zoom = 0;
495 
496  for(int i = 1; i <= MaxZoom(); i++)
497  {
498  Point p1 = Projection()->FromLatLngToPixel(rect.LocationTopLeft(), i);
499  Point p2 = Projection()->FromLatLngToPixel(rect.Bottom(), rect.Right(), i);
500 
501  if(((p2.X() - p1.X()) <= Width+10) && (p2.Y() - p1.Y()) <= Height+10)
502  {
503  zoom = i;
504  }
505  else
506  {
507  break;
508  }
509  }
510 
511  return zoom;
512  }
513  void Core::BeginDrag(Point const& pt)
514  {
515  dragPoint.SetX(pt.X() - renderOffset.X());
516  dragPoint.SetY(pt.Y() - renderOffset.Y());
517  isDragging = true;
518  }
520  {
521  isDragging = false;
522  emit OnNeedInvalidation();
523 
524  }
526  {
527  if(started)
528  {
529 #ifdef DEBUG_CORE
530  qDebug()<<"------------------";
531 #endif //DEBUG_CORE
532 
533  MtileLoadQueue.lock();
534  {
535  tileLoadQueue.clear();
536  }
537  MtileLoadQueue.unlock();
538  MtileToload.lock();
539  tilesToload=0;
540  MtileToload.unlock();
541  Matrix.Clear();
542 
543  emit OnNeedInvalidation();
544 
545  }
546  }
548  {
549  // reset stuff
550  renderOffset = Point::Empty;
551  centerTileXYLocationLast = Point::Empty;
552  dragPoint = Point::Empty;
553 
554  // goto location
555  Drag(Point(-(GetcurrentPositionGPixel().X() - Width/2), -(GetcurrentPositionGPixel().Y() - Height/2)));
556  }
558  {
559  // reset stuff
560  renderOffset = Point::Empty;
561  centerTileXYLocationLast = Point::Empty;
562  dragPoint = Point::Empty;
563 
564  // goto location and centering
565  if(MouseWheelZooming)
566  {
567  if(mousewheelzoomtype != MouseWheelZoomType::MousePositionWithoutCenter)
568  {
569  Point pt = Point(-(GetcurrentPositionGPixel().X() - Width/2), -(GetcurrentPositionGPixel().Y() - Height/2));
570  renderOffset.SetX(pt.X() - dragPoint.X());
571  renderOffset.SetY(pt.Y() - dragPoint.Y());
572  }
573  else // without centering
574  {
575  renderOffset.SetX(-GetcurrentPositionGPixel().X() - dragPoint.X());
576  renderOffset.SetY(-GetcurrentPositionGPixel().Y() - dragPoint.Y());
577  renderOffset.Offset(mouseLastZoom);
578  }
579  }
580  else // use current map center
581  {
582  mouseLastZoom = Point::Empty;
583 
584  Point pt = Point(-(GetcurrentPositionGPixel().X() - Width/2), -(GetcurrentPositionGPixel().Y() - Height/2));
585  renderOffset.SetX(pt.X() - dragPoint.X());
586  renderOffset.SetY(pt.Y() - dragPoint.Y());
587 
588  }
589 
591  }
592  void Core::DragOffset(Point const& offset)
593  {
594  renderOffset.Offset(offset);
595 
597 
598  if(centerTileXYLocation != centerTileXYLocationLast)
599  {
600  centerTileXYLocationLast = centerTileXYLocation;
601  UpdateBounds();
602  }
603 
604  {
605  LastLocationInBounds = CurrentPosition();
606  SetCurrentPosition (FromLocalToLatLng((qint64) Width/2, (qint64) Height/2));
607  }
608 
609  emit OnNeedInvalidation();
610  emit OnMapDrag();
611  }
612  void Core::Drag(Point const& pt)
613  {
614  renderOffset.SetX(pt.X() - dragPoint.X());
615  renderOffset.SetY(pt.Y() - dragPoint.Y());
616  keepInBounds();
618 
619  if(centerTileXYLocation != centerTileXYLocationLast)
620  {
621  centerTileXYLocationLast = centerTileXYLocation;
622  UpdateBounds();
623  }
624 
625  if(IsDragging())
626  {
627  LastLocationInBounds = CurrentPosition();
628  SetCurrentPosition(FromLocalToLatLng((qint64) Width/2, (qint64) Height/2));
629  }
630 
631  emit OnNeedInvalidation();
632 
633 
634  emit OnMapDrag();
635  }
637  {
638  if(started)
639  {
640  ProcessLoadTaskCallback.waitForDone();
641  MtileLoadQueue.lock();
642  {
643  tileLoadQueue.clear();
644  //tilesToload=0;
645  }
646  MtileLoadQueue.unlock();
647  MtileToload.lock();
648  tilesToload=0;
649  MtileToload.unlock();
650  // ProcessLoadTaskCallback.waitForDone();
651  }
652  }
654  {
655  MtileDrawingList.lock();
656  {
658 
659 #ifdef DEBUG_CORE
660  qDebug()<<"OnTileLoadStart: " << tileDrawingList.count() << " tiles to load at zoom " << Zoom() << ", time: " << QDateTime::currentDateTime().date();
661 #endif //DEBUG_CORE
662 
663  emit OnTileLoadStart();
664 
665 
666  foreach(Point p,tileDrawingList)
667  {
668  LoadTask task = LoadTask(p, Zoom());
669  {
670  MtileLoadQueue.lock();
671  {
672  if(!tileLoadQueue.contains(task))
673  {
674  MtileToload.lock();
675  ++tilesToload;
676  MtileToload.unlock();
677  tileLoadQueue.enqueue(task);
678 #ifdef DEBUG_CORE
679  qDebug()<<"Core::UpdateBounds new Task"<<task.Pos.ToString();
680 #endif //DEBUG_CORE
681  ProcessLoadTaskCallback.start(this);
682  }
683  }
684  MtileLoadQueue.unlock();
685  }
686 
687  }
688  }
689  MtileDrawingList.unlock();
691  }
693  {
694  list.clear();;
695  for(int i = -sizeOfMapArea.Width(); i <= sizeOfMapArea.Width(); i++)
696  {
697  for(int j = -sizeOfMapArea.Height(); j <= sizeOfMapArea.Height(); j++)
698  {
699  Point p = centerTileXYLocation;
700  p.SetX(p.X() + i);
701  p.SetY(p.Y() + j);
702 
703  //if(p.X < minOfTiles.Width)
704  //{
705  // p.X += (maxOfTiles.Width + 1);
706  //}
707 
708  //if(p.X > maxOfTiles.Width)
709  //{
710  // p.X -= (maxOfTiles.Width + 1);
711  //}
712 
713  if(p.X() >= minOfTiles.Width() && p.Y() >= minOfTiles.Height() && p.X() <= maxOfTiles.Width() && p.Y() <= maxOfTiles.Height())
714  {
715  if(!list.contains(p))
716  {
717  list.append(p);
718  }
719  }
720  }
721  }
722 
723 
724  }
726  {
727  double rez = Projection()->GetGroundResolution(Zoom(), CurrentPosition().Lat());
728  pxRes100m = (int) (100.0 / rez); // 100 meters
729  pxRes1000m = (int) (1000.0 / rez); // 1km
730  pxRes10km = (int) (10000.0 / rez); // 10km
731  pxRes100km = (int) (100000.0 / rez); // 100km
732  pxRes1000km = (int) (1000000.0 / rez); // 1000km
733  pxRes5000km = (int) (5000000.0 / rez); // 5000km
734  }
738  void Core::keepInBounds()
739  {
740  if(renderOffset.X()>0)
741  renderOffset.SetX(0);
742  if(renderOffset.Y()>0)
743  renderOffset.SetY(0);
744 
745  qint64 maxDragY=GetCurrentRegion().Height()-GetTileRect().Height()*(maxOfTiles.Height()-minOfTiles.Height()+1);
746  qint64 maxDragX=GetCurrentRegion().Width()-GetTileRect().Width()*(maxOfTiles.Width()-minOfTiles.Width()+1);
747 
748  if(maxDragY>renderOffset.Y())
749  renderOffset.SetY(maxDragY);
750  if(maxDragX>renderOffset.X())
751  renderOffset.SetX(maxDragX);
752 
753  }
754 }
qint64 X() const
Definition: point.h:51
Rectangle GetTileRect()
Definition: core.h:122
void OnNeedInvalidation()
qint64 Height
Definition: core.h:279
virtual Size TileSize() const =0
void SetProjection(PureProjection *value)
Definition: core.h:137
void SetCurrentPositionGPixel(core::Point const &value)
Definition: core.h:286
QList< UrlFactory::geoCodingStruct > GetCoordinatesFromAddress(const QString &address, GeoCoderStatusCode::Types &status)
Definition: core.cpp:450
void UpdateCenterTileXYLocation()
Definition: core.cpp:416
void GoToCurrentPositionOnZoom()
Definition: core.cpp:557
QString ToString() const
Definition: loadtask.h:59
virtual core::Point FromLatLngToPixel(double lat, double lng, int const &zoom)=0
void OnTilesStillToLoad(int number)
int pxRes100km
Definition: core.h:283
void OnMapTypeChanged(MapType::Types type)
diagnostics GetDiagnostics()
Definition: core.cpp:226
Trim off last
const char t[]
Definition: coreconstants.h:40
void OnTileLoadComplete()
PointLatLng CurrentPosition() const
Definition: core.h:79
core::Point Pos
Definition: loadtask.h:40
int pxRes5000km
Definition: core.h:285
QList< core::Point > tileDrawingList
Definition: core.h:131
void SetX(const qint64 &value)
Definition: point.h:53
PointLatLng FromLocalToLatLng(qint64 const &x, qint64 const &y)
Definition: core.cpp:480
virtual PointLatLng FromPixelToLatLng(const qint64 &x, const qint64 &y, const int &zoom)=0
QList< UrlFactory::geoCodingStruct > GetAddressesFromCoordinates(PointLatLng coord, GeoCoderStatusCode::Types &status)
Definition: core.cpp:445
void SetUserImageHorizontalScale(double hScale)
Definition: core.cpp:288
void SetZoom(int const &value)
Definition: core.cpp:235
int MaxZoom() const
Definition: core.h:147
PureProjection * Projection()
Definition: core.h:133
void SetY(const qint64 &value)
Definition: point.h:54
for i
Definition: OPPlots.m:140
RectLatLng CurrentViewArea()
Definition: core.cpp:472
static RectLatLng FromLTRB(double const &lng, double const &lat, double const &rightLng, double const &bottomLat)
Definition: rectlatlng.h:69
Rectangle GetCurrentRegion()
Definition: core.h:128
void SetUserImageVerticalScale(double vScale)
Definition: core.cpp:292
bool IsDragging() const
Definition: core.h:142
virtual core::Point FromPixelToTileXY(const core::Point &p)
QList< QByteArray > Overlays
Definition: tile.h:56
void SetCurrentPosition(const PointLatLng &value)
Definition: core.cpp:263
void Drag(core::Point const &pt)
Definition: core.cpp:612
void OnMapSizeChanged(int const &width, int const &height)
Definition: core.cpp:423
Point FromLatLngToLocal(PointLatLng const &latlng)
Definition: core.cpp:486
core::Point GetcurrentPositionGPixel()
Definition: core.h:83
void DragOffset(core::Point const &offset)
Definition: core.cpp:592
void OnCurrentPositionChanged(internals::PointLatLng point)
double Lng() const
Definition: pointlatlng.h:76
double Lat() const
Definition: pointlatlng.h:64
Lat
Definition: OPPlots.m:110
double Bottom() const
Definition: rectlatlng.h:154
virtual Size GetTileMatrixMinXY(const int &zoom)=0
double GetElevationFromCoordinates(PointLatLng coord, GeoCoderStatusCode::Types &status)
Definition: core.cpp:455
MapType::Types GetMapType()
Definition: core.h:151
void StartSystem()
Definition: core.cpp:405
int Zoom() const
Definition: core.h:144
void CancelAsyncTasks()
Definition: core.cpp:636
double Right() const
Definition: rectlatlng.h:149
int runningThreads
Definition: diagnostics.h:36
void BeginDrag(core::Point const &pt)
Definition: core.cpp:513
void ClearPointsNotIn(QList< core::Point > list)
Definition: tilematrix.cpp:100
void UpdateBounds()
Definition: core.cpp:653
int pxRes1000km
Definition: core.h:284
void OnTileLoadStart()
qint64 Width
Definition: core.h:278
void ReloadMap()
Definition: core.cpp:525
Tile * TileAt(const core::Point &p)
Definition: tilematrix.cpp:127
void FindTilesAround(QList< core::Point > &list)
Definition: core.cpp:692
QString ToString() const
Definition: point.h:55
virtual Size GetTileMatrixMaxXY(const int &zoom)=0
void SetUserImageLocation(QString mapLocation)
Definition: core.cpp:296
PointLatLng LocationTopLeft() const
Definition: rectlatlng.h:73
Definition: icore.h:39
int GetMaxZoomToFitRect(RectLatLng const &rect)
Definition: core.cpp:492
void GoToCurrentPosition()
Definition: core.cpp:547
void OnMapClose()
Definition: core.cpp:440
void SetMapType(MapType::Types const &value)
Definition: core.cpp:301
core::Point GetPos()
Definition: tile.h:46
TileMatrix Matrix
Definition: core.h:194
x
Definition: OPPlots.m:100
virtual double GetGroundResolution(const int &zoom, const double &latitude)
PureProjection::GetGroundResolution Returns the conversion from pixels to meters. ...
int pxRes10km
Definition: core.h:282
int pxRes1000m
Definition: core.h:281
void SetTileAt(const core::Point &p, Tile *tile)
Definition: tilematrix.cpp:139
void OnMapZoomChanged()
GeoCoderStatusCode::Types SetCurrentPositionByKeywords(QString const &keys)
Definition: core.cpp:460
qint64 Y() const
Definition: point.h:52
void UpdateGroundResolution()
Definition: core.cpp:725
void Offset(const qint64 &dx, const qint64 &dy)
Definition: point.h:58
int pxRes100m
Definition: core.h:280
void EndDrag()
Definition: core.cpp:519
void run()
Definition: core.cpp:55
y
Definition: OPPlots.m:101