mapbox

Mapbox - Can I use the locationlistener without Mapbox map

江枫思渺然 提交于 2019-12-12 04:58:16
问题 I know the way to use locationListener and triggering the GPS is done like that: mapboxMap.setMyLocationEnabled(true); I want to open the locationListener at app start, but I don't want to use the map in the startActivity . Just using the locationListener without map. How can I do with Mapbox ? 回答1: You can use an instance of LocationEngine to acquire location updates without showing the map. final LocationEngine locationEngine = new LostLocationEngine(this); locationEngine.setPriority

Mapbox: Cant add LocationLayer plugin in gradle

江枫思渺然 提交于 2019-12-12 04:56:50
问题 when I try to include the LocationLayer plugin in my gradle file I get an error. The traffic plugin and building plugin work fine. The error: Failed to resolve: android.arch.lifecycle:extension:1.0.0-alpha3 Failed to resolve: android.arch.lifecycle:runtime:1.0.0-alpha3 build.gradle: repositories { mavenCentral() } dependencies { //Mapbox compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.0@aar') { transitive = true } //Navigation compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.3.1

get lying longitude and latitude from current bound or Cartesian coordinates/Rectangle shape

若如初见. 提交于 2019-12-12 04:36:41
问题 I am working to get Instagram results from a shape drawn on a map. Instagram needs lat and lon + radius. https://api.instagram.com/v1/media/search?lat=48.858844&lng=2.294351&access_token=ACCESS-TOKEN What my issue is I can do this if I use circle but for rectangle I am not getting what to send to api. My image/ map plus rectangle. If I use getBounds(); Then I get _northEast Object { lat=33.97980872872457, lng=-82.166748046875, equals=function(), more...} _southWest Object { lat=33

Fitting map bounds to raster layer

巧了我就是萌 提交于 2019-12-12 04:07:10
问题 I've ran across all fitbounds tutorials for Mapbox and still cannot figure out how refocus my map on a given raster layer. I have a menu that toggles a number of older maps and would like to refit the map at each turn. Here's what I have so far. mapnumber is the string for my raster map. var coordinates = map.getBounds(mapnumber); var bounds = new mapboxgl.LngLatBounds(coordinates[0], coordinates[0]); map.fitBounds({bounds}); The bounds are there, I just cannot use fitbounds on them. This is

Programmatically change OFFSET of MapBox Marker via JavaScript

≯℡__Kan透↙ 提交于 2019-12-12 04:05:36
问题 Following on from this question I asked yesterday... I am adding MapBox Markers to an array like so: var el = document.createElement('div' + index); el.className = 'marker'; deviceMarkers.push(new mapboxgl.Marker(el, { offset: [-50 / 2, -50 / 2] }).setLngLat([device.lat, device.lon]).addTo(map)); Elsewhere in the code, I extract the marker via: var deviceMarker = deviceMarkers[index]; I now need to be able to change the offset of deviceMarker programmatically in javascript, to ensure that the

Leaftlet on Ionic Tabs App shows only first tile

浪子不回头ぞ 提交于 2019-12-12 03:18:37
问题 I have an Ionic Tabs App (I used the Cordova templates on Visual Studio 2015) with a Leaflet map on the second tab. On the first tab I have some search parameters for POIs that I want to show on the map with markers. Everything is working fine, including the map is showing all the tiles, until I start interacting with the controls on the first tab. Specifically, when I enter an input control and the soft keyboard appears, if I then go to the second tab, the map is only showing the first tile.

Rebind Mapbox popups after filtering

时光毁灭记忆、已成空白 提交于 2019-12-12 02:57:34
问题 I've built a Mapbox map that has a fairly involved custom popup structure, including photos and formatting. I'm using a .csv file and omnivore to feed my data, and creating the popup .on ready. I've also got a search box that searches the data using jQuery. Independently, each one works. The popups load fine, and the search is working. But after filtering using the search thing, I lose the popups. I've looked at this similar post but nothing suggested seems to be working. I think this has to

MapBox image for annotation from url

回眸只為那壹抹淺笑 提交于 2019-12-12 02:56:32
问题 I'm using MapBox, and right now, I'm experiencing next problem: I'm using MapBox's delegate method for implementing image for annotation. Now I have some annotation images that needs to be loaded from URL. Problem is that method for custom image is called before image is loaded from URL and there is not image shown on Map. This is code in method: - (MGLAnnotationImage *)mapView:(MGLMapView *)mapView imageForAnnotation:(id <MGLAnnotation>)annotation { MGLAnnotationImage *annotationImage =

Using mapbox in scrollview, scrollview sliding to the position where mapbox is put in the page

余生颓废 提交于 2019-12-12 02:53:22
问题 Now, when I use mapbox in scrollview, scrollview would slide to the position where mapbox is located in the page, but I want to see the top of the page at the first sight, not the mapbox. BTW, I am using Mapbox 4.0.0 Android SDK. what I want see is: However the weird thing is as follows: 回答1: If I understand your question correctly, you are having issues panning/zooming the mapview while it is in a scrollview? This questions been asked here a lot lately... This snippet of code might resolve

Can't use specific methods in Mapbox LocationEngine

China☆狼群 提交于 2019-12-12 02:28:00
问题 I was trying to set up my own navigation app, but i can't use the methods listed here: https://github.com/mapbox/mapbox-java/blob/master/mapbox/app/src/main/java/com/mapbox/services/android/testapp/nav/NavigationActivity.java In details i'm referring at locationEngine.setInterval(0); and locationEngine.setSmallestDisplacement(3.0f); , if used Android Studio complains that they're not existing. I've added the references to the latest mapbox-services snapshot as stated in the homepage of the