summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmkiley <jordan.kiley@mapbox.com>2017-04-10 17:08:00 -0700
committerjmkiley <jordan.kiley@mapbox.com>2017-04-13 14:58:40 -0700
commit29c0d0adae5fb76593d94c512b885d585f6cb3fd (patch)
tree24deda4b255914bffc5753f167419866e52e271e
parent795f6e07d31f9146addf2eddbaf2294c3a2a47fe (diff)
downloadqtlocation-mapboxgl-29c0d0adae5fb76593d94c512b885d585f6cb3fd.tar.gz
more testing
-rw-r--r--platform/ios/app/LimeGreenStyleLayer.m2
-rw-r--r--platform/ios/app/MBXViewController.m23
-rw-r--r--src/mbgl/renderer/painter_symbol.cpp8
3 files changed, 24 insertions, 9 deletions
diff --git a/platform/ios/app/LimeGreenStyleLayer.m b/platform/ios/app/LimeGreenStyleLayer.m
index 1eaabd9c09..c314b26db6 100644
--- a/platform/ios/app/LimeGreenStyleLayer.m
+++ b/platform/ios/app/LimeGreenStyleLayer.m
@@ -42,7 +42,7 @@
// glDisable(GL_DEPTH_TEST);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_ALWAYS);
+ glDepthFunc(GL_LEQUAL);
}
- (void)willMoveFromMapView:(MGLMapView *)mapView {
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 890427e2c1..1d7f370d6c 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -161,7 +161,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
[self restoreState:nil];
self.debugLoggingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsDebugLoggingEnabled"];
-
+
+ self.mapView.pitchEnabled = NO;
self.hudLabel.hidden = YES;
if ([MGLAccountManager accessToken].length)
@@ -1819,14 +1820,25 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style
{
+
+// for (MGLStyleLayer *layer in style.layers) {
+// if ([layer isKindOfClass:[MGLSymbolStyleLayer class]]) {
+//// layer = [MGLSymbolStyleLayer class];
+//// layer = (MGLSymbolStyleLayer *)layer;
+// MGLSymbolStyleLayer *newLayer = (MGLSymbolStyleLayer *)layer;
+// [style removeLayer:layer];
+// newLayer.textPitchAlignment = MGLTextPitchAlignmentMap;
+// [style addLayer:newLayer];
+// }
+// }
// Default Mapbox styles use {name_en} as their label language, which means
// that a device with an English-language locale is already effectively
// using locale-based country labels.
_usingLocaleBasedCountryLabels = [[self bestLanguageForUser] isEqualToString:@"en"];
LimeGreenStyleLayer *layer = [[LimeGreenStyleLayer alloc] initWithIdentifier:@"mbx-custom"];
- MGLStyleLayer *symbolLayer = [style layerWithIdentifier:@"admin-3-4-boundaries"];
-
+ MGLSymbolStyleLayer *symbolLayer = [style layerWithIdentifier:@"admin-3-4-boundaries"];
+// symbolLayer.textPitchAlignment = MGLTextPitchAlignmentMap;
[style insertLayer:layer belowLayer:symbolLayer];
NSURL *url = [NSURL URLWithString:@"mapbox://examples.69ytlgls"];
@@ -1837,8 +1849,11 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"states" source:source];
fillLayer.sourceLayerIdentifier = @"stateData_2-dx853g";
fillLayer.fillColor = [MGLStyleValue valueWithRawValue:[UIColor redColor]];
+ MGLSymbolStyleLayer *symbolLayer2 = [style layerWithIdentifier:@"country-label-lg"];
+// symbolLayer2.textPitchAlignment = MGLTextPitchAlignmentMap;
// [style addLayer:fillLayer];
- [style insertLayer:fillLayer aboveLayer:layer];
+ fillLayer.fillOpacity = [MGLStyleValue valueWithRawValue:@1];
+ [style insertLayer:fillLayer aboveLayer:symbolLayer2];
// NSLog(@"%@", style.layers);
}
diff --git a/src/mbgl/renderer/painter_symbol.cpp b/src/mbgl/renderer/painter_symbol.cpp
index d2f492d17a..d54a2ba5a1 100644
--- a/src/mbgl/renderer/painter_symbol.cpp
+++ b/src/mbgl/renderer/painter_symbol.cpp
@@ -40,13 +40,13 @@ void Painter::renderSymbol(PaintParameters& parameters,
{
// We clip symbols to their tile extent in still mode.
const bool needsClipping = frame.mapMode == MapMode::Still;
-
+
program.draw(
context,
gl::Triangles(),
- values_.pitchAlignment == AlignmentType::Map
- ? depthModeForSublayer(0, gl::DepthMode::ReadOnly)
- : gl::DepthMode::disabled(),
+// values_.pitchAlignment == AlignmentType::Map
+ depthModeForSublayer(0, gl::DepthMode::ReadOnly),
+// : gl::DepthMode::disabled(),
needsClipping
? stencilModeForClipping(tile.clip)
: gl::StencilMode::disabled(),