heremaps / maps-api-for-javascript-examples

Self-contained examples for Maps API for JavaScript v3.

Home Page:https://developer.here.com/javascript-apis/documentation/v3/maps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different look in Google Chrome and Mozilla Firefox

Mexikaner9 opened this issue · comments

Hello,
my example http://nirvana.bplaced.net/21/ looks very nice in Mozilla Firefox, but in Google Chrome the map is really ugly.

Why does the map in Google Chrome not look like in Mozilla Firefox?

Why do the developer tools show so many errors?

Screenshot Google Chrome:
Google Chrome

Screenshot Mozilla Firefox:
Mozilla Firefox

Hi @Mexikaner9, could you share the errors that you're getting with Chrome?

`mapsjs-core.js:369 Tangram [error]: Style: error compiling program for style '0_dashes' (program key 'program') Object Error: Error: WebGL program error:
VALIDATE_STATUS: false
ERROR: 0
--- Vertex Shader ---
precision highp float;
#define TANGRAM_EPSILON 0.00001
#define TANGRAM_LAYER_DELTA 0.00006103515625
#define TANGRAM_TILE_SCALE vec3(4096., 4096., u_meters_per_pixel * 256.)
#define TANGRAM_HEIGHT_SCALE 16.0
#define TANGRAM_ALPHA_TEST 0.5
#define TANGRAM_WORLD_POSITION_WRAP 100000.0
#define TANGRAM_BLEND_OPAQUE
#define TANGRAM_MATERIAL_AMBIENT
#define TANGRAM_MATERIAL_DIFFUSE
#define TANGRAM_LIGHTING_FRAGMENT
#define TANGRAM_LAYER_ORDER
#define TANGRAM_EXTRUDE_LINES
#define TANGRAM_TEXTURE_COORDS
#define TANGRAM_BLOCK_CAMERA
#define TANGRAM_BLOCK_GLOBAL
#define TANGRAM_BLOCK_SETUP
#define TANGRAM_BLOCK_UTILS
#define TANGRAM_BLOCK_LIGHTING
#define TANGRAM_BLOCK_MATERIAL
#define TANGRAM_VERTEX_SHADER
uniform vec2 u_resolution;uniform float u_time;uniform vec3 u_map_position;uniform vec4 u_tile_origin;uniform float u_tile_proxy_depth;uniform float u_meters_per_pixel;uniform float u_device_pixel_ratio;uniform mat4 u_model;uniform mat4 u_modelView;uniform mat3 u_normalMatrix;uniform mat3 u_inverseNormalMatrix;attribute vec4 a_position;attribute vec4 a_color;
#ifdef TANGRAM_NORMAL_ATTRIBUTE
attribute vec3 a_normal;
#define TANGRAM_NORMAL a_normal
#else
#define TANGRAM_NORMAL vec3(0., 0., 1.)
#endif
#ifdef TANGRAM_EXTRUDE_LINES
attribute vec2 a_extrude;attribute vec2 a_offset;attribute vec2 a_scaling;uniform float u_v_scale_adjust;
#endif
varying vec4 v_position;varying vec3 v_normal;varying vec4 v_color;varying vec4 v_world_position;varying vec4 v_wrapped_tile_origin;
#if defined(TANGRAM_TEXTURE_COORDS) || defined(TANGRAM_EXTRUDE_LINES)
attribute vec2 a_texcoord;varying vec2 v_texcoord;
#endif
#ifdef TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING
varying vec4 v_modelpos_base_zoom;
#endif
#if defined(TANGRAM_LIGHTING_VERTEX)
varying vec4 v_lighting;
#endif
#define UNPACK_SCALING(x) (x / 1024.)

// tangram-block-start: ShaderProgram, camera, 0

        uniform mat4 u_projection;
        uniform vec3 u_eye;
        uniform vec2 u_center_offset;

        void cameraProjection (inout vec4 position) {
            position = u_projection * position;
        }

// tangram-block-end: ShaderProgram, camera, 0

// tangram-block-start: Material, material, 0
/Defines globals:materiallight_accumulator_**/struct Material{
#ifdef TANGRAM_MATERIAL_EMISSION
vec4 emission;
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
vec3 emissionScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT
vec4 ambient;
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
vec3 ambientScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE
vec4 diffuse;
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
vec3 diffuseScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR
vec4 specular;float shininess;
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
vec3 specularScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
vec3 normalScale;float normalAmount;
#endif
};uniform Material u_material;Material material;
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
uniform sampler2D u_material_emission_texture;
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
uniform sampler2D u_material_ambient_texture;
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
uniform sampler2D u_material_diffuse_texture;
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
uniform sampler2D u_material_specular_texture;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
uniform sampler2D u_material_normal_texture;
#endif
vec4 light_accumulator_ambient=vec4(vec3(0.0),1.);vec4 light_accumulator_diffuse=vec4(vec3(0.0),1.);
#ifdef TANGRAM_MATERIAL_SPECULAR
vec4 light_accumulator_specular=vec4(vec3(0.0),1.);
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_SPHEREMAP
vec4 getSphereMap(in sampler2D _tex,in vec3 _eyeToPoint,in vec3 _normal,in vec2 _skew){vec3 eye=normalize(_eyeToPoint);eye.xy-=_skew;eye=normalize(eye);vec3 r=reflect(eye,_normal);r.z+=1.0;float m=2.length(r);vec2 uv=r.xy/m+.5;return texture2D(_tex,uv);}
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_TRIPLANAR
vec3 getTriPlanarBlend(in vec3 _normal){vec3 blending=abs(_normal);blending=normalize(max(blending,0.00001));float b=(blending.x+blending.y+blending.z);return blending/b;}vec4 getTriPlanar(in sampler2D _tex,in vec3 _pos,in vec3 _normal,in vec3 _scale){vec3 blending=getTriPlanarBlend(_normal);vec4 xaxis=texture2D(_tex,fract(_pos.yz
_scale.x));vec4 yaxis=texture2D(_tex,fract(_pos.xz
_scale.y));vec4 zaxis=texture2D(_tex,fract(_pos.xy*_scale.z));return xaxisblending.x+yaxisblending.y+zaxisblending.z;}
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_PLANAR
vec4 getPlanar(in sampler2D _tex,in vec3 _pos,in vec2 _scale){return texture2D(_tex,fract(_pos.xy
_scale.x));}
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
void calculateNormal(inout vec3 _normal){
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_UV
_normal+=texture2D(u_material_normal_texture,fract(v_texcoordmaterial.normalScale.xy)).rgb2.0-1.0;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_PLANAR
vec3 normalTex=getP
Jr @ mapsjs-core.js:369
mapsjs-core.js:369 WebGL: INVALID_OPERATION: drawElements: no valid shader program in use
value @ mapsjs-core.js:369
mapsjs-core.js:369 WebGL: INVALID_OPERATION: drawElements: no valid shader program in use
value @ mapsjs-core.js:369
mapsjs-core.js:369 WebGL: INVALID_OPERATION: drawElements: no valid shader program in use
value @ mapsjs-core.js:369
mapsjs-core.js:369 Tangram [error]: Style: error compiling program for style '0_lines' (program key 'program') Object Error: Error: WebGL program error:
VALIDATE_STATUS: false
ERROR: 1282
--- Vertex Shader ---
precision highp float;
#define TANGRAM_EPSILON 0.00001
#define TANGRAM_LAYER_DELTA 0.00006103515625
#define TANGRAM_TILE_SCALE vec3(4096., 4096., u_meters_per_pixel * 256.)
#define TANGRAM_HEIGHT_SCALE 16.0
#define TANGRAM_ALPHA_TEST 0.5
#define TANGRAM_WORLD_POSITION_WRAP 100000.0
#define TANGRAM_BLEND_OPAQUE
#define TANGRAM_MATERIAL_AMBIENT
#define TANGRAM_MATERIAL_DIFFUSE
#define TANGRAM_LIGHTING_FRAGMENT
#define TANGRAM_LAYER_ORDER
#define TANGRAM_EXTRUDE_LINES
#define TANGRAM_TEXTURE_COORDS
#define TANGRAM_BLOCK_CAMERA
#define TANGRAM_BLOCK_GLOBAL
#define TANGRAM_BLOCK_SETUP
#define TANGRAM_BLOCK_UTILS
#define TANGRAM_BLOCK_LIGHTING
#define TANGRAM_BLOCK_MATERIAL
#define TANGRAM_VERTEX_SHADER
uniform vec2 u_resolution;uniform float u_time;uniform vec3 u_map_position;uniform vec4 u_tile_origin;uniform float u_tile_proxy_depth;uniform float u_meters_per_pixel;uniform float u_device_pixel_ratio;uniform mat4 u_model;uniform mat4 u_modelView;uniform mat3 u_normalMatrix;uniform mat3 u_inverseNormalMatrix;attribute vec4 a_position;attribute vec4 a_color;
#ifdef TANGRAM_NORMAL_ATTRIBUTE
attribute vec3 a_normal;
#define TANGRAM_NORMAL a_normal
#else
#define TANGRAM_NORMAL vec3(0., 0., 1.)
#endif
#ifdef TANGRAM_EXTRUDE_LINES
attribute vec2 a_extrude;attribute vec2 a_offset;attribute vec2 a_scaling;uniform float u_v_scale_adjust;
#endif
varying vec4 v_position;varying vec3 v_normal;varying vec4 v_color;varying vec4 v_world_position;varying vec4 v_wrapped_tile_origin;
#if defined(TANGRAM_TEXTURE_COORDS) || defined(TANGRAM_EXTRUDE_LINES)
attribute vec2 a_texcoord;varying vec2 v_texcoord;
#endif
#ifdef TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING
varying vec4 v_modelpos_base_zoom;
#endif
#if defined(TANGRAM_LIGHTING_VERTEX)
varying vec4 v_lighting;
#endif
#define UNPACK_SCALING(x) (x / 1024.)

// tangram-block-start: ShaderProgram, camera, 0

        uniform mat4 u_projection;
        uniform vec3 u_eye;
        uniform vec2 u_center_offset;

        void cameraProjection (inout vec4 position) {
            position = u_projection * position;
        }

// tangram-block-end: ShaderProgram, camera, 0

// tangram-block-start: Material, material, 0
/Defines globals:materiallight_accumulator_**/struct Material{
#ifdef TANGRAM_MATERIAL_EMISSION
vec4 emission;
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
vec3 emissionScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT
vec4 ambient;
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
vec3 ambientScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE
vec4 diffuse;
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
vec3 diffuseScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR
vec4 specular;float shininess;
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
vec3 specularScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
vec3 normalScale;float normalAmount;
#endif
};uniform Material u_material;Material material;
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
uniform sampler2D u_material_emission_texture;
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
uniform sampler2D u_material_ambient_texture;
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
uniform sampler2D u_material_diffuse_texture;
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
uniform sampler2D u_material_specular_texture;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
uniform sampler2D u_material_normal_texture;
#endif
vec4 light_accumulator_ambient=vec4(vec3(0.0),1.);vec4 light_accumulator_diffuse=vec4(vec3(0.0),1.);
#ifdef TANGRAM_MATERIAL_SPECULAR
vec4 light_accumulator_specular=vec4(vec3(0.0),1.);
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_SPHEREMAP
vec4 getSphereMap(in sampler2D _tex,in vec3 _eyeToPoint,in vec3 _normal,in vec2 _skew){vec3 eye=normalize(_eyeToPoint);eye.xy-=_skew;eye=normalize(eye);vec3 r=reflect(eye,_normal);r.z+=1.0;float m=2.length(r);vec2 uv=r.xy/m+.5;return texture2D(_tex,uv);}
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_TRIPLANAR
vec3 getTriPlanarBlend(in vec3 _normal){vec3 blending=abs(_normal);blending=normalize(max(blending,0.00001));float b=(blending.x+blending.y+blending.z);return blending/b;}vec4 getTriPlanar(in sampler2D _tex,in vec3 _pos,in vec3 _normal,in vec3 _scale){vec3 blending=getTriPlanarBlend(_normal);vec4 xaxis=texture2D(_tex,fract(_pos.yz
_scale.x));vec4 yaxis=texture2D(_tex,fract(_pos.xz
_scale.y));vec4 zaxis=texture2D(_tex,fract(_pos.xy*_scale.z));return xaxisblending.x+yaxisblending.y+zaxisblending.z;}
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_PLANAR
vec4 getPlanar(in sampler2D _tex,in vec3 _pos,in vec2 _scale){return texture2D(_tex,fract(_pos.xy
_scale.x));}
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
void calculateNormal(inout vec3 _normal){
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_UV
_normal+=texture2D(u_material_normal_texture,fract(v_texcoordmaterial.normalScale.xy)).rgb2.0-1.0;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_PLANAR
vec3 normalTex=getPlanar(u_material_normal_texture,v_world_position.xyz,material.normalScale.xy).rgb2.0-1.0;_normal+=normalTex;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_TRIPLANAR
vec3 normalTex=getTriPlanar(u_material_normal_texture,v_world_position.xyz,_normal,material.normalScale).rgb
2.0-1.0;_normal+=normalTex;
#endif
_normal=normalize(_normal);}
#endif
void calculateMaterial(in vec3 _eyeToPoint,inout vec3 _normal){
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_UV
material.emission*=texture2D(u_material_emission_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_PLANAR
material.emission*=getPlanar(u_material_emission_texture,v_world_position.xyz,material.emissionScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_TRIPLANAR
material.emission*=getTriPlanar(u_material_emission_texture,v_world_position.xyz,_normal,material.emissionScale);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_SPHEREMAP
material.emission*=getSphereMap(u_material_emission_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_UV
material.ambient*=texture2D(u_material_ambient_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_PLANAR
material.ambient*=getPlanar(u_material_ambient_texture,v_world_position.xyz,material.ambientScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_TRIPLANAR
material.ambient*=getTriPlanar(u_material_ambient_texture,v_world_position.xyz,_normal,material.ambientScale);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_SPHEREMAP
material.ambient*=getSphereMap(u_material_ambient_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_UV
material.diffuse*=texture2D(u_material_diffuse_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_PLANAR
material.diffuse*=getPlanar(u_material_diffuse_texture,v_world_position.xyz,material.diffuseScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_TRIPLANAR
material.diffuse*=getTriPlanar(u_material_diffuse_texture,v_world_position.xyz,_normal,material.diffuseScale);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_SPHEREMAP
material.diffuse*=getSphereMap(u_material_diffuse_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_UV
material.specular*=texture2D(u_material_specular_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_PLANAR
material.specular*=getPlanar(u_material_specular_texture,v_world_position.xyz,material.specularScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_TRIPLANAR
material.specular*=getTriPlanar(u_material_specular_texture,v_world_position.xyz,_normal,material.specularScale);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_SPHEREMAP
material.specular*=getSphereMap(u_material_specular_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
}
// tangram-block-end: Material, material, 0

// tangram-block-start: ShaderProgram, lighting, 0
/Expected globals:materiallight_accumulator_**/struct DirectionalLight{vec3 ambient;vec3 diffuse;vec3 specular;vec3 direction;};void calculateLight(in DirectionalLight _light,in vec3 _eyeToPoint,in vec3 _normal){light_accumulator_ambient.rgb+=_light.ambient;float nDotVP=clamp(dot(_normal,-_light.direction),0.0,1.0);
#ifdef TANGRAM_MATERIAL_DIFFUSE
light_accumulator_diffuse.rgb+=_light.diffuse
nDotVP;
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR
float pf=0.0;if(nDotVP>0.0){vec3 reflectVector=reflect(_light.direction,_normal);float eyeDotR=max(dot(normalize(_eyeToPoint),reflectVector),0.0);pf=pow(eyeDotR,material.shininess);}light_accumulator_specular.rgb+=_light.specular*pf;
#endif
}
// tangram-block-end: ShaderProgram, lighting, 0

// tangram-block-start: ShaderProgram, lighting, 1

        uniform DirectionalLight u_default_light;
        DirectionalLight default_light;

// tangram-block-end: ShaderProgram, lighting, 1

// tangram-block-start: ShaderProgram, lighting, 2

        vec4 calculateLighting(in vec3 _eyeToPoint, in vec3 _normal, in vec4 _color) {

            // Do initial material calculations over normal, emission, ambient, diffuse and specular values
            calculateMaterial(_eyeToPoint,_normal);

            // Un roll the loop of individual ligths to calculate
            calculateLight(default_light, _eyeToPoint, _normal);


            //  Final light intensity calculation
            vec4 color = vec4(vec3(0.), _color.a); // start with vertex color alpha

            #ifdef TANGRAM_MATERIAL_EMISSION
                color.rgb = material.emission.rgb;
                color.a *= material.emission.a;
            #endif

            #ifdef TANGRAM_MATERIAL_AMBIENT
                color.rgb += light_accumulator_ambient.rgb * _color.rgb * material.ambient.rgb;
                color.a *= material.ambient.a;
            #else
                #ifdef TANGRAM_MATERIAL_DIFFUSE
                    color.rgb += light_accumulator_ambient.rgb * _color.rgb * material.diffuse.rgb;
                #endif
            #endif

            #ifdef TANGRAM_MATERIAL_DIFFUSE
                color.rgb += light_accumulator_diffuse.rgb * _color.rgb * material.diffuse.rgb;
                color.a *= material.diffuse.a;
            #endif

            #ifdef TANGRAM_MATERIAL_SPECULAR
                color.rgb += light_accumulator_specular.rgb * material.specular.rgb;
                color.a *= material.specular.a;
            #endif

            // Clamp final color
            color = clamp(color, 0.0, 1.0);

            return color;
        }

// tangram-block-end: ShaderProgram, lighting, 2

// tangram-block-start: ShaderProgram, global, 0
#ifdef TANGRAM_VERTEX_SHADER
vec4 modelPosition(){return vec4(a_position.xyz/TANGRAM_TILE_SCALEexp2(u_tile_origin.z-u_tile_origin.w),1.)+vec4(0.,1.,0.,0.);}vec4 modelPositionBaseZoom(){return vec4(a_position.xyz/TANGRAM_TILE_SCALE,1.)+vec4(0.,1.,0.,0.);}
#endif
vec4 worldPosition(){return v_world_position;}
#ifdef TANGRAM_VERTEX_SHADER
vec4 wrapWorldPosition(vec4 world_position){
#if defined(TANGRAM_WORLD_POSITION_WRAP)
vec2 anchor=u_tile_origin.xy-mod(u_tile_origin.xy,TANGRAM_WORLD_POSITION_WRAP);world_position.xy-=anchor;
#endif
return world_position;}
#endif
#if defined(TANGRAM_VERTEX_SHADER)
vec3 worldNormal(){return TANGRAM_NORMAL;}
#elif defined(TANGRAM_FRAGMENT_SHADER)
vec3 worldNormal(){return u_inverseNormalMatrix
TANGRAM_NORMAL;}
#endif

// tangram-block-end: ShaderProgram, global, 0

// tangram-block-start: ShaderProgram, global, 1
void applyLayerOrder(float layer,inout vec4 position){position.z-=layerTANGRAM_LAYER_DELTAposition.w;}
// tangram-block-end: ShaderProgram, global, 1

// tangram-block-start: ShaderProgram, global, 2

#if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER)
attribute vec4 a_selection_color;varying vec4 v_selection_color;uniform vec4 u_selection_discard0;uniform vec4 u_selection_discard1;uniform vec4 u_selection_discard2;uniform vec4 u_selection_discard3;uniform vec4 u_selection_discard4;uniform vec4 u_selection_discard5;uniform vec4 u_selection_discard6;uniform vec4 u_selection_discard7;uniform vec4 u_selection_discard8;uniform vec4 u_selection_discard9;
#endif

// tangram-block-end: ShaderProgram, global, 2

void main(){

// tangram-block-start: ShaderProgram, setup, 0

#if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER)
if(a_selection_color.rgb==vec3(0.)||a_selection_color==u_selection_discard0||a_selection_color==u_selection_discard1||a_selection_color==u_selection_discard2||a_selection_color==u_selection_discard3||a_selection_color==u_selection_discard4||a_selection_color==u_selection_discard5||a_selection_color==u_selection_discard6||a_selection_color==u_selection_discard7||a_selection_color==u_selection_discard8||a_selection_color==u_selection_discard9){gl_Position=vec4(0.,0.,0.,1.);return;}v_selection_color=a_selection_color;
#endif

// tangram-block-end: ShaderProgram, setup, 0

// tangram-block-start: ShaderProgram, setup, 1

        default_light = u_default_light;

// tangram-block-end: ShaderProgram, setup, 1

// tangram-block-start: Material, setup, 0

material = u_material;

// tangram-block-end: Material, setup, 0

#ifdef TANGRAM_TEXTURE_COORDS
v_texcoord=a_texcoord;
#ifdef TANGRAM_EXTRUDE_LINES
v_texcoord.y*=u_v_scale_adjust;
#endif
#endif
#ifdef TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING
v_modelpos_base_zoom=modelPositionBaseZoom();
#endif
vec4 position=vec4(a_position.xy,a_position.z/TANGRAM_HEIGHT_SCALE,1.);
#ifdef TANGRAM_EXTRUDE_LINES
vec2 extrude=a_extrude.xy;vec2 offset=a_offset.xy;float dz=clamp(u_map_position.z-u_tile_origin.z,0.,4.);dz+=step(1.,dz)(1.-dz)+mix(0.,2.,clamp((dz-2.)/2.,0.,1.));float mdz=(dz-0.5)2.;extrude-=extrudeUNPACK_SCALING(a_scaling.x)mdz;float dwdz=UNPACK_SCALING(a_scaling.y);float sdwdz=sign(step(0.,dwdz)-0.5);offset-=offsetabs(dwdz)((1.-step(0.,sdwdz))-(dz*-sdwdz));float ssz=exp2(-dz-(u_tile_origin.z-u_tile_origin.w));extrude*=ssz;offset*=ssz;
#ifdef TANGRAM_BLOCK_WIDTH
float width=1.;

extrude*=width;
#endif
position.xy+=extrude+offset;
#endif
v_world_position=wrapWorldPosition(u_modelposition);v_wrapped_tile_origin=wrapWorldPosition(u_tile_origin);position=u_modelViewposition;

v_position=position;v_normal=normalize(u_normalMatrix*TANGRAM_NORMAL);v_color=a_color;
#if defined(TANGRAM_LIGHTING_VERTEX)
vec3 normal=v_normal;

v_lighting=calculateLighting(position.xyz-u_eye,normal,vec4(1.));
#endif
cameraProjection(position);applyLayerOrder(a_position.w+u_tile_proxy_depth+1.,position);gl_Position=position;}
--- Fragment Shader ---
precision highp float;
#define TANGRAM_EPSILON 0.00001
#define TANGRAM_LAYER_DELTA 0.00006103515625
#define TANGRAM_TILE_SCALE vec3(4096., 4096., u_meters_per_pixel * 256.)
#define TANGRAM_HEIGHT_SCALE 16.0
#define TANGRAM_ALPHA_TEST 0.5
#define TANGRAM_WORLD_POSITION_WRAP 100000.0
#define TANGRAM_BLEND_OPAQUE
#define TANGRAM_MATERIAL_AMBIENT
#define TANGRAM_MATERIAL_DIFFUSE
#define TANGRAM_LIGHTING_FRAGMENT
#define TANGRAM_LAYER_ORDER
#define TANGRAM_EXTRUDE_LINES
#define TANGRAM_TEXTURE_COORDS
#define TANGRAM_BLOCK_CAMERA
#define TANGRAM_BLOCK_GLOBAL
#define TANGRAM_BLOCK_SETUP
#define TANGRAM_BLOCK_UTILS
#define TANGRAM_BLOCK_LIGHTING
#define TANGRAM_BLOCK_MATERIAL
#define TANGRAM_FRAGMENT_SHADER
uniform vec2 u_resolution;uniform float u_time;uniform vec3 u_map_position;uniform vec4 u_tile_origin;uniform float u_meters_per_pixel;uniform float u_device_pixel_ratio;uniform mat3 u_normalMatrix;uniform mat3 u_inverseNormalMatrix;varying vec4 v_position;varying vec3 v_normal;varying vec4 v_color;varying vec4 v_world_position;varying vec4 v_wrapped_tile_origin;
#ifdef TANGRAM_EXTRUDE_LINES
uniform bool u_has_line_texture;uniform sampler2D u_texture;uniform float u_texture_ratio;uniform vec4 u_dash_background_color;uniform float u_tile_size;
#endif
#define TANGRAM_NORMAL v_normal
#if defined(TANGRAM_TEXTURE_COORDS) || defined(TANGRAM_EXTRUDE_LINES)
varying vec2 v_texcoord;
#endif
#ifdef TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING
varying vec4 v_modelpos_base_zoom;
#endif
#if defined(TANGRAM_LIGHTING_VERTEX)
varying vec4 v_lighting;
#endif

// tangram-block-start: ShaderProgram, camera, 0

        uniform mat4 u_projection;
        uniform vec3 u_eye;
        uniform vec2 u_center_offset;

        void cameraProjection (inout vec4 position) {
            position = u_projection * position;
        }

// tangram-block-end: ShaderProgram, camera, 0

// tangram-block-start: Material, material, 0
/Defines globals:materiallight_accumulator_**/struct Material{
#ifdef TANGRAM_MATERIAL_EMISSION
vec4 emission;
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
vec3 emissionScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT
vec4 ambient;
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
vec3 ambientScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE
vec4 diffuse;
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
vec3 diffuseScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR
vec4 specular;float shininess;
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
vec3 specularScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
vec3 normalScale;float normalAmount;
#endif
};uniform Material u_material;Material material;
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
uniform sampler2D u_material_emission_texture;
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
uniform sampler2D u_material_ambient_texture;
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
uniform sampler2D u_material_diffuse_texture;
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
uniform sampler2D u_material_specular_texture;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
uniform sampler2D u_material_normal_texture;
#endif
vec4 light_accumulator_ambient=vec4(vec3(0.0),1.);vec4 light_accumulator_diffuse=vec4(vec3(0.0),1.);
#ifdef TANGRAM_MATERIAL_SPECULAR
vec4 light_accumulator_specular=vec4(vec3(0.0),1.);
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_SPHEREMAP
vec4 getSphereMap(in sampler2D _tex,in vec3 _eyeToPoint,in vec3 _normal,in vec2 _skew){vec3 eye=normalize(_eyeToPoint);eye.xy-=_skew;eye=normalize(eye);vec3 r=reflect(eye,_normal);r.z+=1.0;float m=2.length(r);vec2 uv=r.xy/m+.5;return texture2D(_tex,uv);}
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_TRIPLANAR
vec3 getTriPlanarBlend(in vec3 _normal){vec3 blending=abs(_normal);blending=normalize(max(blending,0.00001));float b=(blending.x+blending.y+blending.z);return blending/b;}vec4 getTriPlanar(in sampler2D _tex,in vec3 _pos,in vec3 _normal,in vec3 _scale){vec3 blending=getTriPlanarBlend(_normal);vec4 xaxis=texture2D(_tex,fract(_pos.yz
_scale.x));vec4 yaxis=texture2D(_tex,fract(_pos.xz
_scale.y));vec4 zaxis=texture2D(_tex,fract(_pos.xy*_scale.z));return xaxisblending.x+yaxisblending.y+zaxisblending.z;}
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_PLANAR
vec4 getPlanar(in sampler2D _tex,in vec3 _pos,in vec2 _scale){return texture2D(_tex,fract(_pos.xy
_scale.x));}
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
void calculateNormal(inout vec3 _normal){
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_UV
_normal+=texture2D(u_material_normal_texture,fract(v_texcoordmaterial.normalScale.xy)).rgb2.0-1.0;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_PLANAR
vec3 normalTex=getPlanar(u_material_normal_texture,v_world_position.xyz,material.normalScale.xy).rgb2.0-1.0;_normal+=normalTex;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_TRIPLANAR
vec3 normalTex=getTriPlanar(u_material_normal_texture,v_world_position.xyz,_normal,material.normalScale).rgb
2.0-1.0;_normal+=normalTex;
#endif
_normal=normalize(_normal);}
#endif
void calculateMaterial(in vec3 _eyeToPoint,inout vec3 _normal){
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_UV
material.emission*=texture2D(u_material_emission_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_PLANAR
material.emission*=getPlanar(u_material_emission_texture,v_world_position.xyz,material.emissionScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_TRIPLANAR
material.emission*=getTriPlanar(u_material_emission_texture,v_world_position.xyz,_normal,material.emissionScale);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_SPHEREMAP
material.emission*=getSphereMap(u_material_emission_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_UV
material.ambient*=texture2D(u_material_ambient_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_PLANAR
material.ambient*=getPlanar(u_material_ambient_texture,v_world_position.xyz,material.ambientScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_TRIPLANAR
material.ambient*=getTriPlanar(u_material_ambient_texture,v_world_position.xyz,_normal,material.ambientScale);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_SPHEREMAP
material.ambient*=getSphereMap(u_material_ambient_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_UV
material.diffuse*=texture2D(u_material_diffuse_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_PLANAR
material.diffuse*=getPlanar(u_material_diffuse_texture,v_world_position.xyz,material.diffuseScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_TRIPLANAR
material.diffuse*=getTriPlanar(u_material_diffuse_texture,v_world_position.xyz,_normal,material.diffuseScale);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_SPHEREMAP
material.diffuse*=getSphereMap(u_material_diffuse_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_UV
material.specular*=texture2D(u_material_specular_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_PLANAR
material.specular*=getPlanar(u_material_specular_texture,v_world_position.xyz,material.specularScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_TRIPLANAR
material.specular*=getTriPlanar(u_material_specular_texture,v_world_position.xyz,_normal,material.specularScale);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_SPHEREMAP
material.specular*=getSphereMap(u_material_specular_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
}
// tangram-block-end: Material, material, 0

// tangram-block-start: ShaderProgram, lighting, 0
/Expected globals:materiallight_accumulator_**/struct DirectionalLight{vec3 ambient;vec3 diffuse;vec3 specular;vec3 direction;};void calculateLight(in DirectionalLight _light,in vec3 _eyeToPoint,in vec3 _normal){light_accumulator_ambient.rgb+=_light.ambient;float nDotVP=clamp(dot(_normal,-_light.direction),0.0,1.0);
#ifdef TANGRAM_MATERIAL_DIFFUSE
light_accumulator_diffuse.rgb+=_light.diffuse
nDotVP;
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR
float pf=0.0;if(nDotVP>0.0){vec3 reflectVector=reflect(_light.direction,_normal);float eyeDotR=max(dot(normalize(_eyeToPoint),reflectVector),0.0);pf=pow(eyeDotR,material.shininess);}light_accumulator_specular.rgb+=_light.specular*pf;
#endif
}
// tangram-block-end: ShaderProgram, lighting, 0

// tangram-block-start: ShaderProgram, lighting, 1

        uniform DirectionalLight u_default_light;
        DirectionalLight default_light;

// tangram-block-end: ShaderProgram, lighting, 1

// tangram-block-start: ShaderProgram, lighting, 2

        vec4 calculateLighting(in vec3 _eyeToPoint, in vec3 _normal, in vec4 _color) {

            // Do initial material calculations over normal, emission, ambient, diffuse and specular values
            calculateMaterial(_eyeToPoint,_normal);

            // Un roll the loop of individual ligths to calculate
            calculateLight(default_light, _eyeToPoint, _normal);


            //  Final light intensity calculation
            vec4 color = vec4(vec3(0.), _color.a); // start with vertex color alpha

            #ifdef TANGRAM_MATERIAL_EMISSION
                color.rgb = material.emission.rgb;
                color.a *= material.emission.a;
            #endif

            #ifdef TANGRAM_MATERIAL_AMBIENT
                color.rgb += light_accumulator_ambient.rgb * _color.rgb * material.ambient.rgb;
                color.a *= material.ambient.a;
            #else
                #ifdef TANGRAM_MATERIAL_DIFFUSE
                    color.rgb += light_accumulator_ambient.rgb * _color.rgb * material.diffuse.rgb;
                #endif
            #endif

            #ifdef TANGRAM_MATERIAL_DIFFUSE
                color.rgb += light_accumulator_diffuse.rgb * _color.rgb * material.diffuse.rgb;
                color.a *= material.diffuse.a;
            #endif

            #ifdef TANGRAM_MATERIAL_SPECULAR
                color.rgb += light_accumulator_specular.rgb * material.specular.rgb;
                color.a *= material.specular.a;
            #endif

            // Clamp final color
            color = clamp(color, 0.0, 1.0);

            return color;
        }

// tangram-block-end: ShaderProgram, lighting, 2

// tangram-block-start: ShaderProgram, global, 0
#ifdef TANGRAM_VERTEX_SHADER
vec4 modelPosition(){return vec4(a_position.xyz/TANGRAM_TILE_SCALEexp2(u_tile_origin.z-u_tile_origin.w),1.)+vec4(0.,1.,0.,0.);}vec4 modelPositionBaseZoom(){return vec4(a_position.xyz/TANGRAM_TILE_SCALE,1.)+vec4(0.,1.,0.,0.);}
#endif
vec4 worldPosition(){return v_world_position;}
#ifdef TANGRAM_VERTEX_SHADER
vec4 wrapWorldPosition(vec4 world_position){
#if defined(TANGRAM_WORLD_POSITION_WRAP)
vec2 anchor=u_tile_origin.xy-mod(u_tile_origin.xy,TANGRAM_WORLD_POSITION_WRAP);world_position.xy-=anchor;
#endif
return world_position;}
#endif
#if defined(TANGRAM_VERTEX_SHADER)
vec3 worldNormal(){return TANGRAM_NORMAL;}
#elif defined(TANGRAM_FRAGMENT_SHADER)
vec3 worldNormal(){return u_inverseNormalMatrix
TANGRAM_NORMAL;}
#endif

// tangram-block-end: ShaderProgram, global, 0

// tangram-block-start: ShaderProgram, global, 1
void applyLayerOrder(float layer,inout vec4 position){position.z-=layerTANGRAM_LAYER_DELTAposition.w;}
// tangram-block-end: ShaderProgram, global, 1

// tangram-block-start: ShaderProgram, global, 2

#if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER)
attribute vec4 a_selection_color;varying vec4 v_selection_color;uniform vec4 u_selection_discard0;uniform vec4 u_selection_discard1;uniform vec4 u_selection_discard2;uniform vec4 u_selection_discard3;uniform vec4 u_selection_discard4;uniform vec4 u_selection_discard5;uniform vec4 u_selection_discard6;uniform vec4 u_selection_discard7;uniform vec4 u_selection_discard8;uniform vec4 u_selection_discard9;
#endif

// tangram-block-end: ShaderProgram, global, 2

// tangram-block-start: ShaderProgram, utils, 0
#ifndef UTILS
#define UTILS
bool isPixelOutsideTile(float tile_size,float meters_per_pixel,vec3 map_position,vec4 pixel_world_position,vec4 wrapped_tile_world_origin){float exponent=log(tile_size)/log(2.0);float stretched_tile_exponent=exponent+(map_position.z-floor(map_position.z));float stretched_tile_world_size=pow(2.0,stretched_tile_exponent)*meters_per_pixel;return pixel_world_position.y>wrapped_tile_world_origin.y||pixel_world_position.x<wrapped_tile_world_origin.x||pixel_world_position.y<wrapped_tile_world_origin.y-stretched_tile_world_size||pixel_world_position.x>wrapped_tile_world_origin.x+stretched_tile_world_size;}
#endif

// tangram-block-end: ShaderProgram, utils, 0

void main(void){

// tangram-block-start: ShaderProgram, setup, 0

#if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER)
if(a_selection_color.rgb==vec3(0.)||a_selection_color==u_selection_discard0||a_selection_color==u_selection_discard1||a_selection_color==u_selection_discard2||a_selection_color==u_selection_discard3||a_selection_color==u_selection_discard4||a_selection_color==u_selection_discard5||a_selection_color==u_selection_discard6||a_selection_color==u_selection_discard7||a_selection_color==u_selection_discard8||a_selection_color==u_selection_discard9){gl_Position=vec4(0.,0.,0.,1.);return;}v_selection_color=a_selection_color;
#endif

// tangram-block-end: ShaderProgram, setup, 0

// tangram-block-start: ShaderProgram, setup, 1

        default_light = u_default_light;

// tangram-block-end: ShaderProgram, setup, 1

// tangram-block-start: Material, setup, 0

material = u_material;

// tangram-block-end: Material, setup, 0

vec4 color=v_color;vec3 normal=TANGRAM_NORMAL;
#ifdef TANGRAM_CROP_BY_TILE
if(isPixelOutsideTile(u_tile_size,u_meters_per_pixel,u_map_position,v_world_position,v_wrapped_tile_origin)){discard;}
#endif
#ifdef TANGRAM_RASTER_TEXTURE_COLOR
color*=sampleRaster(0);
#endif
#ifdef TANGRAM_EXTRUDE_LINES
if(u_has_line_texture){vec2 _line_st=vec2(v_texcoord.x,fract(v_texcoord.y/u_texture_ratio));vec4 _line_color=texture2D(u_texture,_line_st);if(_line_color.a<TANGRAM_ALPHA_TEST){
#if !defined(TANGRAM_BLEND_OVERLAY) && !defined(TANGRAM_BLEND_INLAY)
if(u_dash_background_color.a==0.){discard;}color=u_dash_background_color;
#else
color=vec4(u_dash_background_color.rgb,color.astep(TANGRAM_EPSILON,u_dash_background_color.a));
#endif
}else{color
=_line_color;}}
#endif
#ifdef TANGRAM_RASTER_TEXTURE_NORMAL
normal=normalize(sampleRaster(0).rgb*2.-1.);
#endif
#if defined(TANGRAM_LIGHTING_FRAGMENT) && defined(TANGRAM_MATERIAL_NORMAL_TEXTURE)
calculateNormal(normal);
#endif
#if !defined(TANGRAM_LIGHTING_VERTEX)

#endif

#if defined(TANGRAM_LIGHTING_FRAGMENT)
color=calculateLighting(v_position.xyz-u_eye,normal,color);
#elif defined(TANGRAM_LIGHTING_VERTEX)
color*=v_lighting;
#endif

gl_FragColor=color;}
at Function.Wl.updateProgram (https://js.api.here.com/v3/3.1/mapsjs-core.js:369:215577)
at f.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:369:208515)
at Object.getProgram (https://js.api.here.com/v3/3.1/mapsjs-core.js:369:255275)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:369:505929)
at t (https://js.api.here.com/v3/3.1/mapsjs-core.js:369:505668)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:369:505825)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:369:505081)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:369:503258)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:369:502842)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:369:502146)
Jr @ mapsjs-core.js:369
mapsjs-core.js:369 WebGL: INVALID_OPERATION: drawElements: no valid shader program in use
value @ mapsjs-core.js:369
`

I also face this issue.

Error: Error: WebGL program error:
VALIDATE_STATUS: false
ERROR: 0
--- Vertex Shader ---
precision highp float;
#define TANGRAM_EPSILON 0.00001
#define TANGRAM_LAYER_DELTA 0.00006103515625
#define TANGRAM_TILE_SCALE vec3(4096., 4096., u_meters_per_pixel * 256.)
#define TANGRAM_HEIGHT_SCALE 16.0
#define TANGRAM_ALPHA_TEST 0.1
#define TANGRAM_WORLD_POSITION_WRAP 100000.0
#define TANGRAM_BLEND_TRANSLUCENT
#define TANGRAM_MATERIAL_AMBIENT
#define TANGRAM_MATERIAL_DIFFUSE
#define TANGRAM_LIGHTING_FRAGMENT
#define TANGRAM_LAYER_ORDER
#define TANGRAM_CROP_BY_TILE
#define TANGRAM_BLOCK_CAMERA
#define TANGRAM_BLOCK_GLOBAL
#define TANGRAM_BLOCK_SETUP
#define TANGRAM_BLOCK_UTILS
#define TANGRAM_BLOCK_LIGHTING
#define TANGRAM_BLOCK_MATERIAL
#define TANGRAM_VERTEX_SHADER
uniform vec2 u_resolution;uniform float u_time;uniform vec4 u_tile_origin;uniform float u_tile_proxy_depth;uniform float u_meters_per_pixel;uniform float u_device_pixel_ratio;uniform sampler2D u_uniforms;uniform mat4 u_model;uniform mat4 u_modelView;uniform mat3 u_normalMatrix;uniform mat3 u_inverseNormalMatrix;uniform vec3 u_map_position;uniform float u_antialias;uniform vec2 u_linecaps;uniform float u_linejoin;uniform float u_miter_limit;uniform float u_dash_index;uniform vec2 u_dash_caps;uniform float u_dash_phase;uniform float u_dash_period;attribute vec4 a_position;attribute vec4 a_color;attribute float a_width;
#ifdef TANGRAM_DEBUG_TRIANGLES
attribute vec3 a_barycentric;
#endif
attribute vec2 a_normal;attribute float a_length;attribute vec2 a_segment;attribute vec2 a_texcoord;attribute vec2 a_angles;attribute vec4 a_tangents;attribute float a_closed;varying vec4 v_position;varying vec4 v_local_space_position;varying vec3 v_normal;varying vec4 v_color;varying vec4 v_world_position;
#ifdef TANGRAM_DEBUG_TRIANGLES
varying vec3 v_barycentric;
#endif
varying vec2 v_segment;varying vec2 v_angles;varying vec2 v_texcoord;varying vec2 v_distances;varying vec2 v_miter;varying float v_length;varying float v_linewidth_and_closed;varying float v_joinIndicator;
#define TANGRAM_NORMAL vec3(0., 0., 1.)
#ifdef TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING
varying vec4 v_modelpos_base_zoom;
#endif
#if defined(TANGRAM_LIGHTING_VERTEX)
varying vec4 v_lighting;
#endif
#ifndef TANGRAM_HEIGHT_SCALE
float TANGRAM_HEIGHT_SCALE=16.0;
#endif
#define UNPACK_SCALING(x) (x / 1024.)

// tangram-block-start: ShaderProgram, camera, 0

        uniform mat4 u_projection;
        uniform vec3 u_eye;
        uniform vec2 u_center_offset;

        void cameraProjection (inout vec4 position) {
            position = u_projection * position;
        }

// tangram-block-end: ShaderProgram, camera, 0

// tangram-block-start: Material, material, 0
/Defines globals:materiallight_accumulator_**/struct Material{
#ifdef TANGRAM_MATERIAL_EMISSION
vec4 emission;
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
vec3 emissionScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT
vec4 ambient;
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
vec3 ambientScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE
vec4 diffuse;
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
vec3 diffuseScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR
vec4 specular;float shininess;
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
vec3 specularScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
vec3 normalScale;float normalAmount;
#endif
};uniform Material u_material;Material material;
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
uniform sampler2D u_material_emission_texture;
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
uniform sampler2D u_material_ambient_texture;
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
uniform sampler2D u_material_diffuse_texture;
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
uniform sampler2D u_material_specular_texture;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
uniform sampler2D u_material_normal_texture;
#endif
vec4 light_accumulator_ambient=vec4(vec3(0.0),1.);vec4 light_accumulator_diffuse=vec4(vec3(0.0),1.);
#ifdef TANGRAM_MATERIAL_SPECULAR
vec4 light_accumulator_specular=vec4(vec3(0.0),1.);
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_SPHEREMAP
vec4 getSphereMap(in sampler2D _tex,in vec3 _eyeToPoint,in vec3 _normal,in vec2 _skew){vec3 eye=normalize(_eyeToPoint);eye.xy-=_skew;eye=normalize(eye);vec3 r=reflect(eye,_normal);r.z+=1.0;float m=2.length(r);vec2 uv=r.xy/m+.5;return texture2D(_tex,uv);}
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_TRIPLANAR
vec3 getTriPlanarBlend(in vec3 _normal){vec3 blending=abs(_normal);blending=normalize(max(blending,0.00001));float b=(blending.x+blending.y+blending.z);return blending/b;}vec4 getTriPlanar(in sampler2D _tex,in vec3 _pos,in vec3 _normal,in vec3 _scale){vec3 blending=getTriPlanarBlend(_normal);vec4 xaxis=texture2D(_tex,fract(_pos.yz
_scale.x));vec4 yaxis=texture2D(_tex,fract(_pos.xz
_scale.y));vec4 zaxis=texture2D(_tex,fract(_pos.xy*_scale.z));return xaxisblending.x+yaxisblending.y+zaxisblending.z;}
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_PLANAR
vec4 getPlanar(in sampler2D _tex,in vec3 _pos,in vec2 _scale){return texture2D(_tex,fract(_pos.xy
_scale.x));}
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
void calculateNormal(inout vec3 _normal){
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_UV
_normal+=texture2D(u_material_normal_texture,fract(v_texcoordmaterial.normalScale.xy)).rgb2.0-1.0;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_PLANAR
vec3 normalTex=getPlanar(u_material_normal_texture,v_world_position.xyz,material.normalScale.xy).rgb2.0-1.0;_normal+=normalTex;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_TRIPLANAR
vec3 normalTex=getTriPlanar(u_material_normal_texture,v_world_position.xyz,_normal,material.normalScale).rgb
2.0-1.0;_normal+=normalTex;
#endif
_normal=normalize(_normal);}
#endif
void calculateMaterial(in vec3 _eyeToPoint,inout vec3 _normal){
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_UV
material.emission*=texture2D(u_material_emission_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_PLANAR
material.emission*=getPlanar(u_material_emission_texture,v_world_position.xyz,material.emissionScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_TRIPLANAR
material.emission*=getTriPlanar(u_material_emission_texture,v_world_position.xyz,_normal,material.emissionScale);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_SPHEREMAP
material.emission*=getSphereMap(u_material_emission_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_UV
material.ambient*=texture2D(u_material_ambient_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_PLANAR
material.ambient*=getPlanar(u_material_ambient_texture,v_world_position.xyz,material.ambientScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_TRIPLANAR
material.ambient*=getTriPlanar(u_material_ambient_texture,v_world_position.xyz,_normal,material.ambientScale);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_SPHEREMAP
material.ambient*=getSphereMap(u_material_ambient_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_UV
material.diffuse*=texture2D(u_material_diffuse_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_PLANAR
material.diffuse*=getPlanar(u_material_diffuse_texture,v_world_position.xyz,material.diffuseScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_TRIPLANAR
material.diffuse*=getTriPlanar(u_material_diffuse_texture,v_world_position.xyz,_normal,material.diffuseScale);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_SPHEREMAP
material.diffuse*=getSphereMap(u_material_diffuse_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_UV
material.specular*=texture2D(u_material_specular_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_PLANAR
material.specular*=getPlanar(u_material_specular_texture,v_world_position.xyz,material.specularScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_TRIPLANAR
material.specular*=getTriPlanar(u_material_specular_texture,v_world_position.xyz,_normal,material.specularScale);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_SPHEREMAP
material.specular*=getSphereMap(u_material_specular_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
}
// tangram-block-end: Material, material, 0

// tangram-block-start: ShaderProgram, lighting, 0
/Expected globals:materiallight_accumulator_**/struct DirectionalLight{vec3 ambient;vec3 diffuse;vec3 specular;vec3 direction;};void calculateLight(in DirectionalLight _light,in vec3 _eyeToPoint,in vec3 _normal){light_accumulator_ambient.rgb+=_light.ambient;float nDotVP=clamp(dot(_normal,-_light.direction),0.0,1.0);
#ifdef TANGRAM_MATERIAL_DIFFUSE
light_accumulator_diffuse.rgb+=_light.diffuse
nDotVP;
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR
float pf=0.0;if(nDotVP>0.0){vec3 reflectVector=reflect(_light.direction,_normal);float eyeDotR=max(dot(normalize(_eyeToPoint),reflectVector),0.0);pf=pow(eyeDotR,material.shininess);}light_accumulator_specular.rgb+=_light.specular*pf;
#endif
}
// tangram-block-end: ShaderProgram, lighting, 0

// tangram-block-start: ShaderProgram, lighting, 1

        uniform DirectionalLight u_default_light;
        DirectionalLight default_light;

// tangram-block-end: ShaderProgram, lighting, 1

// tangram-block-start: ShaderProgram, lighting, 2

        vec4 calculateLighting(in vec3 _eyeToPoint, in vec3 _normal, in vec4 _color) {

            // Do initial material calculations over normal, emission, ambient, diffuse and specular values
            calculateMaterial(_eyeToPoint,_normal);

            // Un roll the loop of individual ligths to calculate
            calculateLight(default_light, _eyeToPoint, _normal);


            //  Final light intensity calculation
            vec4 color = vec4(vec3(0.), _color.a); // start with vertex color alpha

            #ifdef TANGRAM_MATERIAL_EMISSION
                color.rgb = material.emission.rgb;
                color.a *= material.emission.a;
            #endif

            #ifdef TANGRAM_MATERIAL_AMBIENT
                color.rgb += light_accumulator_ambient.rgb * _color.rgb * material.ambient.rgb;
                color.a *= material.ambient.a;
            #else
                #ifdef TANGRAM_MATERIAL_DIFFUSE
                    color.rgb += light_accumulator_ambient.rgb * _color.rgb * material.diffuse.rgb;
                #endif
            #endif

            #ifdef TANGRAM_MATERIAL_DIFFUSE
                color.rgb += light_accumulator_diffuse.rgb * _color.rgb * material.diffuse.rgb;
                color.a *= material.diffuse.a;
            #endif

            #ifdef TANGRAM_MATERIAL_SPECULAR
                color.rgb += light_accumulator_specular.rgb * material.specular.rgb;
                color.a *= material.specular.a;
            #endif

            // Clamp final color
            color = clamp(color, 0.0, 1.0);

            return color;
        }

// tangram-block-end: ShaderProgram, lighting, 2

// tangram-block-start: ShaderProgram, global, 0
#ifdef TANGRAM_VERTEX_SHADER
vec4 modelPosition(){return vec4(a_position.xyz/TANGRAM_TILE_SCALEexp2(u_tile_origin.z-u_tile_origin.w),1.)+vec4(0.,1.,0.,0.);}vec4 modelPositionBaseZoom(){return vec4(a_position.xyz/TANGRAM_TILE_SCALE,1.)+vec4(0.,1.,0.,0.);}
#endif
vec4 worldPosition(){return v_world_position;}
#ifdef TANGRAM_VERTEX_SHADER
vec4 wrapWorldPosition(vec4 world_position){
#if defined(TANGRAM_WORLD_POSITION_WRAP)
vec2 anchor=u_tile_origin.xy-mod(u_tile_origin.xy,TANGRAM_WORLD_POSITION_WRAP);world_position.xy-=anchor;
#endif
return world_position;}
#endif
#if defined(TANGRAM_VERTEX_SHADER)
vec3 worldNormal(){return TANGRAM_NORMAL;}
#elif defined(TANGRAM_FRAGMENT_SHADER)
vec3 worldNormal(){return u_inverseNormalMatrix
TANGRAM_NORMAL;}
#endif

// tangram-block-end: ShaderProgram, global, 0

// tangram-block-start: ShaderProgram, global, 1
void applyLayerOrder(float layer,inout vec4 position){position.z-=layerTANGRAM_LAYER_DELTAposition.w;}
// tangram-block-end: ShaderProgram, global, 1

// tangram-block-start: ShaderProgram, global, 2

#if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER)
attribute vec4 a_selection_color;varying vec4 v_selection_color;uniform vec4 u_selection_discard0;uniform vec4 u_selection_discard1;uniform vec4 u_selection_discard2;uniform vec4 u_selection_discard3;uniform vec4 u_selection_discard4;uniform vec4 u_selection_discard5;uniform vec4 u_selection_discard6;uniform vec4 u_selection_discard7;uniform vec4 u_selection_discard8;uniform vec4 u_selection_discard9;
#endif

// tangram-block-end: ShaderProgram, global, 2

// tangram-block-start: ShaderProgram, global, 3
uniform float u_view_pan_snap_timer;void snapToPixelGrid(inout vec4 position){vec2 position_fract=fract((((position.xy/position.w)+1.)*.5)u_resolution);vec2 position_snap=position.xy+((step(0.5,position_fract)-position_fract)position.w2./u_resolution);
#ifdef TANGRAM_VIEW_PAN_SNAP_RATE
position.xy=mix(position.xy,position_snap,clamp(u_view_pan_snap_timer
TANGRAM_VIEW_PAN_SNAP_RATE,0.,1.));
#else
position.xy=position_snap;
#endif
}
// tangram-block-end: ShaderProgram, global, 3

const float PI=3.141592653589793;const float THETA=15.0PI/180.0;float cross(in vec2 v1,in vec2 v2){return v1.xv2.y-v1.yv2.x;}float signed_distance(in vec2 v1,in vec2 v2,in vec2 v3){return cross(v2-v1,v1-v3)/length(v2-v1);}void rotate(in vec2 v,in float angle,out vec2 result){float cosine=cos(angle);float sine=sin(angle);result=vec2(cosinev.x-sinev.y,sinev.x+cosine*v.y);}void main(){

// tangram-block-start: ShaderProgram, setup, 0

#if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER)
if(a_selection_color.rgb==vec3(0.)||a_selection_color==u_selection_discard0||a_selection_color==u_selection_discard1||a_selection_color==u_selection_discard2||a_selection_color==u_selection_discard3||a_selection_color==u_selection_discard4||a_selection_color==u_selection_discard5||a_selection_color==u_selection_discard6||a_selection_color==u_selection_discard7||a_selection_color==u_selection_discard8||a_selection_color==u_selection_discard9){gl_Position=vec4(0.,0.,0.,1.);return;}v_selection_color=a_selection_color;
#endif

// tangram-block-end: ShaderProgram, setup, 0

// tangram-block-start: ShaderProgram, setup, 1

        default_light = u_default_light;

// tangram-block-end: ShaderProgram, setup, 1

// tangram-block-start: Material, setup, 0

material = u_material;

// tangram-block-end: Material, setup, 0

#ifdef TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING
v_modelpos_base_zoom=modelPositionBaseZoom();
#endif
float linewidth=a_width2.0;v_angles=a_angles;v_segment=a_segment;v_color=a_color;v_length=a_length;v_texcoord=a_texcoord;
#ifdef TANGRAM_DEBUG_TRIANGLES
v_barycentric=a_barycentric;
#endif
v_color.a=min(linewidth,v_color.a);linewidth=max(linewidth,1.0);linewidth/=exp2(u_map_position.z-u_tile_origin.w);v_linewidth_and_closed=linewidth
(a_closed>0.0 ?-1.0 : 1.0);if(v_color.a<=0.0){gl_Position=vec4(0.0,0.0,0.0,1.0);return;}float width=ceil(1.25u_antialias+linewidth)/2.0;vec2 t1=normalize(a_tangents.xy);vec2 t2=normalize(a_tangents.zw);float u=a_texcoord.x;u=-1.0;float v=a_texcoord.y;vec2 o1=vec2(+t1.y,-t1.x);vec2 o2=vec2(+t2.y,-t2.x);vec4 position=vec4(a_position.xy,a_position.z/TANGRAM_HEIGHT_SCALE,1.0);if(t1!=t2){float angle=a_texcoord.x==1.0 ? a_angles.x : a_angles.y;vec2 t=normalize(t1+t2);vec2 o=vec2(+t.y,-t.x);float segmentLength=a_segment.y-a_segment.x;float halfMiterlength=width/cos(angle/2.0);if(u_dash_index>0.0){if((abs(angle)>THETA)){position.xy+=vwidtho/cos(angle/2.0);float s=sign(angle);if(angle<0.0){if(u==+1.0){u=v_segment.y+vwidthtan(angle/2.0);if(v==1.0){position.xy-=2.0widtht1/sin(angle);u-=2.0width/sin(angle);}}else{u=v_segment.x-vwidthtan(angle/2.0);if(v==1.0){position.xy+=2.0widtht2/sin(angle);u+=2.0width/sin(angle);}}}else{if(u==+1.0){u=v_segment.y+vwidthtan(angle/2.0);if(v==-1.0){position.xy+=2.0widtht1/sin(angle);u+=2.0width/sin(angle);}}else{u=v_segment.x-vwidthtan(angle/2.0);if(v==-1.0){position.xy-=2.0widtht2/sin(angle);u-=2.0width/sin(angle);}}}}else{position.xy+=vwidtho/cos(angle/2.0);if(u==+1.0){u=v_segment.y;}else{u=v_segment.x;}}}else{position.xy+=vohalfMiterlength;if(u==+1.0){u=v_segment.y+vwidthtan(angle/2.0);}else{u=v_segment.x-vwidthtan(angle/2.0);}}v_joinIndicator=(segmentLength+vwidthtan(angle/2.0))/segmentLength;}else{v_joinIndicator=-1.0;position.xy+=vwidtho1;if(u==-1.0){u=v_segment.x-width;position.xy-=widtht1;}else{u=v_segment.y+width;position.xy+=widtht2;}}vec2 t;vec2 curr=a_position.xy;if(a_texcoord.x>=0.0){vec2 next=curr+t2*(v_segment.y-v_segment.x);rotate(t1,+a_angles.x/2.0,t);v_miter.x=signed_distance(curr,curr+t,position.xy);rotate(t2,+a_angles.y/2.0,t);v_miter.y=signed_distance(next,next+t,position.xy);}else{vec2 prev=curr-t1*(v_segment.y-v_segment.x);rotate(t1,-a_angles.x/2.0,t);v_miter.x=signed_distance(prev,prev+t,position.xy);rotate(t2,-a_angles.y/2.0,t);v_miter.y=signed_distance(curr,curr+t,position.xy);}v_distances=vec2(u,vwidth);v_world_position=wrapWorldPosition(u_modelposition);v_local_space_position=position;position=u_modelView*position;

v_position=position;v_normal=normalize(u_normalMatrix*TANGRAM_NORMAL);
#if defined(TANGRAM_LIGHTING_VERTEX)
vec3 normal=v_normal;

v_lighting=calculateLighting(position.xyz-u_eye,normal,vec4(1.));
#endif
cameraProjection(position);
#ifdef TANGRAM_LAYER_ORDER
applyLayerOrder(a_position.w+u_tile_proxy_depth+1.,position);
#endif
gl_Position=position;}
--- Fragment Shader ---
precision highp float;
#define TANGRAM_EPSILON 0.00001
#define TANGRAM_LAYER_DELTA 0.00006103515625
#define TANGRAM_TILE_SCALE vec3(4096., 4096., u_meters_per_pixel * 256.)
#define TANGRAM_HEIGHT_SCALE 16.0
#define TANGRAM_ALPHA_TEST 0.1
#define TANGRAM_WORLD_POSITION_WRAP 100000.0
#define TANGRAM_BLEND_TRANSLUCENT
#define TANGRAM_MATERIAL_AMBIENT
#define TANGRAM_MATERIAL_DIFFUSE
#define TANGRAM_LIGHTING_FRAGMENT
#define TANGRAM_LAYER_ORDER
#define TANGRAM_CROP_BY_TILE
#define TANGRAM_BLOCK_CAMERA
#define TANGRAM_BLOCK_GLOBAL
#define TANGRAM_BLOCK_SETUP
#define TANGRAM_BLOCK_UTILS
#define TANGRAM_BLOCK_LIGHTING
#define TANGRAM_BLOCK_MATERIAL
#define TANGRAM_FRAGMENT_SHADER
uniform vec2 u_resolution;uniform float u_time;uniform vec4 u_tile_origin;uniform float u_meters_per_pixel;uniform float u_device_pixel_ratio;uniform mat3 u_normalMatrix;uniform mat3 u_inverseNormalMatrix;uniform sampler2D u_dash_atlas;uniform float u_antialias;uniform vec2 u_linecaps;uniform float u_linejoin;uniform float u_miter_limit;uniform float u_dash_phase;uniform float u_dash_period;uniform float u_dash_index;uniform vec2 u_dash_caps;varying vec4 v_position;varying vec4 v_local_space_position;varying vec3 v_normal;varying vec4 v_color;varying vec4 v_world_position;
#ifdef TANGRAM_DEBUG_TRIANGLES
varying vec3 v_barycentric;
#endif
varying vec2 v_segment;varying vec2 v_angles;varying vec2 v_texcoord;varying vec2 v_distances;varying vec2 v_miter;varying float v_length;varying float v_linewidth_and_closed;varying float v_joinIndicator;
#define TANGRAM_NORMAL v_normal
#ifdef TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING
varying vec4 v_modelpos_base_zoom;
#endif
#if defined(TANGRAM_LIGHTING_VERTEX)
varying vec4 v_lighting;
#endif

// tangram-block-start: ShaderProgram, camera, 0

        uniform mat4 u_projection;
        uniform vec3 u_eye;
        uniform vec2 u_center_offset;

        void cameraProjection (inout vec4 position) {
            position = u_projection * position;
        }

// tangram-block-end: ShaderProgram, camera, 0

// tangram-block-start: Material, material, 0
/Defines globals:materiallight_accumulator_**/struct Material{
#ifdef TANGRAM_MATERIAL_EMISSION
vec4 emission;
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
vec3 emissionScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT
vec4 ambient;
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
vec3 ambientScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE
vec4 diffuse;
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
vec3 diffuseScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR
vec4 specular;float shininess;
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
vec3 specularScale;
#endif
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
vec3 normalScale;float normalAmount;
#endif
};uniform Material u_material;Material material;
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
uniform sampler2D u_material_emission_texture;
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
uniform sampler2D u_material_ambient_texture;
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
uniform sampler2D u_material_diffuse_texture;
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
uniform sampler2D u_material_specular_texture;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
uniform sampler2D u_material_normal_texture;
#endif
vec4 light_accumulator_ambient=vec4(vec3(0.0),1.);vec4 light_accumulator_diffuse=vec4(vec3(0.0),1.);
#ifdef TANGRAM_MATERIAL_SPECULAR
vec4 light_accumulator_specular=vec4(vec3(0.0),1.);
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_SPHEREMAP
vec4 getSphereMap(in sampler2D _tex,in vec3 _eyeToPoint,in vec3 _normal,in vec2 _skew){vec3 eye=normalize(_eyeToPoint);eye.xy-=_skew;eye=normalize(eye);vec3 r=reflect(eye,_normal);r.z+=1.0;float m=2.length(r);vec2 uv=r.xy/m+.5;return texture2D(_tex,uv);}
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_TRIPLANAR
vec3 getTriPlanarBlend(in vec3 _normal){vec3 blending=abs(_normal);blending=normalize(max(blending,0.00001));float b=(blending.x+blending.y+blending.z);return blending/b;}vec4 getTriPlanar(in sampler2D _tex,in vec3 _pos,in vec3 _normal,in vec3 _scale){vec3 blending=getTriPlanarBlend(_normal);vec4 xaxis=texture2D(_tex,fract(_pos.yz
_scale.x));vec4 yaxis=texture2D(_tex,fract(_pos.xz
_scale.y));vec4 zaxis=texture2D(_tex,fract(_pos.xy*_scale.z));return xaxisblending.x+yaxisblending.y+zaxisblending.z;}
#endif
#ifdef TANGRAM_MATERIAL_TEXTURE_PLANAR
vec4 getPlanar(in sampler2D _tex,in vec3 _pos,in vec2 _scale){return texture2D(_tex,fract(_pos.xy
_scale.x));}
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE
void calculateNormal(inout vec3 _normal){
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_UV
_normal+=texture2D(u_material_normal_texture,fract(v_texcoordmaterial.normalScale.xy)).rgb2.0-1.0;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_PLANAR
vec3 normalTex=getPlanar(u_material_normal_texture,v_world_position.xyz,material.normalScale.xy).rgb2.0-1.0;_normal+=normalTex;
#endif
#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_TRIPLANAR
vec3 normalTex=getTriPlanar(u_material_normal_texture,v_world_position.xyz,_normal,material.normalScale).rgb
2.0-1.0;_normal+=normalTex;
#endif
_normal=normalize(_normal);}
#endif
void calculateMaterial(in vec3 _eyeToPoint,inout vec3 _normal){
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_UV
material.emission*=texture2D(u_material_emission_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_PLANAR
material.emission*=getPlanar(u_material_emission_texture,v_world_position.xyz,material.emissionScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_TRIPLANAR
material.emission*=getTriPlanar(u_material_emission_texture,v_world_position.xyz,_normal,material.emissionScale);
#endif
#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_SPHEREMAP
material.emission*=getSphereMap(u_material_emission_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_UV
material.ambient*=texture2D(u_material_ambient_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_PLANAR
material.ambient*=getPlanar(u_material_ambient_texture,v_world_position.xyz,material.ambientScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_TRIPLANAR
material.ambient*=getTriPlanar(u_material_ambient_texture,v_world_position.xyz,_normal,material.ambientScale);
#endif
#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_SPHEREMAP
material.ambient*=getSphereMap(u_material_ambient_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_UV
material.diffuse*=texture2D(u_material_diffuse_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_PLANAR
material.diffuse*=getPlanar(u_material_diffuse_texture,v_world_position.xyz,material.diffuseScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_TRIPLANAR
material.diffuse*=getTriPlanar(u_material_diffuse_texture,v_world_position.xyz,_normal,material.diffuseScale);
#endif
#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_SPHEREMAP
material.diffuse*=getSphereMap(u_material_diffuse_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_UV
material.specular*=texture2D(u_material_specular_texture,v_texcoord);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_PLANAR
material.specular*=getPlanar(u_material_specular_texture,v_world_position.xyz,material.specularScale.xy);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_TRIPLANAR
material.specular*=getTriPlanar(u_material_specular_texture,v_world_position.xyz,_normal,material.specularScale);
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_SPHEREMAP
material.specular*=getSphereMap(u_material_specular_texture,_eyeToPoint,_normal,u_center_offset);
#endif
#endif
}
// tangram-block-end: Material, material, 0

// tangram-block-start: ShaderProgram, lighting, 0
/Expected globals:materiallight_accumulator_**/struct DirectionalLight{vec3 ambient;vec3 diffuse;vec3 specular;vec3 direction;};void calculateLight(in DirectionalLight _light,in vec3 _eyeToPoint,in vec3 _normal){light_accumulator_ambient.rgb+=_light.ambient;float nDotVP=clamp(dot(_normal,-_light.direction),0.0,1.0);
#ifdef TANGRAM_MATERIAL_DIFFUSE
light_accumulator_diffuse.rgb+=_light.diffuse
nDotVP;
#endif
#ifdef TANGRAM_MATERIAL_SPECULAR
float pf=0.0;if(nDotVP>0.0){vec3 reflectVector=reflect(_light.direction,_normal);float eyeDotR=max(dot(normalize(_eyeToPoint),reflectVector),0.0);pf=pow(eyeDotR,material.shininess);}light_accumulator_specular.rgb+=_light.specular*pf;
#endif
}
// tangram-block-end: ShaderProgram, lighting, 0

// tangram-block-start: ShaderProgram, lighting, 1

        uniform DirectionalLight u_default_light;
        DirectionalLight default_light;

// tangram-block-end: ShaderProgram, lighting, 1

// tangram-block-start: ShaderProgram, lighting, 2

        vec4 calculateLighting(in vec3 _eyeToPoint, in vec3 _normal, in vec4 _color) {

            // Do initial material calculations over normal, emission, ambient, diffuse and specular values
            calculateMaterial(_eyeToPoint,_normal);

            // Un roll the loop of individual ligths to calculate
            calculateLight(default_light, _eyeToPoint, _normal);


            //  Final light intensity calculation
            vec4 color = vec4(vec3(0.), _color.a); // start with vertex color alpha

            #ifdef TANGRAM_MATERIAL_EMISSION
                color.rgb = material.emission.rgb;
                color.a *= material.emission.a;
            #endif

            #ifdef TANGRAM_MATERIAL_AMBIENT
                color.rgb += light_accumulator_ambient.rgb * _color.rgb * material.ambient.rgb;
                color.a *= material.ambient.a;
            #else
                #ifdef TANGRAM_MATERIAL_DIFFUSE
                    color.rgb += light_accumulator_ambient.rgb * _color.rgb * material.diffuse.rgb;
                #endif
            #endif

            #ifdef TANGRAM_MATERIAL_DIFFUSE
                color.rgb += light_accumulator_diffuse.rgb * _color.rgb * material.diffuse.rgb;
                color.a *= material.diffuse.a;
            #endif

            #ifdef TANGRAM_MATERIAL_SPECULAR
                color.rgb += light_accumulator_specular.rgb * material.specular.rgb;
                color.a *= material.specular.a;
            #endif

            // Clamp final color
            color = clamp(color, 0.0, 1.0);

            return color;
        }

// tangram-block-end: ShaderProgram, lighting, 2

// tangram-block-start: ShaderProgram, global, 0
#ifdef TANGRAM_VERTEX_SHADER
vec4 modelPosition(){return vec4(a_position.xyz/TANGRAM_TILE_SCALEexp2(u_tile_origin.z-u_tile_origin.w),1.)+vec4(0.,1.,0.,0.);}vec4 modelPositionBaseZoom(){return vec4(a_position.xyz/TANGRAM_TILE_SCALE,1.)+vec4(0.,1.,0.,0.);}
#endif
vec4 worldPosition(){return v_world_position;}
#ifdef TANGRAM_VERTEX_SHADER
vec4 wrapWorldPosition(vec4 world_position){
#if defined(TANGRAM_WORLD_POSITION_WRAP)
vec2 anchor=u_tile_origin.xy-mod(u_tile_origin.xy,TANGRAM_WORLD_POSITION_WRAP);world_position.xy-=anchor;
#endif
return world_position;}
#endif
#if defined(TANGRAM_VERTEX_SHADER)
vec3 worldNormal(){return TANGRAM_NORMAL;}
#elif defined(TANGRAM_FRAGMENT_SHADER)
vec3 worldNormal(){return u_inverseNormalMatrix
TANGRAM_NORMAL;}
#endif

// tangram-block-end: ShaderProgram, global, 0

// tangram-block-start: ShaderProgram, global, 1
void applyLayerOrder(float layer,inout vec4 position){position.z-=layerTANGRAM_LAYER_DELTAposition.w;}
// tangram-block-end: ShaderProgram, global, 1

// tangram-block-start: ShaderProgram, global, 2

#if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER)
attribute vec4 a_selection_color;varying vec4 v_selection_color;uniform vec4 u_selection_discard0;uniform vec4 u_selection_discard1;uniform vec4 u_selection_discard2;uniform vec4 u_selection_discard3;uniform vec4 u_selection_discard4;uniform vec4 u_selection_discard5;uniform vec4 u_selection_discard6;uniform vec4 u_selection_discard7;uniform vec4 u_selection_discard8;uniform vec4 u_selection_discard9;
#endif

// tangram-block-end: ShaderProgram, global, 2

// tangram-block-start: ShaderProgram, global, 3
uniform float u_view_pan_snap_timer;void snapToPixelGrid(inout vec4 position){vec2 position_fract=fract((((position.xy/position.w)+1.)*.5)u_resolution);vec2 position_snap=position.xy+((step(0.5,position_fract)-position_fract)position.w2./u_resolution);
#ifdef TANGRAM_VIEW_PAN_SNAP_RATE
position.xy=mix(position.xy,position_snap,clamp(u_view_pan_snap_timer
TANGRAM_VIEW_PAN_SNAP_RATE,0.,1.));
#else
position.xy=position_snap;
#endif
}
// tangram-block-end: ShaderProgram, global, 3

// tangram-block-start: ShaderProgram, utils, 0
#ifndef UTILS
#define UTILS
bool isLocalSpacePixelOutsideTile(vec4 pixel_local_space_position,float tile_scale){return pixel_local_space_position.x<0.||pixel_local_space_position.x>=tile_scale||pixel_local_space_position.y>0.||pixel_local_space_position.y<=-tile_scale;}
#endif

// tangram-block-end: ShaderProgram, utils, 0

const float PI=3.141592653589793;const float HALF_PI=PI/2.0;const float THETA=15.0PI/180.0;/Compute distance to cap.@param{int}type The Type of the cap(see CAP_TYPE in pattern_lines)@param{float}dx The distance of the pixel from the beginning of the line(not straight distance,but along the legs)@param{float}dy The distance of the pixel from the midline(see v_distances in vertex shader,aka ±1half_line_width)@param{float}aa_radius The distance from the mid-line from where antialiasing starts.For example for a linewidth 10px width and 2px filter radius it is 10px/2-2px=3px.@return{float}distance/float cap(int type,float dx,float dy,float aa_radius){float dist=0.0;dx=abs(dx);dy=abs(dy);if(type==1)dist=sqrt(dxdx+dydy);else if(type==3)dist=(dx+abs(dy));else if(type==2)dist=max(abs(dy),(aa_radius+dx-abs(dy)));else if(type==4)dist=max(dx,dy);else if(type==5)dist=max(dx+aa_radius,dy);return dist;}/Compute distance to join.@param{int}type The type of the join(see JOIN_TYPE in pattern_lines)@param{vec2}segment Interpolated a_segment attribute from the vertex shader@param{vec2}texcoord Pair of u/v coordinates to identify the 4 different extruded points of the segment.@param{vec2}distances 2 component vector where:x is the distance of the pixel from the beginning of the line(along the legs)y is the distance of the pixel from the midline(see v_distances in vertex shader,±1half_line_width)@param{vec2}miter Miter point coordiante@param{float}miter_limit The miter limit*@param{float}linewidth The width of the line*@return{float}computed distance*/float join(in int type,in vec2 segment,in vec2 texcoord,in vec2 distances,in vec2 miter,in float miter_limit,in float linewidth){float dx=distances.x;float result=abs(distances.y);if((dx<segment.x)||(dx>segment.y)){if(type==1){float s=dx<segment.x ? segment.x : segment.y;result=max(result,length(distances-vec2(s,0.0)));}else{float m=abs(texcoord.x>=0.0 ? miter.x : miter.y);if(type==2){result=max(result,m);}else if(type==0){result=max(result,m-miter_limit*linewidth/2.0);}}}return result;}void main(void){

// tangram-block-start: ShaderProgram, setup, 0

#if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER)
if(a_selection_color.rgb==vec3(0.)||a_selection_color==u_selection_discard0||a_selection_color==u_selection_discard1||a_selection_color==u_selection_discard2||a_selection_color==u_selection_discard3||a_selection_color==u_selection_discard4||a_selection_color==u_selection_discard5||a_selection_color==u_selection_discard6||a_selection_color==u_selection_discard7||a_selection_color==u_selection_discard8||a_selection_color==u_selection_discard9){gl_Position=vec4(0.,0.,0.,1.);return;}v_selection_color=a_selection_color;
#endif

// tangram-block-end: ShaderProgram, setup, 0

// tangram-block-start: ShaderProgram, setup, 1

        default_light = u_default_light;

// tangram-block-end: ShaderProgram, setup, 1

// tangram-block-start: Material, setup, 0

material = u_material;

// tangram-block-end: Material, setup, 0

vec4 color=v_color;vec3 normal=TANGRAM_NORMAL;
#ifdef TANGRAM_CROP_BY_TILE
if(isLocalSpacePixelOutsideTile(v_local_space_position,TANGRAM_TILE_SCALE.x)){discard;}
#endif
#if defined(TANGRAM_LIGHTING_FRAGMENT) && defined(TANGRAM_MATERIAL_NORMAL_TEXTURE)
calculateNormal(normal);
#endif
#if !defined(TANGRAM_LIGHTING_VERTEX)

#endif

#if defined(TANGRAM_LIGHTING_FRAGMENT)
color=calculateLighting(v_position.xyz-u_eye,normal,color);
#elif defined(TANGRAM_LIGHTING_VERTEX)
color*=v_lighting;
#endif

if(v_color.a<=0.0){discard;}bool solid=(u_dash_index==0.0);bool closed=v_linewidth_and_closed<0.0;float dx=v_distances.x;float dy=v_distances.y;float linewidth=abs(v_linewidth_and_closed);float aa_radius=linewidth/2.0-u_antialias;float dist=0.0;vec2 linecaps=u_linecaps;vec2 dash_caps=u_dash_caps;float line_start=0.0;float line_stop=v_length;if(solid){dist=abs(dy);bool potentialCap=!closed&&v_joinIndicator<0.0;if(potentialCap&&dx<line_start){dist=cap(int(u_linecaps.x),abs(dx),abs(dy),aa_radius);}else if(potentialCap&&dx>line_stop){dist=cap(int(u_linecaps.y),abs(dx)-line_stop,abs(dy),aa_radius);}else{dist=join(int(u_linejoin),v_segment,v_texcoord,v_distances,v_miter,u_miter_limit,linewidth);}}else{float segment_start=v_segment.x;float segment_stop=v_segment.y;float segment_center=(segment_start+segment_stop)/2.0;float freq=u_dash_periodlinewidth;float dash_phase=u_dash_phase-1e-5;float u=mod(dx+dash_phaselinewidth,freq);vec4 tex=texture2D(u_dash_atlas,vec2(u/freq,u_dash_index));float dash_center=float(tex.x)255.0linewidth;float dash_type=floor(float(tex.y)255.0+0.5);float _start=float(tex.z)255.0linewidth;float _stop=float(tex.a)255.0linewidth;float dash_start=dx-u+_start;float dash_stop=dx-u+_stop;if((dash_stop<segment_start)&&(dash_caps.x!=5.0)){float u=mod(segment_start+dash_phaselinewidth,freq);vec4 tex=texture2D(u_dash_atlas,vec2(u/freq,u_dash_index));dash_center=float(tex.x)255.0linewidth;float _start=float(tex.z)255.0linewidth;float _stop=float(tex.a)255.0linewidth;dash_start=segment_start-u+_start;dash_stop=segment_start-u+_stop;}else if((dash_start>segment_stop)&&(dash_caps.y!=5.0)){float u=mod(segment_stop+dash_phaselinewidth,freq);vec4 tex=texture2D(u_dash_atlas,vec2(u/freq,u_dash_index));dash_center=float(tex.x)255.0linewidth;float _start=float(tex.z)255.0linewidth;float _stop=float(tex.a)255.0linewidth;dash_start=segment_stop-u+_start;dash_stop=segment_stop-u+_stop;}bool discontinuous=((dx<segment_center)&&abs(v_angles.x)>THETA)||((dx>=segment_center)&&abs(v_angles.y)>THETA);float d_join=join(int(u_linejoin),v_segment,v_texcoord,v_distances,v_miter,u_miter_limit,linewidth);if(closed){line_start+=linewidth/2.0;line_stop-=linewidth/2.0;}if(dash_stop<=line_start){discard;}if(dash_start>=line_stop){discard;}if(discontinuous){if((dash_start>segment_stop)){discard;}if((dash_stop<segment_start)){discard;}if(dash_caps.x==1.0){if((u>_stop)&&(dash_stop>segment_stop)&&(abs(v_angles.y)<HALF_PI)){discard;}}if(dash_caps.y==1.0){if((u<_start)&&(dash_start<segment_start)&&(abs(v_angles.x)<HALF_PI)){discard;}}if((dash_caps.x!=1.0)&&(dash_caps.x!=5.0)){if((dash_start<segment_start)&&(abs(v_angles.x)<HALF_PI)){float a=v_angles.x/2.0;float cos_a=cos(a);float sin_a=sin(a);float x=(segment_start-dx)cos_a-dysin_a;float y=(segment_start-dx)sin_a+dycos_a;if(x>0.0){discard;}dash_caps.x=4.0;}}if((dash_caps.y!=1.0)&&(dash_caps.y!=5.0)){if((dash_stop>segment_stop)&&(abs(v_angles.y)<HALF_PI)){float a=v_angles.y/2.0;float cos_a=cos(a);float sin_a=sin(a);float x=(dx-segment_stop)cos_a-dysin_a;float y=(dx-segment_stop)sin_a+dycos_a;if(x>0.0){discard;}dash_caps.y=4.0;}}}if((dx<line_start)&&(dash_start<=line_start)&&(dash_stop>line_start)){dist=cap(int(linecaps.x),dx-line_start,dy,aa_radius);}else if((dx>line_stop)&&(dash_stop>line_stop)&&(dash_start<line_stop)){dist=cap(int(linecaps.y),dx-line_stop,dy,aa_radius);}else if(dash_type==1.0){dist=cap(int(dash_caps.x),abs(dash_center-u),dy,aa_radius);if((dx>line_start)&&(dx<line_stop)){dist=max(dist,d_join);}}else if(dash_type==0.0){dist=abs(dy);}else if(dash_type==2.0){dist=cap(int(dash_caps.y),abs(u-dash_center),dy,aa_radius);if((dx>line_start)&&(dx<line_stop)){dist=max(dist,d_join);}}if((dx>line_start)&&(dx<line_stop)){if((dx<=segment_start)&&(dash_start<=segment_start)&&(dash_stop>=segment_start)){dist=d_join;float angle=HALF_PI+v_angles.x;float f=abs((segment_start-dx)cos(angle)-dysin(angle));dist=max(f,dist);}else if((dx>segment_stop)&&(dash_start<=segment_stop)&&(dash_stop>=segment_stop)){dist=d_join;float angle=HALF_PI+v_angles.y;float f=abs((dx-segment_stop)cos(angle)-dysin(angle));dist=max(f,dist);}else if(dx<(segment_start-linewidth/2.)){discard;}else if(dx>(segment_stop+linewidth/2.)){discard;}}else if(dx<(segment_start-linewidth/2.)){discard;}else if(dx>(segment_stop+linewidth/2.)){discard;}}dist=dist-aa_radius;if(dist>=0.0){if(u_antialias==0.0){discard;}else{color=vec4(color.rgb,exp(-distdist)*color.a);}}
#ifdef TANGRAM_DEBUG_TRIANGLES
if(any(lessThan(v_barycentric,vec3(0.0085)))){color=vec4(0.0,1.0,0.0,1.0);}
#endif
gl_FragColor=color;}
at Function.eu.updateProgram (https://js.api.here.com/v3/3.1/mapsjs-core.js:391:218767)
at f.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:391:211705)
at Object.getProgram (https://js.api.here.com/v3/3.1/mapsjs-core.js:391:258465)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:391:513282)
at t (https://js.api.here.com/v3/3.1/mapsjs-core.js:391:513021)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:391:513178)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:391:512150)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:391:510585)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:391:510169)
at l.value (https://js.api.here.com/v3/3.1/mapsjs-core.js:391:509473)

Me pasa lo mismo, todo funcionaba bien hasta hace menos de 1 mes. No estoy seguro si el problema puede venir luego de alguna actualización. En la versión de chrome 86.0.4240.198 funciona correctamente y en la 87.0.4280.66 no.

The issue is not reproducible with the latest stable Chrome - v89.0.4389.90. Closing it for now, please report back if it still happens and we'll try to narrow down a reproducible snippet.