tombatossals / angular-leaflet-directive

AngularJS directive to embed an interact with maps managed by Leaflet library
http://tombatossals.github.io/angular-leaflet-directive
MIT License
1.5k stars 637 forks source link

Using the Yandex layer #830

Closed eljazouli closed 9 years ago

eljazouli commented 9 years ago

Hello,

I'm trying to add the Yandex Layer but i get this error : ReferenceError: ymaps is not defined

here is the code i use :

layers: {
        baselayers: {
          yandex: {
            name: 'Yandex',
            type: 'yandex',
            layerOptions: {
              layerType: 'map',
            }
          },
          yandexTraffic: {
            name: 'Yandex Traffic',
            type: 'yandex',
            layerOptions: {
              layerType: 'map',
              traffic: true,
            }
          }
        }
      }

Is there something i do wrong ?

Thank you !

tombatossals commented 9 years ago

Hi, I think you forgot to include the Yandex library in your html head section:

<script src="http://api-maps.yandex.ru/2.0/?load=package.map&lang=ru-RU" type="text/javascript"></script>

I have added a Yandex example (it was missing), briefly it will be included in the example browser.