mapbox

Custom Drawing on Mapbox Map Canvas

一个人想着一个人 提交于 2019-11-29 02:45:26
问题 I would like to be able to manually draw complex shapes on a mapbox map using the android sdk. I have inherited the map view class and overridden the ondraw event but unfortunately whatever I draw gets over drawn by the map itself. As an example I need to be able to draw polygons with diamond shaped borders among other complex shapes. This i can do no problem in GoogleMaps using a custom tile provider and overriding ondraw. Here is the only code I have so far for mapbox: @Override public void

LeafletJS: How to remove the zoom control

时间秒杀一切 提交于 2019-11-28 23:34:34
问题 I'm trying to remove the zoom controls (+/-) on a LeafletJS map. I'm using the MapBox.js version of Leaflet but most of the operations are the same as Leaflet. I implement my map like this: var map = L.mapbox.map('map'); var layer = L.mapbox.tileLayer('MAPBOX-ID', { format: 'jpg70', minZoom: 13, maxZoom: 15, reuseTiles: true, unloadInvisibleTiles: true }); map.addLayer(layer); map.setView([40.73547,-73.987856]); The documentation says there's a zoomControl option that will remove the zoom

Creating a GeoJson in php from MySql to use with MapBox javascript API

吃可爱长大的小学妹 提交于 2019-11-28 20:53:24
What I'm trying to do is very simple; get marker's data from a Mysql table with my PHP code, convert that that to a geoJson ( used by MapBox ), send that geoJson to javascript and then populate those marker into my map. I've been reading very carefully the following two links, that apparently contains all the info I need to resolve this, but I'm not sure what I'm missing. Here you can see an example on how to populate markers from a geoJson in MapBox; Here you can see how to create a geoJson from a MySql table; My sql table look like this, here is the creation code plus some dummy data; --

Mapbox GL JS vs. Mapbox.js

落花浮王杯 提交于 2019-11-28 14:35:00
问题 From the Mapbox glossary, Mapbox.js Mapbox.js is a JavaScript library that allows you to add an your interactive map to your website. It is a plugin for Leaflet, and it is an open source library that’s free to use. and Mapbox GL JS Mapbox GL JS is a JavaScript library that uses Mapbox GL to render interactive maps. It’s an open source library that’s free to use. You can add a Mapbox style or a custom style created with Mapbox Studio to your Mapbox GL JS application. and from this answer

Data-driven cluster colour with mapboxgl

时间秒杀一切 提交于 2019-11-28 14:25:52
I am trying to draw circle which colour depends on a "group" attribute in my geojson. I followed a simple example with these colours: map.addSource("data", { type: "geojson", data: url, cluster: true, clusterMaxZoom: 12, // Max zoom to cluster points on clusterRadius: 20 // Radius of each cluster when clustering points (defaults to 50) }); map.addLayer({ 'id': 'population', 'type': 'circle', 'source': 'data', 'paint': { // make circles larger as the user zooms from z12 to z22 'circle-radius': { 'base': 1.75, 'stops': [[12, 2], [22, 180]] }, // color circles by ethnicity, using a match

Routing between points with MapBox

天大地大妈咪最大 提交于 2019-11-28 11:37:53
I know that similar questions have been asked here before but none of them really answered my question and I am under pressure to finish my project by a deadline. Basically I am writing an application that will show online and offline maps. I am currently using MapBox SDK for the viewing of both offline and online maps, however, MapBox does not currently offer a routing solution. So I am looking for a way to do it. The main problem seems to be that there isn't just one SDK that will offer online OSM maps, offline OSM maps AND routing so I was wondering would I be able to use MapBox to handle

Zoom to fit all markers in Mapbox or Leaflet

跟風遠走 提交于 2019-11-28 03:05:18
How do I set view to see all markers on map in Mapbox or Leaflet ? Like Google Maps API does with bounds ? E.g: var latlngbounds = new google.maps.LatLngBounds(); for (var i = 0; i < latlng.length; i++) { latlngbounds.extend(latlng[i]); } map.fitBounds(latlngbounds); L. Sanna var group = new L.featureGroup([marker1, marker2, marker3]); map.fitBounds(group.getBounds()); See the documetation for more info. var markerArray = []; markerArray.push(L.marker([51.505, -0.09])); ... var group = L.featureGroup(markerArray).addTo(map); map.fitBounds(group.getBounds()); The 'Answer' didn't work for me

Leaflet in google maps

a 夏天 提交于 2019-11-28 01:14:59
问题 Can we use leaflet in google maps? Searching and reading articles about it, we found that there are some leaflet plugins available. Using that we can build application using google map + leaflet. 回答1: Just to be clear: Leaflet is just a viewing library, whereas Google Maps provides both the base maps (tiles) and an API (like Leaflet). Google Maps requires that you use exclusively its API when using its base maps. However, there is indeed a plugin for Leaflet that claims to act as a proxy for

Creating a GeoJson in php from MySql to use with MapBox javascript API

删除回忆录丶 提交于 2019-11-27 12:34:06
问题 What I'm trying to do is very simple; get marker's data from a Mysql table with my PHP code, convert that that to a geoJson ( used by MapBox ), send that geoJson to javascript and then populate those marker into my map. I've been reading very carefully the following two links, that apparently contains all the info I need to resolve this, but I'm not sure what I'm missing. Here you can see an example on how to populate markers from a geoJson in MapBox; Here you can see how to create a geoJson

How to save a completed polygon points leaflet.draw to mysql table

孤街醉人 提交于 2019-11-27 10:24:16
问题 I would like to use leaflet.draw to create outlines of regions. I have managed to get this working ok: https://www.mapbox.com/mapbox.js/example/v1.0.0/leaflet-draw/ Now I'd like to save the data for each polygon to a mysql table. Am a little stuck on how I would go about exporting the data and the format I should be doing it in. If possible I'd like to pull the data back into a mapbox/leaflet map in the future so guess something like geojson would be good. 回答1: So you could use draw:created