{"action":"closed","issue":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3157","labels_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3157/labels{/name}","comments_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3157/comments","events_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3157/events","html_url":"https://github.com/Leaflet/Leaflet/issues/3157","id":54967415,"number":3157,"title":"Can't load Leaflet plugin using RequireJS","user":{"login":"ssuarezbe","id":6564041,"avatar_url":"https://avatars.githubusercontent.com/u/6564041?v=3","gravatar_id":"","url":"https://api.github.com/users/ssuarezbe","html_url":"https://github.com/ssuarezbe","followers_url":"https://api.github.com/users/ssuarezbe/followers","following_url":"https://api.github.com/users/ssuarezbe/following{/other_user}","gists_url":"https://api.github.com/users/ssuarezbe/gists{/gist_id}","starred_url":"https://api.github.com/users/ssuarezbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssuarezbe/subscriptions","organizations_url":"https://api.github.com/users/ssuarezbe/orgs","repos_url":"https://api.github.com/users/ssuarezbe/repos","events_url":"https://api.github.com/users/ssuarezbe/events{/privacy}","received_events_url":"https://api.github.com/users/ssuarezbe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-21T01:53:33Z","updated_at":"2015-01-21T02:15:59Z","closed_at":"2015-01-21T02:15:58Z","body":"Hi, I need some help.\r\n\r\nI am trying to load leaflet plugin using requirejs.\r\n\r\nFor example if I want to use the leaflet.AnimatedMarker, I do this:\r\n```\r\nrequire.config({\r\n  paths: {\r\n    'leaflet': './bower_components/leaflet-dist/leaflet',\r\n    'leafletAnimatedMarker': './js/leaflet.AnimatedMarker/AnimatedMarker'\r\n  },\r\n  shim: {\r\n    'leafletAnimatedMarker': {\r\n        deps: ['leaflet'],\r\n        exports: 'LeafletAnimatedMarker'\r\n    }\r\n  }\r\n});\r\n```\r\nI use it in this way.\r\n```javascript\r\nrequire(['leafletAnimatedMarker'],function(leafletAnimatedMarker)\r\n{\r\n  ...\r\n});\r\n```\r\nIf the code before is correct why it does not work.\r\n\r\nWhen I verify if the plugin is loaded using `console.log(leafletAnimatedMarker)` is shows *'undefined'* and I do not know if I'm doing something wrong or if leaflet do not support require yet.\r\n\r\n**Using the bower version - \"leaflet-dist\": \"~0.7.2\"**"}}