{"action":"created","issue":{"url":"https://api.github.com/repos/MKergall/osmbonuspack/issues/140","labels_url":"https://api.github.com/repos/MKergall/osmbonuspack/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/MKergall/osmbonuspack/issues/140/comments","events_url":"https://api.github.com/repos/MKergall/osmbonuspack/issues/140/events","html_url":"https://github.com/MKergall/osmbonuspack/issues/140","id":99152301,"number":140,"title":"NPE when trying to draw a quite big polygon","user":{"login":"porryman","id":5477385,"avatar_url":"https://avatars.githubusercontent.com/u/5477385?v=3","gravatar_id":"","url":"https://api.github.com/users/porryman","html_url":"https://github.com/porryman","followers_url":"https://api.github.com/users/porryman/followers","following_url":"https://api.github.com/users/porryman/following{/other_user}","gists_url":"https://api.github.com/users/porryman/gists{/gist_id}","starred_url":"https://api.github.com/users/porryman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/porryman/subscriptions","organizations_url":"https://api.github.com/users/porryman/orgs","repos_url":"https://api.github.com/users/porryman/repos","events_url":"https://api.github.com/users/porryman/events{/privacy}","received_events_url":"https://api.github.com/users/porryman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-05T08:34:50Z","updated_at":"2015-08-11T10:13:43Z","closed_at":null,"body":"Hi.\r\nI need to draw several polygons, I got NPE when I tried to draw a quite big polygon, I have no problems with smaller ones if I turn off hardware acceleration.\r\n\r\nThis is a piece of my soruce code \r\n\r\nprivate void inicializarMapa() {\r\n        final DisplayMetrics dm = context.getResources().getDisplayMetrics();\r\n        mResourceProxy = new ResourceProxyImpl(getActivity().getApplicationContext());\r\n\r\n        mPrefs = context.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_PRIVATE);\r\n\r\n        mMapController = mMapView.getController();\r\n        mMapController.setZoom(5);\r\n        // only do static initialisation if needed\r\n        if (CloudmadeUtil.getCloudmadeKey().length() == 0) {\r\n            CloudmadeUtil.retrieveCloudmadeKey(context.getApplicationContext());\r\n        }\r\n\r\n        this.mCompassOverlay = new CompassOverlay(context, new InternalCompassOrientationProvider(context), mMapView);\r\n\r\n\r\n        mScaleBarOverlay = new ScaleBarOverlay(context);\r\n        mScaleBarOverlay.setCentred(true);\r\n        mScaleBarOverlay.setScaleBarOffset(dm.widthPixels / 2, 10);\r\n\r\n        mMapView.setBuiltInZoomControls(true);\r\n        mMapView.setMultiTouchControls(true);\r\n  \r\n        mMapView.getOverlays().add(this.mCompassOverlay);\r\n\r\n\r\n        mMapView.getController().setZoom(mPrefs.getInt(Constants.PREFS_ZOOM_LEVEL, 10));\r\n        mMapView.scrollTo(mPrefs.getInt(Constants.PREFS_SCROLL_X, 0), mPrefs.getInt(Constants.PREFS_SCROLL_Y, 0));\r\n\r\n        mCompassOverlay.enableCompass();\r\n\r\n        geoJsonService = new GeoJsonService(MapaIncidenciasFrgmt.this);\r\n\t\t//I get the geoJson from a restfull service\r\n        geoJsonService.execute();\r\n    }\r\n\t\r\n\tpublic void stopWaitForGeoJsonResponse(boolean exito) {\r\n        final KmlDocument kmlDocument = new KmlDocument();\r\n        mLog.info(appContext.getGeoJson());\r\n        kmlDocument.parseGeoJSON(appContext.getGeoJson());\r\n        final FolderOverlay kmlOverlay = (FolderOverlay) kmlDocument.mKmlRoot.buildOverlay(mMapView, null, null,\r\n                kmlDocument);\r\n        mMapView.getOverlays().add(kmlOverlay);\r\n        mMapView.invalidate();\r\n\r\n\t\t\r\n        // mMapView.zoomToBoundingBox(kmlDocument.mKmlRoot.getBoundingBox());\r\n    }\r\n\r\nThis is the exception trace:\r\n\r\n\t08-05 09:28:08.852: W/dalvikvm(13887): threadid=1: thread exiting with uncaught exception (group=0x40bf91f8)\r\n08-05 09:28:08.875: W/System.err(13887): java.lang.NullPointerException\r\n08-05 09:28:08.875: W/System.err(13887): \tat org.osmdroid.views.overlay.OverlayManager.onDraw(OverlayManager.java:113)\r\n08-05 09:28:08.875: W/System.err(13887): \tat org.osmdroid.bonuspack.overlays.FolderOverlay.draw(FolderOverlay.java:65)\r\n08-05 09:28:08.883: W/System.err(13887): \tat org.osmdroid.views.overlay.OverlayManager.onDraw(OverlayManager.java:120)\r\n08-05 09:28:08.883: W/System.err(13887): \tat org.osmdroid.views.MapView.dispatchDraw(MapView.java:924)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.View.buildDrawingCache(View.java:10740)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.drawChild(ViewGroup.java:2741)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.drawChild(ViewGroup.java:2885)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.drawChild(ViewGroup.java:2885)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1089)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.drawChild(ViewGroup.java:2885)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.drawChild(ViewGroup.java:2885)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.View.draw(View.java:11028)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.widget.FrameLayout.draw(FrameLayout.java:450)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.drawChild(ViewGroup.java:2887)\r\n08-05 09:28:08.883: W/System.err(13887): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)\r\n08-05 09:28:08.891: W/System.err(13887): \tat android.view.View.draw(View.java:11028)\r\n08-05 09:28:08.891: W/System.err(13887): \tat android.support.v7.internal.widget.ActionBarOverlayLayout.draw(ActionBarOverlayLayout.java:500)\r\n08-05 09:28:08.891: W/System.err(13887): \tat android.view.ViewGroup.drawChild(ViewGroup.java:2887)\r\n08-05 09:28:08.891: W/System.err(13887): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)\r\n08-05 09:28:08.891: W/System.err(13887): \tat android.view.ViewGroup.drawChild(ViewGroup.java:2885)\r\n08-05 09:28:08.891: W/System.err(13887): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)\r\n08-05 09:28:08.891: W/System.err(13887): \tat android.view.ViewGroup.drawChild(ViewGroup.java:2885)\r\n08-05 09:28:08.891: W/System.err(13887): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)\r\n08-05 09:28:08.891: W/System.err(13887): \tat android.view.View.draw(View.java:11028)\r\n08-05 09:28:08.891: W/System.err(13887): \tat android.widget.FrameLayout.draw(FrameLayout.java:450)\r\n08-05 09:28:08.891: W/System.err(13887): \tat com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2274)\r\n08-05 09:28:08.899: W/System.err(13887): \tat android.view.ViewRootImpl.draw(ViewRootImpl.java:2041)\r\n08-05 09:28:08.899: W/System.err(13887): \tat android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1647)\r\n08-05 09:28:08.899: W/System.err(13887): \tat android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2459)\r\n08-05 09:28:08.899: W/System.err(13887): \tat android.os.Handler.dispatchMessage(Handler.java:99)\r\n08-05 09:28:08.899: W/System.err(13887): \tat android.os.Looper.loop(Looper.java:137)\r\n08-05 09:28:08.899: W/System.err(13887): \tat android.app.ActivityThread.main(ActivityThread.java:4514)\r\n08-05 09:28:08.899: W/System.err(13887): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n08-05 09:28:08.899: W/System.err(13887): \tat java.lang.reflect.Method.invoke(Method.java:511)\r\n08-05 09:28:08.899: W/System.err(13887): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)\r\n08-05 09:28:08.899: W/System.err(13887): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)\r\n08-05 09:28:08.899: W/System.err(13887): \tat dalvik.system.NativeStart.main(Native Method)\r\n\r\nThanks a lot"},"comment":{"url":"https://api.github.com/repos/MKergall/osmbonuspack/issues/comments/129809783","html_url":"https://github.com/MKergall/osmbonuspack/issues/140#issuecomment-129809783","issue_url":"https://api.github.com/repos/MKergall/osmbonuspack/issues/140","id":129809783,"user":{"login":"MKergall","id":1849606,"avatar_url":"https://avatars.githubusercontent.com/u/1849606?v=3","gravatar_id":"","url":"https://api.github.com/users/MKergall","html_url":"https://github.com/MKergall","followers_url":"https://api.github.com/users/MKergall/followers","following_url":"https://api.github.com/users/MKergall/following{/other_user}","gists_url":"https://api.github.com/users/MKergall/gists{/gist_id}","starred_url":"https://api.github.com/users/MKergall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MKergall/subscriptions","organizations_url":"https://api.github.com/users/MKergall/orgs","repos_url":"https://api.github.com/users/MKergall/repos","events_url":"https://api.github.com/users/MKergall/events{/privacy}","received_events_url":"https://api.github.com/users/MKergall/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T10:13:43Z","updated_at":"2015-08-11T10:13:43Z","body":"Disabling hardware acceleration can be necessary with osmdroid. \r\nDo you have the NPE with your big polygon if hardware acceleration is disabled? \r\nHow big it is? (if you provide your GeoJSON file, we could check)"}}