Skip to content
This repository has been archived by the owner on Nov 30, 2018. It is now read-only.

Creating custom marker symbols (not from a URL) #2012

Open
danaERadwin opened this issue Jun 15, 2017 · 1 comment
Open

Creating custom marker symbols (not from a URL) #2012

danaERadwin opened this issue Jun 15, 2017 · 1 comment

Comments

@danaERadwin
Copy link

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

@rajivhbk
Copy link

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
  };

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants