Example doc and color changes
This commit is contained in:
@@ -3,7 +3,7 @@ layout: example.html
|
|||||||
title: Icon Colors
|
title: Icon Colors
|
||||||
shortdesc: Example assigning a custom color to an icon
|
shortdesc: Example assigning a custom color to an icon
|
||||||
docs: >
|
docs: >
|
||||||
Example assigning a custom color to an icon. The features in this examples are all using the same image with the different colors coming from the javascript file.
|
Example assigning a custom color to an icon. The icon styles in this example use images with a white fill. For some features, custom colors set using the `color` property.
|
||||||
Note that icon files need to obey the same origin policy or send proper CORS headers for this to work. When relying on CORS headers, the `ol/style/Icon` must be configured with `crossOrigin: 'anonymous'`.
|
Note that icon files need to obey the same origin policy or send proper CORS headers for this to work. When relying on CORS headers, the `ol/style/Icon` must be configured with `crossOrigin: 'anonymous'`.
|
||||||
tags: "vector, style, icon, marker"
|
tags: "vector, style, icon, marker"
|
||||||
resources:
|
resources:
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const berlin = new Feature({
|
|||||||
rome.setStyle(
|
rome.setStyle(
|
||||||
new Style({
|
new Style({
|
||||||
image: new Icon({
|
image: new Icon({
|
||||||
color: '#8959A8',
|
color: '#BADA55',
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous',
|
||||||
// For Internet Explorer 11
|
// For Internet Explorer 11
|
||||||
imgSize: [20, 20],
|
imgSize: [20, 20],
|
||||||
|
|||||||
Reference in New Issue
Block a user