mapbox

How do you center the map on a clicked symbol using MapBox and React Native?

瘦欲@ 提交于 2019-12-13 03:46:22
问题 Spent a long time trying to do this: Mapbox show how to do it here, but I'm unsure how it works in React Native: https://docs.mapbox.com/mapbox-gl-js/example/center-on-symbol/ I'm using ShapeSource and SymboLayer, getting my markers from a geoJson. I can't seem to target the specific icon and its' coordinates. I've tried something like this, but it just takes be to the first feature location (not the location of the specific icon clicked): onPress={() => {this._map.flyTo(featureCollection

NativeScript: addMarkers outside of onMapReady

落花浮王杯 提交于 2019-12-13 02:50:53
问题 I'm new in NativeScript, and I'm playing with maps, using Mapbox. I want add markers, programmatically from a function when tap a buttom, to map. XML ` <Button text="GET" tap="getRequest" /> <<<-- BUTTON! <ContentView> <map:MapboxView accessToken= token mapStyle="streets" zoomLevel="13" showUserLocation="false" disableRotation= "true" disableTilt="false" mapReady="onMapReady"> </map:MapboxView> </ContentView>` JS `function onMapReady(args) { args.map.addMarkers([ { id: 1, lat: -35.30505050,

Adding a Shapes files as a Layer on Mapbox Map

一笑奈何 提交于 2019-12-13 02:08:40
问题 I have a shapes file from here. I wish to add it on a Map, similar to what is done on the web page. I am not quite sure how to proceed with it. I want to use it on Web and hence use JavaScript. Someone suggested me to use the shapes file as a Layer on the map. But how to go about it? Anyone experience with Mapbox , Leaflet or OSM please guide. 回答1: In order to load a SHP file and display it on a Leaflet / Mapbox.js map, you have several Leaflet plugins that can make the task easy. For example

How to add own tile in Mapbox 4.1

孤街浪徒 提交于 2019-12-12 15:20:05
问题 I have a source for tiles as an url and want to add these to my map. I am able to do this with Google Map and OSMDroid , but I do not know how to figure it out using Mapbox . My url has the format "http...mysource..x=..y=..z=.." I have seen a solution for web, but I do not find such an approach for mobile. 回答1: I assume you have a URL for a tile server such as http://server/tiles/{z}/{x}/{y}.png If so, please update your question. Please see this Mapbox example, https://www.mapbox.com/android

How do I add a simple image overlay in Mapbox Javascript?

可紊 提交于 2019-12-12 13:18:19
问题 The following link in the Mapbox Javascript API describes how to add an image overlay on a map, and it is very simple : https://www.mapbox.com/mapbox-gl-js/example/image-on-a-map/ This works! However, I am trying to add an image overlay on a custom map. I am wanting to do this without creating tiles or anything of the like. I can't find a way to overlay an image on a satellite map (that's my goal, just a weather radar GIF on a satellite map), but I can't seem to get this to work on any other

iOS: Creating dynamic speech balloons for annotations that appear from user input using MapBox

浪尽此生 提交于 2019-12-12 10:06:36
问题 In the code posted, when you click on the annotation, the speech balloon pops up to say Hello World! Welcome to my marker I would like to know how to make the speech bubble appear while using the app, and have the speech bubble display some text that the user would enter in, and disappear after about an hour or so. The bubble would be able to be seen by other users even if the user logged out or closed the app, and the bubble would still be open when the user goes back into the app, unless

How to convert radius in metres to pixels in mapbox leaflet?

可紊 提交于 2019-12-12 09:44:29
问题 I am working on an application where I am trying to run some algorithms on a map and calculate coords but they are slightly off because I am running the calculations on latitude and longitudes and the final results are getting distorted. Now I am trying to convert all coordinates to EPSG3857 Web Mercator coordinates like so: var crs = L.CRS.EPSG3857; var zoom = terrainAnalysisMap.getZoom(); markerToPoint = crs.latLngToPoint(marker.getLatLng(), zoom); markerOnRadiusToPoint = crs.latLngToPoint

Mapbox Android disable scroll and pan the map

帅比萌擦擦* 提交于 2019-12-12 08:27:47
问题 I'm trying to disable the zoom and pan the mapview in a mapbox. I use mapbox 0.4.0. Currently I can disable the zoom, but cannot disable the pan MapView mv = (MapView) tab.findViewById(R.id.mapid); mv.setZoom(14); mv.setMaxZoomLevel(14); mv.setMinZoomLevel(14); 回答1: In the current version (4.1), this should probably do: map.getUiSettings().setZoomControlsEnabled(false); map.getUiSettings().setZoomGesturesEnabled(false); map.getUiSettings().setScrollGesturesEnabled(false); Or if you want to

MapBox: Changing an existing polygon's color

三世轮回 提交于 2019-12-12 06:19:15
问题 I'm attempting to use the following code to change the color of a polygon on my MapBox map, after it's already been added to the map. parishPolygon990 = L.polygon([ vertices ], { color: "#0000FF" }).addTo(map); console.log(parishPolygon990); // returns #0000FF console.log(parishPolygon990.options['color']); // returns #0000FF parishPolygon990.options.color = '#d31603'; console.log(parishPolygon990); // returns #d31603 console.log(parishPolygon990.options['color']); // returns #d31603 You can

Drawable icons on route not pinned at base

。_饼干妹妹 提交于 2019-12-12 05:07:23
问题 I am using drawable images for marker icons on a route. The base of the image does not appear at the point but rather more in the middle. Can this be addressed? Double latitude = new Double(getString(R.string.sagrada_latitude)); Double longitude = new Double(getString(R.string.sagrada_longitude)); final Position origin = Position.fromCoordinates(longitude, latitude); latitude = new Double(getString(R.string.mataro_latitude)); longitude = new Double(getString(R.string.mataro_longitude)); final