mapbox-gl

Mapbox GL JS: ignore map click event if marker is clicked

与世无争的帅哥 提交于 2019-12-04 07:40:30
I have a marker in the map. I want to change its state when it is clicked and change it back when other place on the map is clicked. The problem is that map.on("click", console.log) is also fired upon clicking the marker. I want to see only the marker clicked event, because map click invokes state rollback. <!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <title></title> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js'></script> <link href='https://api.tiles.mapbox.com/mapbox

Recommended way to switch tile urls in mapbox-gl-js

谁说我不能喝 提交于 2019-12-03 09:57:07
问题 Situation We render a raster layer to the map. The layer's source has an initial tile-url. Now we want to change the tile-url of the source and trigger a reload for the new tiles. E.g. we have tiles for different points in time and we want to step through the different time steps. What can be done in mapbox-gl@0.21.0 map.addSource('tile-source', {...}); map.addLayer('tile-layer', {source: 'tile-source', ...}); // react to a button click or what ever to trigger tile url change ... const source

Recommended way to switch tile urls in mapbox-gl-js

☆樱花仙子☆ 提交于 2019-12-03 03:24:38
Situation We render a raster layer to the map. The layer's source has an initial tile-url. Now we want to change the tile-url of the source and trigger a reload for the new tiles. E.g. we have tiles for different points in time and we want to step through the different time steps. What can be done in mapbox-gl@0.21.0 map.addSource('tile-source', {...}); map.addLayer('tile-layer', {source: 'tile-source', ...}); // react to a button click or what ever to trigger tile url change ... const source = map.getSource('tile-source'); source.tiles = ['new-tile-url']; source._pyramid.reload(); This works

Change style of single feature in mapbox gl

百般思念 提交于 2019-12-01 05:08:48
问题 The examples for highlighting polygons in mapbox gl use a second layer and a filter function. Is it not possible to change the color of a single feature/polygon in mapbox gl js, drawn from geojson source? See https://www.mapbox.com/mapbox-gl-js/example/hover-styles/ 回答1: It's possible to style a single feature using a data driven style that responds uniquely to an attribute of a single feature. For instance, if you have a point dataset with an id attribute and you want id 450 to be yellow

Attempting to load the view of a view controller while it is deallocating … UIAlertController

ぃ、小莉子 提交于 2019-11-29 22:11:28
I am building with the release version of Xcode 7.0. No storyboards, just nib files. I have a single UINavigationController created by the app delegate and initialize it with a view controller. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UIViewController *viewController = [[TGMainViewController alloc] initWithNibName:nil bundle:nil]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; self.navigationController.navigationBar.barStyle = UIBarStyleBlack; self.navigationController.navigationBar.hidden = YES;

Building custom overlay specifically circle with radius(colored) in Android MapBox GL

别说谁变了你拦得住时间么 提交于 2019-11-29 12:54:58
Building custom overlay specifically circle with radius(colored) in Android MapBox GL. It allows to change radius dynamically using seekbar. I'm trying to build some custom markers and I used SimpleCircleView but Im having problem trying to display it in MapBox GL android, and it created lots of bugs. The map touch event is unresponsive once my CircleOverlay is displayed in map The marker doesnt stay in its coordinates once i zoom-in , zoom-out. Updating markers doesnt work, So I have to remove then add again the marker. The color does not match the color that I set in marker. I'll limit my

Attempting to load the view of a view controller while it is deallocating … UIAlertController

≯℡__Kan透↙ 提交于 2019-11-28 18:30:51
问题 I am building with the release version of Xcode 7.0. No storyboards, just nib files. I have a single UINavigationController created by the app delegate and initialize it with a view controller. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UIViewController *viewController = [[TGMainViewController alloc] initWithNibName:nil bundle:nil]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; self