FAQ Database Discussion Community


Load GeoJSON into layer from a URL?

javascript,leaflet,mapbox
I'm using Mapbox 2.1 and I'm trying to build a chloropleth map from a GeoJSON source, working from this example: https://www.mapbox.com/mapbox.js/example/v1.0.0/choropleth/ However, I've fallen at the first hurdle, because my GeoJSON source is a pure GeoJSON file, not a JS file like their example. So this line doesn't work for...

How to move marker in Leaflet along a circle?

javascript,algorithm,leaflet,mapbox
I am working on an application where I have a marker and a circle around it. Now I am creating another marker on the circumference of the circle which is draggable. But I only want it to be draggable on the circumference itself. var coords = [parseFloat(response.lat), parseFloat(response.long)]; terrainAnalysisMap.setView(coords, 18);...

Leaflet coordinates wrapping

javascript,leaflet,mapbox
If I zoom far away and see the world multiples times, when I click somewhere near the edge a mouse click event is fired with some insane coordinates like [32, 500]. To get the real coordinates I have to use event.latlng.wrap(). Is there any way to enable wrapping by default,...

Routing between places with mapbox or similar direction api

openstreetmap,mapbox,geojson
I have a geoJSON objects and I want to route between waypoints on my geoJSON file. { "type":"FeatureCollection", "generator":"JOSM", "bbox":[ 23.4668, 58.9198, 23.6412, 58.974 ], "features":[ { "type":"Feature", "properties":{ "wheelchair":"yes", "smoothness":"bad", "surface":"crushed stones" }, "geometry":{ "type":"Point", "coordinates":[ 23.53359252, 58.95034587858 ] } }, { "type":"Feature", "properties":{ "wheelchair":"yes", "addr:housename":"Saue kohvik", "amenity":"pub", "name":"Saue...

Several different leaflet maps on same page

leaflet,mapbox,gpx
I like to draw several different small segments (gpx-files), each on a separate leaflet map With this code I tried to write around the problem, that leaflet needs a new layer for map I used the "layers"-array to store all map references... <script> var layers = []; var i =...

Google Maps v2 for Android map tiles overlapping

android,google-maps,mapbox
I use custom UrlTileProvider to load tiles from MapBox. public class MapboxTileProvider extends UrlTileProvider { public MapboxTileProvider(int width, int height) { super(width, height); } @Override public URL getTileUrl(int x, int y, int z) { try { return new URL(String.format(MAP_BASE_URL, z, x, y)); } catch (MalformedURLException e) { throw new RuntimeException("Failed...

Removing geojson layers Mapbox.js/Leaflet.js

leaflet,mapbox
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...

Zoom in on maker group in leaflet mapbox?

leaflet,mapbox
I have a layerGroup in my map which has a lot of markers and another layerGroup which has a lot of circles. I need to zoom in on these layer groups but I cannot find the exact API method to do so. I have tried: var myLayerGroup = L.layerGroup().addTo(map); myLayerGroup.fitBounds();...

How can I update GeoJSON on my mapbox map after it has been created?

javascript,jquery,mapbox,geojson
I have this html: <div id="clickthis"><p>addGeoJSON</p></div> <div id='raw'></div> <div id='map'></div> and this is my javascript code: var geojson = [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-77.03238901390978,38.913188059745586] }, "properties": { "title": "Mapbox DC", "description": "1714 14th St NW, Washington DC", "marker-color": "#fc4353", "marker-size": "large", "marker-symbol": "monument" } },...

array of marker layers is not being deleted from leaflet map

javascript,leaflet,mapbox
I am using the following code to delete circles from the map before adding new circles depending on location. if(markers.length>0) { for (var i = 0; i < markers.length; i++) { map.removeLayer(markers[i]); } } var lat,lon; var road; var detector; //var svg=d3.select("#map").append("svg"); data.forEach(function(d) { lat=d.lat; lon=d.lon; road=d.road; detector=d.detectorid; markers.push((new L.circle([lat,...

How to remove MapBox logo from bottom left corner?

javascript,mapbox
I'm embeding a MapBox map in my html page via mapbox.js script like so: L.mapbox.accessToken = 'pk.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxx'; var map = L.mapbox.map('map', 'xxxxx.xxxxxxxx', { zoomControl: false }); This produces a map like this: http://s4.postimg.org/58m4aeb8d/mapbox.png How do I remove "Mapbox" logo in the bottom left corner?...

proper implementation of invalidateSize() to display mapbox/leaflet on mobile device

mobile,maps,leaflet,mapbox,window-resize
I started a question about a bootstrap leaflet map not displaying on mobile devices How can I fix bootstrap leaflet map mobile display? Since then I have used a simple mapbox template for a map and with invalidateSize() as outlined here https://www.mapbox.com/help/why-map-cropped-hidden-shown/ But still no luck getting the map to...

Flask and Jinja2 url_for error - concatenating json object into url_for

python,flask,jinja2,mapbox
I am using Flask with Jinja2 and MapBox on a project which involves plotting data on a map using GeoJSON derived from model data. Example of how this is loaded: $.getJSON("{{ url_for(".geojson") }}", function(data) { var geojson = L.geoJson(data, { onEachFeature: function (feature, layer) { //do stuff } }); markers.addLayer(geojson);...

Mapbox keeps GPS Lock after app is the background on Android

android,gps,location,mapbox
I Want to use mapbox in an app we are building so far it running good, but I keep noticing that even when the app has gone to the background the phone still has a GPS lock. Im using the Mapview component in a fragment and in the initialization of...

mapbox leaflet javascript pane layer control

javascript,leaflet,layer,mapbox,pane
I'm using an approach to create a 'map sandwich' whereby I have a basemap, an overlay layer, and then another tile layer (labels) on top (in a new pane). The problem comes when I try to toggle the labels in a layer control. I can toggle off the layer just...

Set default marker filter in mapbox

javascript,html,filter,mapbox
I'm creating a map using mapbox and I am having a problem with my marker filters. I want the map to load in with a filter already active. I currently have two buttons; development and land. They both work as intended but I would like the map to load with...

Leaflet.js/Mapbox.js On Library Ready event?

javascript,leaflet,mapbox
Is there a way to know when the Leaflet.js or Mapbox.js library is loaded & ready? I'm running into trouble where the library hadn't loaded yet when my DOMContentLoaded event fires. Other libraries, (for example Facebook's JS API), let you define a function, like window._onFacebookready, and when they load they...

How to plot a marker away from another marker by 100 metres in Mapbox Leaflet?

leaflet,mapbox
I am trying to plot a marker using Leaflet and then another marker away from the the first one by 100 metres. Plotting a marker is easy: var marker = L.marker([0, 0]).addTo(map); But now how do I plot another marker away from this one by a 100 metres? Is there...

MBXMapKit MBXOfflineMapDownloader size of download

ios,mapbox
I have an iOS 7/8 app that uses MBXMapKit for downloading and saving maps for offline use. Wondering if I can determine the size of an offline map download at a certain zoom level (UI has a slider to adjust zoom level) before it's downloaded. I'd like to give my...

In Mapbox.js, how to smooth a polyline?

javascript,geometry,leaflet,mapbox
The code can be viewed at http://jsfiddle.net/qsr5bs6v/ Following are the lines to add a polyline L.polyline([[31.233, 121.465], [31.233499, 121.500634], [31.190172, 121.588107]], { color: '#000', smoothFactor: 10.0 }).addTo(map) As can be seen, there is an angle in the joint point of every two lines belonging to the polyline, like this, which...

In leaflet, how to calculate the Pixel Distance between two LatLng object?

gis,leaflet,mapbox
There is a latlng distanceTo method: http://leafletjs.com/reference.html#latlng distanceTo( <LatLng> otherLatlng ) Number Returns the distance (in meters) to the given LatLng calculated using the Haversine formula. See description on wikipedia It calculates the distance (in meters) between two LatLng. However, sometimes I needs to know how many pixels are there...

Convert zip/postcode to latitude and longitude with mapbox API

javascript,geolocation,mapbox
I'm using Mapbox in a web app. I have functionality where a user inputs a zipcode and it should display on the map then do some other stuff with the data. All I'm trying to do right now is convert the zipcode to latitude and longitude to display the marker...

How to add markers via GeoJSON to an existing layer, without having to reset it

maps,mapbox,geojson
I'm using mapbox. I have a layer that contains my markers: map = L.mapbox.map(id, map_id...) map.featureLayer # this is the layer containing all my markers What I want is to add markers to this layer without removing the existing ones. But I don't want to just create a marker via...

Leaflet z-index

javascript,leaflet,mapbox
I'm porting some Google Maps code to Leaflet (well, Mapbox actually). I have quite a lot of shapes (like rectangles, polygons) and markers on the map and I need the ability to adjust their order manually at any time, not just when adding them for the first time. In google...

Is there a way to filter geojson by clicking polygon in Leaflet?

leaflet,mapbox
I have implemented a geojson filter using toggle buttons with a LayerGroup, but would like to know if anyone has been successful with same behavior using on-map mouseclicks. Example: map of world countries. click on Italy polygon results in only Italy being visible. Click outside Italy to show all countries...

Leaflet/Mapbox Markers Don't Repeat After Scrolling Around the Atlas

leaflet,mapbox
Screenshot from Mapbox docs: It seems as though Mapbox won't render given coordinates multiple times on the same map, even if the map is zoomed out far enough to view the same latitude and longitude pairing twice. Is there a way around this? ...

Using circular images for RMPointAnnotation

ios,objective-c,mapbox
I would like to display circular images as the annotation of my Mapbox map. The problem is if I want circular images I need to do it with a UIImageView, but I can't set it for an RMPointAnnotation because it works with UIImage only. Does anybody know how can I...

Custom Mapbox Geocoder Control

leaflet,geocoding,mapbox
I felt like this would be a simple task to do a Google / StackOverflow search for, but I can't seem to find anything on the topic... Anyways, all I want to do is create my own Geocoder Search bar that works OUTSIDE of my mapbox map. For instance, take...

A simple map using Mapbox API not working?

leaflet,mapbox
I am using Mapbox API to create simple maps and learn. I have written a very simple code to display the centre on some coordinates but the map won't show. <!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <title>A simple map</title> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> <script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.js'></script> <link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.css' rel='stylesheet' />...

When do I need mapbox.js?

leaflet,mapbox
I am trying to figure out whether I really need to use mapbox.js, or whether leaflet is sufficient for a mapping project. We will probably be hosting data and tiles ourselves (not basemaps). Where can I find a list of features provided by mapbox.js? I know, for example, that mapbox.js...

Color transition effect in Leaflet.js?

leaflet,mapbox
See this example: https://www.mapbox.com/ten-years-openstreetmap/ Does anyone have any ideas about this? Is it done by CSS transition or Leaflet API?...

resulting HTML from $compile(custom-directive) doesn't bind {{values}}

angularjs,angularjs-directive,angularjs-scope,mapbox,angularjs-compile
I want to dynamically add Angular custom Directives, but the directive resulting from $compile(directive) doesn't have the 2-ways binding. Here's my simplified problem: I am using MapBox, and I want to use Directives for the the markers' popup to show, for example, the markers' title. MapBox wants HTML as a...

How can I add a data source hosted Mapbox into a mapbox-gl-js project

mapbox,mapbox-gl-js,mapbox-gl
How can I add a data source hosted Mapbox into a mapbox-gl-js project? It used to be like this: http://bit.ly/1LcwekS way back in V.2.1 var sourceObj = new mapboxgl.Source({ type: 'vector', url: 'mapbox://foo-bar.ci58c127' }); but mapboxgl.Source is no longer supported in mapboxgl.Source version 8.0...

How to work around the CORS issue in Surface API from mapbox?

ajax,api,cors,mapbox
I am trying to use the Surface API by Mapbox to analyze the terrain between two given points. I am taking the coordinates of the two points and sending an AJAX call to the API but I am stuck with the infamous CORS issue. To start with I am trying...

The “open popup programmatically” button not working on my mapbox.js map I have created

javascript,jquery,popup,mapbox
I have set up a map using Mapbox.js and I need to open my marker areas with an external button. I have looked through the examples of mapbox.com and found the "open popup programmatically" option to be best fitting. However when I plug it in it's not working with my...

Change the placeholder text of an input field after initializing

javascript,jquery,placeholder,mapbox
I am working with an input field that is generated on a map. I would like to change the placeholder text of the input field from "Search" to "Search for Location". The input field does not have a class or id but its parents do. I tried changing after initializing...

how change type map mapbox-leaflet

leaflet,mapbox
I want type of map in a map that I create. I use leaflet and mapbob, but I dont know how change the type of map. var mapboxTiles = L.tileLayer('https://{s}.tiles.mapbox.com/v3/examples.map-zr0njcqy/{z}/{x}/{y}.png', { attribution: '<a href="http://www.mapbox.com/about/maps/" target="_blank">Terms &amp; Feedback</a>' }); How I change the content tileLayer by one create for me? Thank...

How can I fix bootstrap leaflet map mobile display?

twitter-bootstrap,mobile,leaflet,mapbox,window-resize
I'm using bootstrap to set up a leaflet map. Works great on browsers so far, but does not display at all on a mobile. Tried the invalidateSize(); work around to no avail (Leaflet map not displayed properly inside tabbed panel) See code below. <body> <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div...

Leaflet-Omnivore make external file.geojson available to javascript variable

leaflet,mapbox,turfjs
I'm using the Omnivore extension to load my GeoJSON files into a Mapbox/ Leaflet map. Later, I'm using Turf.js on this data. I'm loading the external GeoJSON file to the map as a customLayer, but having trouble making the GeoJSON data available in the variable pts for use later. var...

Centering map on user location with MBXMapkit (Mapbox)

ios,mapkit,mapbox
My code to get MapKit to load on a users location upon loading worked fine until I added MapBox. I'm initializing the MBXRasterTileOverlay* rasterOverlay via -(void)loadMapBox{ _rasterOverlay = [[MBXRasterTileOverlay alloc] initWithMapID:@"myKey"]; _rasterOverlay.center = _mapView.userLocation.coordinate; } However I get a compiler error saying _rasterOverlay.center is read only. Is there any way...

Control pan and zoom animation duration in mapbox.js

mapping,gis,mapbox,mapbox-gl-js
I'm making an animated map showing a series of points using Mapbox.js. Ideally, I want to smoothly switch focus between points by combining zoom and pan like this example created in d3.js. I wonder if there is anyway to control the pan & zoom animation speed (mainly to slow it...

mapbox geojson properties not available on hover

javascript,leaflet,mapbox,geojson
I'm using mapbox and loading multiple geojson layers on to the map, like so: ... var aLayer = L.mapbox.featureLayer('/a.geojson'); var bLayer = L.mapbox.featureLayer('/b.geojson'); var cLayer = L.mapbox.featureLayer('/c.geojson'); var layers = { LayerA: aLayer, LayerB: bLayer, LayerC: cLayer } ... layers.LayerA.addTo(map).on('ready', function(e) { map.fitBounds(LayerA.getBounds(), {animate: true}); }); L.control.layers(layers).addTo(map); Each geojson feature...

In leaflet, how to detect whether a LatLng in current display area?

leaflet,mapbox
As I know, map.project(latlng) can return a point. However, I've no idea about how to tell whether this point is in the current display area of the map.. Does anyone have ideas about this?...

Mapbox map styling for description box

javascript,html,css,mapbox
I am newbie working on his front end skills and I am designing my own website to learn. I am trying to implement a map using the Mapbox API and I cannot get the styling of the description box I am using in the map. Link to my website The...

getting user location and creating map not in sync

ios,swift,mapbox
The below code is getting the user current location and creating a mapbox map. problem is that the mapbox map is being created before the users location is obtain. How may I slow or sync this process? Thank you in advance, import UIKit import CoreLocation import MapboxGL class AViewController: UIViewController,...

Markers not plotting on map using Mapbox and leaflet?

jquery,leaflet,mapbox
I am trying to plot markers from the data I receive for the server. The data is coming in and I can dump via console.log and similarly the marker is also being created as I can dump it also via console.log but the only problem is that I cannot see...

Serving untouched data through Mapbox's static API

mapbox
I would like to use Mapbox's static API to serve some PNG images in which I have encoded georeferenced data, so that I can do some JavaScript data manipulation on the client side (I don't want to show these images). My problem is that this data cannot be changed -...

In leaflet/mapbox, why can't I set the duration of `map.fitBounds`?

gis,leaflet,mapbox
I tried this: map.fitBounds(L.polyline([L.latLng(40,9), L.latLng(1,2)]).getBounds(), { padding: [50, 50], maxZoom: 17, animate: true, duration: 10 }); I expect the animation to take 10 seconds to complete, but it completes very fast.. Does anyone have ideas about how to make the duration longer for fitBounds?...

Using MapBox wms with ArcGis

javascript,arcgis,mapbox
I am using MapBox and are hoping to present some data from an ArcGis WMS service. It seems to be working fine, except that the projections are all wrong. Mapbox takes in an URL for the service and adds querystring parameters based on the current map view, before sending it...

How to add markers to Mapbox layer control?

javascript,mapbox
I am using a simple Mapbox layer control calling MB data layers (below). I need to add a few more marker layers to this, but not sure how to get a mapbox ID. How can I accomplish this? L.mapbox.accessToken = 'pk.eyJ1IjoibWFwc3RlciIsImEiOiI3RmFfME5ZIn0.73sdzUFNqSsGQzjlsnimaA'; var map = L.map('map').setView([38.8922,-77.0348], 14); var layers = document.getElementById('menu-ui');...

React.js and Mapbox: mapbox map not rendering properly when using react.js

javascript,leaflet,reactjs,mapbox
I'm learning to use both react and mapbox,but am struggling with why my mapbox map is not rendering properly when loaded through React. When I load it normally (without React.js), there is no problem, as this following code works and the map appears normally: <script src="https://api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.js"></script> <link rel="stylesheet" href="https://api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.css"/> <div>...

leafleft/mapbox markers stack on top of each other

leaflet,mapbox
This is how I create map and add markers to it: var map, cinemaLayer; map = L.mapbox.map('map-player', 'XXX', { zoom: 10, minZoom: 10, maxZoom: 14, }); cinemaLayer = L.mapbox.featureLayer(); marker = { lat: 48.8656, long: 2.3246, layer: {} }; marker.layer = L.marker(L.latLng(marker.lat, marker.long), { icon: L.divIcon({ className: 'marker-cinema-location', iconSize: [40,...

Mapbox JS markers not being removed using .removeLayer()

javascript,leaflet,mapbox
I have a function that successfully adds markers to a map using the mapbox javascript library. However, I want the function to clear all markers from the map before adding two new ones, so that only two markers are showing at a time. I have looked at other questions/answers here,...

How to remove all layers and features from map?

jquery,leaflet,mapbox
I am working on a map and I would like to remove all features from the map on a certain event. The features are in multiple layers which are plotted dynamically. Some of the code is: $.getJSON('distributor-companies', function (data) { var layers = []; $.each(data, function (i, item) { if...

how to change url titleLayer mapbox

leaflet,mapbox
I need to change my url because I want modify my view map, but I don´t know how I change this url. I want modify this: L.tileLayer('https://{s}.tiles.mapbox.com/v4/mysaqygi.m8jo7i0g/{z}/{x}/{y}.png' I use mapbox, but I don´t know how to change this url when I create my map. where do I change this? I...

How to add markers to map box map?

mapbox
I took the map box store locator example (https://www.mapbox.com/guides/building-a-store-locator/) and am customizing it. The only thing I changed so far, are the lat-long of a couple of the items in the locations variable in the example. The ones that I changed don't show up in the map anymore, but the...

Do embedded GeoJSON styles work with Mapbox GL?

javascript,maps,mapbox,mapbox-gl-js
Is it possible to utilize the built-in properties attribute of a GeoJSON data source to automatically style a Mapbox GL map without having to pre-specify a style? I have a use case where I dynamically load in GeoJSON LineString data that needs to be a particular color and it already...

How to implement offline map in web application and where can i get the map tiles for download?

openstreetmap,mapbox
currently i am trying to do a offline map feature in web application. When their is no internet connection i want to load map tiles from my application it self . How can i have the tile images stored with in my application during the network is available and further...

Can't show two layers one above another in RMMapView from Mapbox SDK iOS

ios,objective-c,mapbox
I have two URL templates (one is a terrain and another is labels). So I need to show the label layer (which is transparent with layers) above the map tiles. I inherited from RMAbstractWebMapSource and made a class AxMapKitTileSource where override a method of providing URL template. So, that's how...

Mapbox Geocoding

javascript,geocoding,mapbox
I recently added Mapbox's Geocoder Control and it works wonderfully. I was wondering if anyone could tell me how I could have a marker appear at the location of the address that was searched for? Below is the code I'm currently using for the control. .addControl(L.mapbox.geocoderControl('mapbox.places', { position: 'topright', keepOpen:...

Mapbox tiles are not showing for V3 (401 not authorized) and messed with V4

leaflet,mapbox
I'm struggling here with Mapbox integration with Leaflet. var map = L.map('map').setView([51.505, -0.09], 13); // create a tile layer sourced from mapbox L.tileLayer('https://{s}.tiles.mapbox.com/v4/mapId/{z}/{x}/{y}.png?access_token=AccessTokenValue').addTo(map); For this current code I get a messed up map : When I change V4 with V3 I get the 401 header with a message :...

Trouble with leaflet maps (GET mapbox tiles unauthorized 401)

leaflet,mapbox
I am trying to add leaflet maps to my webpage and I am using Mapbox tiles. I am not able to get the map in the basic tutorial to work, all I am seeing is a grey screen. I have a mp id from mapbox and I have added it...

How do I keep GeoJSON style after filter?

javascript,mapbox
My map has a simple filter for a small GeoJSON polygon dataset controlled by menu-ui toggles. $('.menu-ui a').on('click', function() { // For each filter link, get the 'data-filter' attribute value. var filter = $(this).data('filter'); $(this).addClass('active').siblings().removeClass('active'); featureLayer.setFilter(function(f) { // If the data-filter attribute is set to "all", return // all (true)....

Thick white lines on mapbox/leaflet js map

javascript,css,d3.js,leaflet,mapbox
I have embedded a map inside a javascript-generated HTML tooltip in d3.js. Functionally, it works, but there are two white horizontal lines that appear at all zoom levels: The lines only appear when it's embedded in the popup. If I have it outside the popup, the lines disappear. I've checked...

Mapbox tile is not being added to leaflet.js map?

google-maps,leaflet,mapbox
I am trying to add a Mapbox tile to my project using leaflet.js. I wrote the code like following: L.tileLayer('https://{s}.tiles.mapbox.com/v4/johirbuet.l2ohahk4/{z}/{x}/{y}.png', { attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>', maxZoom: 18 }).addTo(map); But I am getting error and no map is showing in the page....

Cannot show markers in MapView

ios,objective-c,iphone,mapbox,rubymotion
I am creating an application using RubyMotion and MapBox. I want to have an offline map with markers. I can see the map but not the marker. This is my code : class MapScreen < PM::Screen def on_load RMConfiguration.configuration.setAccessToken("...") self.view.addSubview(map_view) annotation = RMPointAnnotation.alloc.initWithMapView(map_view, coordinate: map_view.centerCoordinate, andTitle: 'Hello') map_view.addAnnotation(annotation) end def...

Mapbox select pin listener

android,mapbox
How to get listener for MapBox pin. I want to change the drawable icon when I tap on the marker. Marker marker = new Marker(myMapBoxView,title, details, new LatLng(latitude,longitude)); marker.setIcon(new Icon(myDrawable))); If I will tap this marker I will want to change the drawable. What is the listener to get this...

How to get click event of marker using MapBox SDK?

android,mapbox,marker,clicklistener
I am using MapBox SDK for offline map I have added multiple markers on map, how to get click event for markers. Is there any way to get click event of marker?

MapBox ESRI Data Layer

json,gis,spatial,mapbox,esri
I have a mapbox, and want to display a layer of esri data onto it. The data I'm getting is being pulled in from this json file: https://gis.usps.com/arcgis/rest/services/EDDM/selectZIP/GPServer/routes/execute?f=json&env%3AoutSR=102100&ZIP=93003&Rte_Box=R&UserName=EDDM The data['results'][0]['value']['features'] array looks something like this: [{'attributes': {'key':'value'}},{'geometry':{'paths':[[-13273770,4064608],[-13273762,4064613],....]}}, {'attributes':...

Open leaflet marker using url parameter not working now that markercluster is used

javascript,leaflet,mapbox,markerclusterer
I have a leaflet application at http://atlantaartmap.com. The javascript it uses is http://atlantaartmap.com/lazy_art.js. At line 16, I grab a url parameter that can be used to open the map on a specific piece. While creating the markers, there is a piece of code at line 71 that checks to see...

Moving a UIImageView with a UIButton

ios,uiimageview,uibutton,mapbox
I am rather new to Xcode and iOS development but have been enjoying the challenge so far. I have run into an issue where I am attempting to move a UIImageView I have created programmatically on top of a MapBox mapView. I would like to move this UIImageView with a...

Best library/API to build an Android app making use of offline maps

android,geolocation,maps,google-maps-android-api-2,mapbox
I'm looking for the best library/api solution to use to build an application that uses a mapping system with completely offline map data. I would like to be able to show the user a map that is completely offline, how much storage would be needed for the offline maptiles? could...

Switch for making background map from Mapbox visible/invisible in D3

javascript,d3.js,data-visualization,mapbox
I'm building a Voronoi map inspired by http://chriszetter.com/blog/2014/06/15/building-a-voronoi-map-with-d3-and-leaflet/. I'd like to make an option to turn off the background map as the location of the data may not be relevant in all my use cases. Furthermore, it would be great if the visualization could work offline this way. After toggling...

install optimise with npm from optimist.js file

javascript,node.js,ubuntu,npm,mapbox
Trying to fix an offline install of the Carto tool from Mapbox on Ubuntu 14.04. Currently, node is giving me an error, it cant find the optimist module. I can manually find an optimist.js file, but its not under a "proper" node_modules directory like the other Carto dependancies are (e.g....

Mapbox: Marker Nav links outside of map

javascript,navigation,mapbox,markers
I have been trying to use the example on Mapbox.com for link navigation. marker nav I want to be able to change the js innerHTML to different properties in my own geojson i.e. change title to "editorname". I can get the nav links to reflect the correct properties, but it...

Leaflet - Event on tiles loading

javascript,leaflet,mapbox
I am currently developing a map-based application and need a way to get notified when Leaflet is pulling tiles from the TileProvider (which, in my case, is MapBox). I read the Leaflet documentation, especially the part with the TileLayer. Currently, I am using the following code to attach a tileload...

Displaying a Highchart Line Chart in Mapbox Marker Pop-up

javascript,jquery,highcharts,mapbox
My goal is to display two small Highchart line charts (height:100px;) inside of a Mapbox pop-up. I have two divs inside the HTML to hold the charts, which as is shown in the image below appear to take the charts because the axes are showing up just fine. The thing...

setBounds to two different featureGroups at once mapbox leaflet?

leaflet,mapbox
I am working on a map where I have two feature layers. var myFeatureGroup1 = L.featureGroup().addTo(map); var myFeatureGroup2 = L.featureGroup().addTo(map); I am setting bounds like: map.fitBounds(myFeatureGroup1.getBounds()); map.fitBounds(myFeatureGroup2.getBounds()); But for obvious reasons, myFeatureGroup2 is set bounds on. Is ther a way by which I can fit bounds to multiple layerGroups? Like...

Adding geoJSON feature attribues to mapbox popup

javascript,gis,leaflet,mapbox,geojson
I am looking to add a popup with geoJSON attributes to each book store marker on my map. I have used "layer.feature.properties.name" within the marker.bindpopup method, but am getting a return of "undefined". L.mapbox.accessToken = 'jk.eyJ1IjsdkjfhskjdfhksdskdjflWNCJ9.Ov2O5PtskdljfsdR0lq3Q'; var map = L.mapbox.map('map', 'example.kks3kec4') .setView([38.633, -90.319],12); //add cafe, books store, and university geoJSON...