angular-ui/angular-google-maps

Creating custom marker symbols (not from a URL)

danaERadwin opened this issue · 1 comments

I want to be able to create a marker, not from a URL but to change it dynamically in the code.
As far as I know, this feature does not exist in Angular, so I am using JS and regular HTML in my project.
When should it be available?

An example:

        var goldStar = {
          path: 'M 125,5 155,90 245,90 175,145 200,230 125,180 50,230 75,145 5,90 95,90 z',
          fillColor: 'yellow',
          fillOpacity: 0.8,
          scale: 1,
          strokeColor: 'gold',
          strokeWeight: 14
        };

Thanks

You can do this with angular. I achieved this by adding my markers dynamically to an array like this.

$scope.get_marker_object = (id, latitude, longitude, title, color)->
    return {
      id: id,
      latitude: latitude,
      longitude: longitude,
      title: title,
      icon: pinSymbol(color),
      options: {
        visible: true,
      }
    }

  pinSymbol = (color)-> {
    path: 'M0-48c-9.8 0-17.7 7.8-17.7 17.4 0 15.5 17.7 30.6 17.7 30.6s17.7-15.4 17.7-30.6c0-9.6-7.9-17.4-17.7-17.4z',
    fillColor: color,
    fillOpacity: 1,
    strokeColor: '#000',
    strokeWeight: 2,
    scale: .4
  };