mapbox

MapBox iOS different marker images?

心不动则不痛 提交于 2019-12-05 13:43:56
Is there a way to add an ID or something, that i am able to set custom marker images? I have multiple markers with numbers, and i need that every new marker has another image. For example: marker1 - marker_1_image marker2 - marker_2_image Atm i am only able to set 1 image (globaly) to all markers: func mapView(mapView: MGLMapView, imageForAnnotation annotation: MGLAnnotation) -> MGLAnnotationImage? { var annotationImage = mapView.dequeueReusableAnnotationImageWithIdentifier("place") if annotationImage == nil { var image = UIImage(named: "marker_1")! image = image.imageWithAlignmentRectInsets

positioning a mapbox/leaflet map inside a container div

。_饼干妹妹 提交于 2019-12-05 12:31:10
I am working with Mapbox in a Ruby on Rails app. For the life of me, I cannot get the map to adhere to any simple CSS. The only CSS that allows the map to appear is giving it an absolute position with a top and bottom of 0. Altering anything other than the height and width causes the map to disappear. I want to have the map centered inside a container div. Here is the code: <div id="map-container"> <div id='map'> </div> </div> <script> L.mapbox.accessToken = 'pk.eyJ1IjoiYWxvb2thdG9tbW9yb3ciLCJhIjoiNGM4ODhkZjUwMGM1ZDE4M2VjNzQ4MmQ4ODcxMjk5ZjMifQ.XVvFc8kl-0z4NAblE-mNqw'; var map = L.mapbox.map(

leaflet.js: too slow with custom svg markers (and a lot of points)

删除回忆录丶 提交于 2019-12-05 12:23:54
I am trying to use some user defined svg icons for markers on leaflet but I think the whole task gets too heavy for my browser. Until now I was using L.circleMarker but I now have to use markers like asterisks, arrows, stars etc instead so I decided to do them as svg path and then plug them in instead of my circleMarkers. To make things more complicated I have more than 300K points. With the circleMarkers I was able to make a workable chart, not lightning fast but quite acceptable especially when a fairly deep zoom was used to be able to distinguish individual points (otherwise everything was

Draw a line between two markers map-box react-native?

六眼飞鱼酱① 提交于 2019-12-05 10:20:12
I was able to achieve creating a marker (annotation) on the map using the below code in react-native . import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View } from 'react-native'; import MapboxGL from '@mapbox/react-native-mapbox-gl'; import Mapbox from '@mapbox/react-native-mapbox-gl'; const columbusCircleCoordinates = [ -73.98197650909422, 40.768793007758816 ]; Mapbox.setAccessToken('your access key'); export default class App extends Component { renderAnnotations () { return ( <Mapbox.PointAnnotation key='pointAnnotation' id='pointAnnotation' coordinate={[11

MapBox clear all current markers

陌路散爱 提交于 2019-12-05 05:08:30
I've created a MapBox instance with: var map = new mapboxgl.Map({ container : 'map', style : 'mapbox://styles/mapbox/streets-v9' }); I need to clear all markers, and have tried things like map.remove(marker) on each one, and a few other things, but nothing seems to work. Is there a simple function call to just clear all markers from the map? EDIT: Different from How to remove all layers and features from map? because I get "eachLayer is not a recognised function" (or similar) in console. You saw this? https://www.mapbox.com/mapbox-gl-js/api/#marker#remove Instead of map.remove maybe try marker

How to find out map tile coordinates from latitude and longitude?

一笑奈何 提交于 2019-12-05 04:41:34
I'm using Mapbox vector tiles to gather specific data from a backend process. In the examples, they provide a link of a Manhattan tile: http://a.tiles.mapbox.com/v3/examples.map-zr0njcqy/14/4823/6160.png being the tile z / x / y coordinates 14 / 4823 / 6160 I know from navigating the map that the position of latitude 40.706119 and longitude -74.017554 is inside that tile. I also deduct from how map works that working with zoom 14 the entire map is composed from 16384 x 16384 tiles being 14/0/0 the top left tile. Yet taking the 180 degrees of latitude and 360 of longitude with the total tile

MapBox water/land detection

耗尽温柔 提交于 2019-12-05 02:42:52
问题 I am starting to use the MapBox iOS SDK. Is there any possible way to query the MapView by a coordinate and get back the terrain-type (water, land) as a result? I've been reading the API doc for quite a while now, but could not figure it out. I know that there are (interim) solutions available to use a Google webservice, but I need this to work offline. I am not bound to MapBox (but I like it) though, thank you for any hint! 回答1: No need to delve into runtime styling (see my other answer,

Use GoogleMap or MapBox Direction API implement my own navigation in my app

此生再无相见时 提交于 2019-12-05 01:39:06
问题 I'd like to implement navigation map for drivers in my Android app. I don't want to use URL scheme to open google Maps app to navigate it. I prefer to implement this navigation function inside my app like what Google Map does. My requirements is pretty simple. Navigate user from PlaceA to PlaceB. After I read the documents from google and MapBox website. there are directions api for user to get all the information like routes. 1 GoogleMap Direction API: https://developers.google.com/maps

Message from debugger: Terminated due to memory issue

旧街凉风 提交于 2019-12-05 00:20:08
My app working with Geojson file. I use MapBox SDK to add MGLPolyline to map. But the problem is my file too large, so that the app crash and got the error: Message from debugger: Terminated due to memory issue . I faced with 66234 objects at first loop. I tried to chunk the array to new array but not success. Please help me to solve the prolem. Here is my code for draw on map and here is my test project on github use Xcode 8.1 If have any different 3rd party which can solve my prolems is welcome too : func drawPolyline() { // Parsing GeoJSON can be CPU intensive, do it on a background thread

Add blur effect on a Mapbox

拜拜、爱过 提交于 2019-12-04 23:59:55
问题 I want to add blur effect in mapbox.when first time load map that time only display current location in map other map is blue.see screenshot when i move the userlocation to another location than other location is clear on the map.also display annotation in specific location see screenshot help me how can implement this here i will some implement code - (CGPoint)convertLatLongCoord:(CGPoint)latLong { CGSize screenSize = [UIScreen mainScreen].applicationFrame.size]; CGFloat SCALE = MIN