首页 > 解决方案 > Mapbox可以在iOS中加载PBF吗

问题描述

 NSString * ee = [NSString stringWithFormat:@"%@/api/v1/service/app/plots/pbf/{z}/{x}/{y}/%@/%@?token=%@",self.baseUrl,self.areaCode,json[@"level"],self.user_Token];
        MGLVectorTileSource * source = [[MGLVectorTileSource alloc]initWithIdentifier:@"huiSource1" tileURLTemplates:@[ee] options:@{ MGLTileSourceOptionTileSize: @256}];
        [weakSelf.mapView.style addSource:source];
        MGLFillStyleLayer * fillLayer = [[MGLFillStyleLayer alloc]initWithIdentifier:@"huiLayer1" source:source];
        [fillLayer setSourceLayerIdentifier:@"huiLayer1"];
        [fillLayer setFillColor:[NSExpression expressionForConstantValue:[UIColor redColor]]];
        [weakSelf.mapView.style addLayer:fillLayer];

标签: ios

解决方案


推荐阅读