Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

My app takes a long time to respond

 Post Reply Post Reply
Author
Gledston de Oliveira Reis View Drop Down
New Member
New Member
Avatar

Joined: 21 Mar 2017
Posts: 17
Post Options Post Options   Quote Gledston de Oliveira Reis Quote  Post ReplyReply Direct Link To This Post Topic: My app takes a long time to respond
    Posted: 15 Sep 2017 at 9:17pm
I have this component and it works fine, but sometimes especially when the internet is slow, my application does not respond or takes a long time to respond while the map is not fully reloaded. What would be a solution?

I'll be more specific. I have a map loading and I'm running a Thread and when the Internet gets slow the map does not load and my app gets stuck until the map loads completely. Any tips?

Best regards
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2088
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 18 Sep 2017 at 8:54am
Hi,

Please note that a reliable internet connection is required for this component.
Unfortunately we have no control over the performance or behavior of the API in situations where the internet connection is slow.
Back to Top
Gledston de Oliveira Reis View Drop Down
New Member
New Member
Avatar

Joined: 21 Mar 2017
Posts: 17
Post Options Post Options   Quote Gledston de Oliveira Reis Quote  Post ReplyReply Direct Link To This Post Posted: 25 Sep 2017 at 3:11am
OK thank you! This happens sometimes when I'm creating a route using the component, and sometimes the map does not load and the application freezes.

Question how could I unload the component completely from memory? And try to recharge it again?
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2088
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 25 Sep 2017 at 10:57am
Have you tried using the Reinitialize call?
Back to Top
Gledston de Oliveira Reis View Drop Down
New Member
New Member
Avatar

Joined: 21 Mar 2017
Posts: 17
Post Options Post Options   Quote Gledston de Oliveira Reis Quote  Post ReplyReply Direct Link To This Post Posted: 25 Sep 2017 at 1:53pm
I did not try. I will explain better, I have a form that I pass the latitudes and longitudes to be created a route as below:

TMSFMXWebGMapsMain-> GetDirections (FormMain-> Lat, FormMain-> Lng, FormMain-> LatDst, FormMain-> LngDst,
false, TTravelMode :: tmDriving, TUnits :: usMetric,
TLanguageName :: lnPortuguese);

This is running on a Thread, after it executes this function the thread synchronizes to show the route:

TRoute * Route;
TMarker * MarkerBegin, * MarkerEnd;
Tmswebgmapspolygons :: TMapPolygon * CircleBegin, * CircleEnd;
TPolygonItem * PolygonItem;

Route = TMSFMXWebGMapsMain-> Directions-> operator [] (0);

TMSFMXWebGMapsMain-> MapZoomTo (Route-> Bounds);
TMSFMXWebGMapsMain-> CreateMapPolyline (Route-> Polyline);

MarkerBegin = TMSFMXWebGMapsMain-> Markers-> Add ();
MarkerGenin-> Draggable = false;
MarkerBegin-> Latitude = Route-> Legs-> operator [] (0) -> StartLocation-> Latitude;
MarkerBegin-> Longitude = Route-> Legs-> operator [] (0) -> StartLocation-> Longitude;
        
Marker Home-> Title = L "Iam";
Marker-> Icon = FormMain-> figPointer;
Marker Start-> InitialDropAnimation = true;


MarkerEnd = TMSFMXWebGMapsMain-> Markers-> Add ();
MarkerEnd-> Draggable = false;
MarkerEnd-> Latitude = Route-> Legs-> operator [] (0) -> EndLocation-> Latitude;
MarkerEnd-> Longitude = Route-> Legs-> operator [] (0) -> EndLocation-> Longitude;
MarkerEnd-> InitialDropAnimation = true;

PolygonItem = TMSFMXWebGMapsMain-> Polygons-> Add ();
CircleInicio = PolygonItem-> Polygon;

Circle Start-> PolygonType = ptCircle;
Circle Start-> BackgroundOpacity = 50;
Circle Start-> BorderWidth = 2;
Circle Start-> Radius = Integer (Route-> Legs-> operator [] (0) -> Distance / 30);

if (FormMain-> MyLocalManual) {
Circle Start-> Center-> Latitude = FormMain-> LatitudeManual;
Circle Start-> Center-> Longitude = FormMain-> LongitudeManual;
} else {
Circle Start-> Center-> Latitude = Route-> Legs-> operator [] (0) -> StartLocation-> Latitude;
Circle Start-> Center-> Longitude = Route-> Legs-> operator [] (0) -> StartLocation-> Longitude;
}


PolygonItem = TMSFMXWebGMapsMain-> Polygons-> Add ();
CirculoFim = PolygonItem-> Polygon;

CirculoFim-> PolygonType = ptCircle;
CirculoFim-> BackgroundOpacity = 50;
CircleFim-> BorderWidth = 2;
Circle End-> Radius = Integer (Route-> Legs-> operator [] (0) -> Distance / 30);
Circle-> Center-> Latitude = Route-> Legs-> operator [] (0) -> EndLocation-> Latitude;
Circle-> Center-> Longitude = Route-> Legs-> operator [] (0) -> EndLocation-> Longitude;

TMSFMXWebGMapsMain-> CreateMapPolygon (CircleStart);
TMSFMXWebGMapsMain-> CreateMapPolygon (CircleFim);
TMSFMXWebGMapsMain-> CreateMapMarker (MarkerEnd);
TMSFMXWebGMapsMain-> CreateMapMarker (MarkerStart);

One note is that I only do this after the OnDownloadfinish tells me that the map is fully loaded, so I created a variable that tells me when this happens, only after that I execute the Thread at the beginning of the post.

As I said it usually works most of the time, but sometimes the map does not appear, it looks like it's hidden. When I observed this, I verified in the creation of the form if the masta is visible, if it is not visible I do the following method:

:: FormCreate ...

if (! TMSFMXWebGMapsMain-> Visible) {
TMSFMXWebGMapsMain-> Visible = true;
}

But sometimes it crashes, remembering that I created the method that tells me when the map is fully loaded, except in this case it does not load and my application waits for loading that never happens.

I would like in that case, that when that happens I could empty it of memory and try again.

Another detail I noticed is that this occurs when the Internet is slow.

Best Regards!
Back to Top
Gledston de Oliveira Reis View Drop Down
New Member
New Member
Avatar

Joined: 21 Mar 2017
Posts: 17
Post Options Post Options   Quote Gledston de Oliveira Reis Quote  Post ReplyReply Direct Link To This Post Posted: 25 Sep 2017 at 2:03pm
The same happens with the Internet of quality
Back to Top
Gledston de Oliveira Reis View Drop Down
New Member
New Member
Avatar

Joined: 21 Mar 2017
Posts: 17
Post Options Post Options   Quote Gledston de Oliveira Reis Quote  Post ReplyReply Direct Link To This Post Posted: 25 Sep 2017 at 2:10pm
ps: this is happening on Android
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down