![pug template anchor pug template anchor](https://i.etsystatic.com/25336633/r/il/4f1454/2893498647/il_fullxfull.2893498647_903h.jpg)
This placeholder can be used to scale a template before it is converted to ensure it renders clearly. The SVG image is converted to an png image when added to the map image sprite. SVG image templates support the following placeholder values: Placeholder GetImageTemplate(templateName: string, scale?: number) NameĪddImageTemplate(templateName: string, template: string, override: boolean)Īdds a custom SVG image template to the atlas namespace. Use the following static functions on the atlas namespace. If your application uses the same icon with different icons or if you are creating a module that adds additional image templates, you can easily add and retrieve these icons from the Azure Maps web SDK. Var dataUri = 'data:image/svg+xml base64,' + btoa(svg) Convert to data URI for use in image tags. ('myTemplatedIcon', 'marker-flat', 'teal', '#fff').then(function () /, 1)
#Pug template anchor how to
The following code shows how to create an image from one of the built-in templates, and use it with a symbol layer. Thus, it returns a Promise that you can wait for this function to complete. This function asynchronously loads the image into the image sprite. To ensure crisp rendering, it's better to scale up the image template before adding it to the sprite, than to scale it up in a layer. When the image is applied to the image sprite, it's converted into a PNG. The scale option scales the image template before applying it to the image sprite. The color option sets the primary color of the image and the secondar圜olor options sets the secondary color of the image. The templateName specifies which image template to use. Use this identifier in the layers to specifying which image resource to render. The id is assigned to the image when it's added to the maps image sprite.
![pug template anchor pug template anchor](https://shots.codepen.io/tvs/pen/OmmMMO-800.jpg)
The id is a unique identifier you create. This function allows up to five parameters to be passed in createFromTemplate(id: string, templateName: string, color?: string, secondar圜olor?: string, scale?: number): Promise Image templates can be added to the map image sprite resources by using the function. In total there are 42 image templates provided: 27 symbol icons and 15 polygon fill patterns. They can be used to create images with custom scales, or used as a customer primary and secondary color. These marker images and more are available as SVG templates. The IconOptions, of the SymbolLayer, preloads a couple of marker images in a handful of colors into the map image sprite, by default. In order to ensure good performance with layers, load the images into the map image sprite resource before rendering.
![pug template anchor pug template anchor](https://i.pinimg.com/originals/4a/95/bb/4a95bbf9ff8610c3c0a905892133a4e0.jpg)
HTML markers can render points using images and other HTML elements.Polygon layers can be rendered with a fill pattern image.Symbols can also be rendered along a lines path. Symbol layers can render points on the map with an image icon.Images can be used with HTML markers and various layers within the Azure Maps web SDK: