Skip to content

Conversation

@ambientlight
Copy link
Member

@ambientlight ambientlight commented Apr 5, 2021

Add support for vector tile source. Introduces no breaking changes via AzureMapDataSourceContext introducing another stateful provider wrapping VectorTileSource.

Example Usage:

const MapRoot: React.FC = () => 
  <AzureMapsProvider>
    <div style={{ height: '100vh' }}>
      <AzureMap options={option}>
        <AzureMapVectorTileSourceProvider 
          id={"Traffic Flow DataSource"} 
          options={{
            maxZoom: 22,
            tiles: ['https://{azMapsDomain}/traffic/flow/tile/pbf?api-version=1.0&style=relative&zoom={z}&x={x}&y={y}'], 
          }}>
          
          <AzureMapLayerProvider
            id={'Flow Layer'}
            type={'LineLayer'}
            options={{
              sourceLayer: 'Traffic flow',
              strokeColor: [
                'interpolate',
                ['linear'],
                ['get', 'traffic_level'],
                0, 'red',
                0.33, 'orange',
                0.66, 'green'
              ],
              strokeWidth: [
                'interpolate',
                ['linear'],
                ['get', 'traffic_level'],
                0, 6,
                1, 1
              ]
            }}
          />
        </AzureMapVectorTileSourceProvider>
      </AzureMap>
    </div>
  </AzureMapsProvider>

@ambientlight ambientlight changed the title Vector Tile Source Support feat: Vector Tile Source Support Apr 5, 2021
@msasinowski
Copy link
Contributor

@ambientlight Can you also provide an example in playground and docs?

Copy link
Contributor

@msasinowski msasinowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psrednicki Please also take a look and make some smoke tests on it.

@ambientlight
Copy link
Member Author

ambientlight commented Apr 7, 2021

@ambientlight Can you also provide an example in playground and docs?

@msasinowski: Forgot about the docs, will add, thanks. Playground example is at Azure/react-azure-maps-playground#46

@ambientlight
Copy link
Member Author

The docs PR is at WiredSolutions/react-azure-maps-docs#11

@msasinowski: let me know if all your comments are appropriately addressed, thanks!

@psrednicki
Copy link
Contributor

Its looks good - i added some minor comments. @ambientlight Thanks for contribution, you do great work! I need some time to do some smoke tests and probably finish it by the end of the week.

@psrednicki
Copy link
Contributor

I have test that and it looks good! Let's resolve theses comments and we can merge it.

@ambientlight
Copy link
Member Author

@psrednicki: thanks, should be all addressed now

Copy link
Contributor

@psrednicki psrednicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@psrednicki psrednicki merged commit 8895031 into Azure:master Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants