question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Indication for “graphics complete”

See original GitHub issue

Issue Type

[X] Question

Description and/or steps/code to reproduce the problem

@monsieurtanuki

Is there some way to know for sure if the graphics engine in osmdroid is completely done? If there are numerous overlays, the update may take a while. And I am not allowed to change the underlying data in between, as this could lead to an Exception.

The drawing process is triggered with mapView.invalidate() but when does it finish?

Environment

If it’s a bug, version(s) of android this affects:

All

Version of osmdroid the issue relates to:

6.1.11

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
mikebravoyescommented, Dec 21, 2021

@monsieurtanuki You were right: It had nothing to do with the display refresh. The problem was the following: There is a data set of geographical coordinates, which are translated into one or more Polylines for the map. This data set can be manipulated by two asynchronous threads, which may interfere with each other. To avoid that, I introduced a Semaphore, which is initialized at the start of the app.

public static Semaphore mutex = new Semaphore(1);

Then, in the two competing threads, they block each other with:

try {
	mutex.acquire();
	// prepare the data set with geographical coordinates
	...
	// generate Polylines from data set
	...
	mapView.invalidate();
} catch (InterruptedException e) {
	e.printStackTrace();
} finally {
	mutex.release();
}

And everything works without any problems. Thanks for your support!

1reaction
mikebravoyescommented, Dec 20, 2021

@monsieurtanuki OK, I will make some tests accordingly and let you know…

Read more comments on GitHub >

github_iconTop Results From Across the Web

URR 0.9 Update: Graphics Complete! - Dr Mark R Johnson
URR 0.9 Update: Graphics Complete! Hello everyone! I am so pleased to say that the first major milestone for 0.9 has been accomplished:...
Read more >
2021 August Giveaway | Attack Graphics Complete Custom ...
2021 August Giveaway | Attack Graphics Complete Custom Graphics Kit. 3.1K views 1 year ago. Rocky Mountain ATV MC. Rocky Mountain ATV MC....
Read more >
Superhero Graphics - Complete Set - Pinterest
Superhero Graphics - Complete Set. Description 12 unique and diverse superhero figures that students can color in. These are designed to ...
Read more >
Harvard Graphics: The Complete Reference/Covers Releases ...
A guide to all versions of Harvard Graphics, including the new version 2.3. The five sections cover descriptions of all the Harvard Graphics...
Read more >
Vital Sign & Graphics | Cohoes NY - Facebook
Vital Sign & Graphics Company is a Cohoes, NY based signage manufacturer ... May be an image of text that says 'Vital Sign...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found