0

Is it possible to change marker's custom icon image size? If i set inside style size like this

style: {
    image: {
        icon: {
            anchor: [0.5, 0.5],
            anchorXUnits: 'fraction',
            anchorYUnits: 'fraction',
            opacity: 1,
            size: [12, 12]
            src: 'images/map-marker.png'
            }
        }
    }

it only changes markers size on 12px x 12px but inside image stays in original size. Can i change size of image that I'm using for marker using directive?

Jose Gómez
  • 3,110
  • 2
  • 32
  • 54
saledo
  • 23
  • 6

1 Answers1

1

After some research i found answer. There is parameter scale in OpenLayers3 ol.style.Icon and it can be used in angular-openlayers directive.

style: {
    image: {
        icon: {
            anchor: [0.5, 0.5],
            anchorXUnits: 'fraction',
            anchorYUnits: 'fraction',
            opacity: 1,
            scale: 0.5,
            src: 'images/map-marker.png'
            }
        }
    }

I used this question for help How do I decrease the size of Icon in openlayers 3, i am using bing maps

Community
  • 1
  • 1
saledo
  • 23
  • 6
  • How to get coordinates of a point using [Angular-openlayers-directive](https://github.com/tombatossals/angular-openlayers-directive) , http://stackoverflow.com/questions/36435689/how-to-get-coordinates-on-double-click-on-openstreetmap – jain Apr 06 '16 at 03:15