mapbox

use autocomplete feature of mapbox in ios application

为君一笑 提交于 2019-12-11 12:04:14
问题 Can we use autocomplete feature of Mapbox into iOS application ? I'm looking for some kind of help for that. I have already created a map view using Mapbox . But now I want to add a textfield onto it and when i look for a place, the autocomplete feature should populate some place names for me. 回答1: Have a look at MapboxGeocoder.swift and UISearchBar. 回答2: autocompletesQuery is enabled by default, you can change it with options.autocompletesQuery = BOOL then get the results array of

MapBox and TIFF

我与影子孤独终老i 提交于 2019-12-11 11:53:12
问题 I am trying to show my TIFF file at the MapBox's map. I am starting with this example: https://www.mapbox.com/mapbox-gl-js/example/vector-source/ by replacing map.addSource('terrain-data', { type: 'vector', url: 'mapbox://mapbox.mapbox-terrain-v2' }); with map.addSource('terrain-data', { type: 'vector', url: 'mapbox://xxx.yyy' }); where xxx.yyy is my Map ID from Data section of the account (https://www.mapbox.com/studio/data/) JavaScript initiates needed calls (to some jpg files), but all of

Show navigation view of mapbox with direction units km/minutes instead of miles/feets

寵の児 提交于 2019-12-11 10:57:56
问题 how to Show navigationview of mapbox with direction units km/minutes instead of miles/feets String awsPoolId = null; boolean simulateRoute = false; Log.e("=origin==", "" + origin); Log.e("=desti==", "" + destination); // Call this method with Context from within an Activity NavigationLauncher.startNavigation(GotoPickup.this, origin, destination, awsPoolId, simulateRoute); 回答1: You have to set your desired type (METRIC). I calculate the route from Mapbox (pay attention to voice instructions)

Removing geojson layers Mapbox.js/Leaflet.js

…衆ロ難τιáo~ 提交于 2019-12-11 10:07:48
问题 I'm having trouble removing multiple geojson layers at a time. When I keep them as feature layers, there is memory of each and every layer added, one right after the other. But when they become marker layers only the last layer clicked is removed. I've tried adding them to a group and calling clearLayers on the group, but that still only removes the last layer added, not all. Tried passing an id also, but that didn't seem to work either. $(function() { var geojson; var map = L.mapbox.map('map

How to get usable canvas from Mapbox GL JS

徘徊边缘 提交于 2019-12-11 08:38:25
问题 I'm using Mapbox GL, and trying to get a snapshot of it, and merge the snapshot with another image overlaid for output. I have a HTMLCanvasElement off screen, and I'm first writing the canvas returned from Map.getCanvas() to it, then writing the second (alpha transparent) canvas over that. The problem is that, though I clearly see elements onscreen in the Map instance, the result only shows the second image/canvas written, and the rest is blank. So I export just the map's canvas, and I see it

Mapbox Callout moving on Pan/Zoom.

左心房为你撑大大i 提交于 2019-12-11 08:38:15
问题 I have followed the guide here to create custom Callout Views. I added two lines to the custom class: var dismissesAutomatically: Bool = false var isAnchoredToAnnotation: Bool = true These seem to do the job when it comes to keeping the Callout View displayed when panning and zooming, and keeping it anchored to the annotation. However, The Callout seems to drop down about 20 pixels when the user pans or zooms. Initial View when annotation is tapped, but before panning/zooming: View

Popups no longer function after filtering markers in mapbox

ⅰ亾dé卋堺 提交于 2019-12-11 08:05:10
问题 I have set up features from an external geoJson file in Mapbox and bound popups to these features following the example at https://www.mapbox.com/mapbox.js/example/v1.0.0/custom-popup/ var myLayer = L.mapbox.featureLayer(bldgData).addTo(map); myLayer.eachLayer(function(layer) { // set up popup for each marker var content = ""; var props = layer.feature.properties; var imagePart = "<img class='popupPic' src='images/thumbnails/" + props.filename + "' ></img>"; var infoPart = "<h3 class=

Display Location with MapBox java-script SDK [duplicate]

ぐ巨炮叔叔 提交于 2019-12-11 07:29:53
问题 This question already has answers here : Using MapBox for Geolocation in html (2 answers) Closed last year . How do I display location of an address on an HTML page using MapBox SDk forward Geo-Coding function. The SDK already does the query, but I need to be able to display the map and its location with a point on the html. here is my sample code. <html> <head> <meta charset="utf-8"> <title>MapBox</title> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">

How to make a MGLPolyline tapable?

混江龙づ霸主 提交于 2019-12-11 07:20:54
问题 I am currently looking for a way to make a route (MGPLPolyline) tappable such that a user can choose between two possible routes under Mapbox. Unfortunately the route annotation doesn't seem to be tappable at all: While i have properly set my MGLMapViewDelegate this method: func mapView(_ mapView: MGLMapView, didSelect annotation: MGLAnnotation) is never invoked. What did i miss knowing that each line inherited from MGLPolyline which is a subclass of an MGLAnnotation (which i was expected to

How using offline map in android

大憨熊 提交于 2019-12-11 07:11:26
问题 I want download a particular city in my app. How can do this? There is another problem, too: when I use SDK of Mapbox 4.1.1 I can't add the class BoundingBox . I have a problem, a code that exists on their site to download the map is not based just once. I have to stop running the program, and when I re-run it the map does not load again. This is my code : // Mapbox access token is configured here. This needs to be called either in your application // object or in the same activity which