xitingTick / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Not See Map - osmdroid 3.0.10 #446

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Not see mapView
Code:
private MapView mapView;
    protected static GeoPoint point = new GeoPoint(32.341609,31.863321);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mapView = (MapView) findViewById(R.id.mapview);
        mapView.setBuiltInZoomControls(true);
        mapView.getController().setZoom(16);
        mapView.getController().setCenter(point);
}}

What is the expected output? What do you see instead?
Small squares of the map without markings.

What version of the product are you using? On what operating system?
osmdroid 3.0.10

Please provide any additional information below.
on android 4.1.2.

In osmdroid 3.0.4 All worked fine.

Original issue reported on code.google.com by yagelk18 on 1 Jul 2013 at 6:48

GoogleCodeExporter commented 8 years ago
Please take a look at the sample application which works fine. See what is 
different with your implementation or provide more information.

Original comment by kurtzm...@gmail.com on 1 Jul 2013 at 1:10

GoogleCodeExporter commented 8 years ago
where is sample application?

Original comment by yagelk18 on 1 Jul 2013 at 4:27

GoogleCodeExporter commented 8 years ago
You can get it from SVN:

svn checkout http://osmdroid.googlecode.com/svn/trunk/ osmdroid-read-only

or you can browse the code here:

https://code.google.com/p/osmdroid/source/browse/#svn%2Ftrunk%2FOpenStreetMapVie
wer

Original comment by kurtzm...@gmail.com on 2 Jul 2013 at 12:02

GoogleCodeExporter commented 8 years ago
I can confirm this issue. The problem happens with the setZoom() call. Without 
that call, the map loads correctly, and can be easily zoomed in fully. With 
that call, however, the map doesn't load, but there seem to be a lot of HTTP 
requests (based on repeat messages from Apache HTTP). My guess is that it's 
downloading tiles starting from zoom level 1.

Original comment by saiarcot...@gmail.com on 30 Aug 2013 at 2:12

GoogleCodeExporter commented 8 years ago
You're going to need to provide more information. When I put 
mMapView.getController.setZoom(16) in the OpenStreetMapViewer project's 
onCreateView() I get no issue. What version of Android does it work and which 
does it not work? What version of osmdroid? What map tile source are you using? 
Where do you deviate from the OpenStreetMapViewer project which does work 
correctly?

What happens if you move the setZoomLevel() to onActivityCreated()?

Original comment by kurtzm...@gmail.com on 30 Aug 2013 at 2:15

GoogleCodeExporter commented 8 years ago
I only tested Android 4.1.2 since I only have physical access to that. I can 
test in a VM if need be. Osmdroid version is 3.0.10 with slf4j 1.6.1 RC1 and 
the Mapnik tile source.

Unlike the sample project, I have an xml block that creates the map view 
(https://code.google.com/p/osmdroid/wiki/HowToIncludeInYourProject). The reason 
I have an xml block instead of instantiating it from Java itself is because I 
need the map to occupy only part of the view instead of the whole view, as I 
have other controls to display there. Also, in the onCreate() method, I'm 
getting the mapView I declared in the xml and am adding a location overlay, 
compass overlay, and a marker.

Also, I'm not using fragment, but rather just doing everything in an activity. 
I can try using fragments and moving setZoomLevel() to onActivityCreated(), but 
I'll have to get back to my room first.

Original comment by saiarcot...@gmail.com on 30 Aug 2013 at 3:51

GoogleCodeExporter commented 8 years ago
Thanks for the additional information. This appears to be tied to using an XML 
layout and it may have to do with using an Activity directly.

We have a sample that uses XML layout - SampleFragmentXmlLayout. You can get to 
it by starting OpenStreetMapViewer and then going to Samples->MapView in XML 
Layout. Maybe use that as a starting point to reproduce the issue.

When using a Fragment, you get a reference to the MapView in onCreateView() 
whereas in an Activity you get can get access to it in onCreate() - maybe that 
has some bearing on the problem.

Original comment by kurtzm...@gmail.com on 30 Aug 2013 at 4:59

GoogleCodeExporter commented 8 years ago
For what it's worth, I can reproduce this on Android 4.3 (emulator and Nexus 4) 
with osmdroid 3.0.10 and osmdroid 4.
I also use a XML layout (with a fragment). I can zoom in with the controls on 
the screen without a problem.
Further I can see the map for a short moment, e.g. when I tilt the phone to 
landscape and then back to portrait. so the tiles are loaded it's just that 
they are not shown.

Original comment by iulius.gutberlet on 1 Nov 2013 at 8:07

GoogleCodeExporter commented 8 years ago
If anyone can upload a sample project that exhibits this then that would be 
helpful!

Original comment by kurtzm...@gmail.com on 1 Nov 2013 at 8:10

GoogleCodeExporter commented 8 years ago
I noticed the same problem using current version of osmdroid demo app (open 
map) as well as open gps tracker. When I have no Internet connection often some 
tiles stay gray. Like rhis:
http://s1.directupload.net/images/131123/irn9ofrr.png
When I zoom out some levels and in again, it sometimes works. Sometimes other 
tiles are missing. 

Original comment by NotDiffi...@googlemail.com on 23 Nov 2013 at 1:41

GoogleCodeExporter commented 8 years ago
Sorry, I my problem is probably this one :
http://code.google.com/p/osmdroid/issues/detail?id=289&can=1&sort=-id

Original comment by NotDiffi...@googlemail.com on 23 Nov 2013 at 1:47