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

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

Open

Description

@danaERadwin

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

Activity

  1. rajivhbk commented on Jul 10, 2017

    @rajivhbk

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions