{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-plugins-android/issues/511","repository_url":"https://api.github.com/repos/mapbox/mapbox-plugins-android","labels_url":"https://api.github.com/repos/mapbox/mapbox-plugins-android/issues/511/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-plugins-android/issues/511/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-plugins-android/issues/511/events","html_url":"https://github.com/mapbox/mapbox-plugins-android/issues/511","id":323272177,"number":511,"title":"UserLocation Problems","user":{"login":"viciopoli01","id":17991220,"avatar_url":"https://avatars1.githubusercontent.com/u/17991220?v=4","gravatar_id":"","url":"https://api.github.com/users/viciopoli01","html_url":"https://github.com/viciopoli01","followers_url":"https://api.github.com/users/viciopoli01/followers","following_url":"https://api.github.com/users/viciopoli01/following{/other_user}","gists_url":"https://api.github.com/users/viciopoli01/gists{/gist_id}","starred_url":"https://api.github.com/users/viciopoli01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viciopoli01/subscriptions","organizations_url":"https://api.github.com/users/viciopoli01/orgs","repos_url":"https://api.github.com/users/viciopoli01/repos","events_url":"https://api.github.com/users/viciopoli01/events{/privacy}","received_events_url":"https://api.github.com/users/viciopoli01/received_events","type":"User","site_admin":false},"labels":[{"id":591064401,"url":"https://api.github.com/repos/mapbox/mapbox-plugins-android/labels/Location%20Layer%20Plugin","name":"Location Layer Plugin","color":"67C7EE","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-15T15:34:52Z","updated_at":"2018-05-16T14:58:45Z","closed_at":null,"author_association":"NONE","body":"I'm trying to get the user location using LocationEngine on Android devices , but when I star the app the usser's marker is located in (0.0, 0.0) and never update it's location.\r\nHow is it possible?\r\n\r\n![screenshot_20180515-170336_li](https://user-images.githubusercontent.com/17991220/40065731-b64297d4-5862-11e8-8e55-7de14e1d3eee.jpg)\r\n\r\nI try to replicate the example [https://www.mapbox.com/android-docs/plugins/overview/location-layer/](url)\r\n\r\n`\r\n    private void enableLocationPlugin() {\r\n\r\n        // Check if permissions are enabled and if not request\r\n        if (PermissionsManager.areLocationPermissionsGranted(this)) {\r\n\r\n            // Create an instance of LOST location engine\r\n            initializeLocationEngine();\r\n            LocationLayerOptions options = LocationLayerOptions.builder(this)\r\n                    .build();\r\n            locationLayerPlugin = new LocationLayerPlugin(mapView, mapboxMap, locationEngine, options);\r\n            locationLayerPlugin.setRenderMode(RenderMode.COMPASS);\r\n            locationLayerPlugin.setCameraMode(CameraMode.TRACKING);\r\n            locationLayerPlugin.setLocationLayerEnabled(true);\r\n        } else {\r\n            permissionsManager = new PermissionsManager(this);\r\n            permissionsManager.requestLocationPermissions(this);\r\n        }\r\n    }\r\n\r\n   \r\n    private void initializeLocationEngine() {\r\n        locationEngine = new LocationEngineProvider(this).obtainBestLocationEngineAvailable();\r\n        locationEngine.setPriority(LocationEnginePriority.HIGH_ACCURACY);\r\n        locationEngine.setInterval(1000);\r\n        locationEngine.setFastestInterval(500);\r\n        locationEngine.addLocationEngineListener(this);\r\n        locationEngine.activate();\r\n        locationEngine.requestLocationUpdates();\r\n\r\n        \r\n        Location lastLocation = locationEngine.getLastLocation();\r\n        if (lastLocation != null) {\r\n            setCameraPosition(lastLocation);\r\n            locationEngine.addLocationEngineListener(this);\r\n        } else {\r\n            locationEngine.addLocationEngineListener(this);\r\n        }\r\n    }\r\n`\r\nI'm using this version of MapBox in grandle \r\n\r\n`implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-building:0.2.0'\r\n    implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.12.0'\r\n    implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.5.2'`\r\n"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-plugins-android/issues/comments/389550168","html_url":"https://github.com/mapbox/mapbox-plugins-android/issues/511#issuecomment-389550168","issue_url":"https://api.github.com/repos/mapbox/mapbox-plugins-android/issues/511","id":389550168,"user":{"login":"cammace","id":5652865,"avatar_url":"https://avatars2.githubusercontent.com/u/5652865?v=4","gravatar_id":"","url":"https://api.github.com/users/cammace","html_url":"https://github.com/cammace","followers_url":"https://api.github.com/users/cammace/followers","following_url":"https://api.github.com/users/cammace/following{/other_user}","gists_url":"https://api.github.com/users/cammace/gists{/gist_id}","starred_url":"https://api.github.com/users/cammace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cammace/subscriptions","organizations_url":"https://api.github.com/users/cammace/orgs","repos_url":"https://api.github.com/users/cammace/repos","events_url":"https://api.github.com/users/cammace/events{/privacy}","received_events_url":"https://api.github.com/users/cammace/received_events","type":"User","site_admin":false},"created_at":"2018-05-16T14:58:45Z","updated_at":"2018-05-16T14:58:45Z","author_association":"MEMBER","body":"I responded to your same question on Stack Overflow but will also put my response here:\r\n\r\n---\r\n\r\nFew notes about your code snippet.\r\n\r\n```\r\nLocationLayerOptions options = LocationLayerOptions.builder(this)\r\n                .build();\r\n```\r\n\r\nisn't needed since you aren't actually changing any options.\r\n\r\n```\r\nlocationLayerPlugin.setLocationLayerEnabled(true);\r\n```\r\n\r\nIsn't needed since you are calling `setRenderMode` right above which automatically enables it\r\n\r\nThe issue with seeing the user location at nullisland (0.0, 0.0) has been reported already in https://github.com/mapbox/mapbox-plugins-android/issues/460. \r\n\r\nFor the location updates, it looks like you are attaching a listener. are you receiving updates in that listener and the Location Layers just not updating or are you not receiving any updates at all? If the latter, it's an issue more likely with the locationEngine and not the Location Layer Plugin."}}
{"actor":{"display_login":"cammace"}}