Skip to content

Can't change clickable property with function call #676

@JoergPf

Description

@JoergPf

Hi, I have a strange problem:

I would like to change the clickable marker property by clicking a link outside the map, but it doesn't work.
It works with the icon property, but not with clickable.

Check out this fiddle: http://jsfiddle.net/Ls59qLLa/2/

JS:
var app = angular.module('demoapp',['leaflet-directive']);

app.controller('DemoController', [ '$scope', 'leafletData', function($scope, leafletData) {

var local_icons = {
        defaultIcon: {},
        gmapicon: {
            iconUrl: 'http://maps.google.com/mapfiles/kml/shapes/capital_big.png',
            iconSize:     [25, 25],
            iconAnchor:   [12, 12], 
            popupAnchor:  [0, 0] 
        }
    }


angular.extend($scope, {
  markers: {
            m1: {
                lat: 41.85,
                lng: -87.65,
                clickable: false,
                message: "I'm a static marker",
                icon: local_icons.gmapicon
            }
        }
});

$scope.makeIconClickable = function(){
   var whichmarker = 'm1';
   $scope.markers[whichmarker].clickable = true;
}


}]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions