Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

custom layers #34

Open
nmccready opened this issue Oct 29, 2015 · 3 comments
Open

custom layers #34

nmccready opened this issue Oct 29, 2015 · 3 comments

Comments

@nmccready
Copy link
Contributor

From @robotnic on December 11, 2014 14:49

I wan't to use 2 special layers

https://github.com/glenrobertson/leaflet-tilelayer-geojson
and
https://github.com/afsuarez/mapsforge-cordova-plugin

I have seen "custom" layer in the source code, but I don't know how to use that.

Copied from original issue: tombatossals/angular-leaflet-directive#564

@nmccready
Copy link
Contributor Author

From @porjo on January 16, 2015 0:59

Have you looked at the examples here: http://tombatossals.github.io/angular-leaflet-directive

@nmccready
Copy link
Contributor Author

From @ageblade on August 30, 2015 7:5

Hi, this is the way you can use custom layers (This example use leaflet IIP plugin)

$scope.layers.overlays["iip"] = {
    name: 'iip',
    type: 'custom',
    visible: true,
    layer: L.tileLayer.iip(url, options)
};

Just initialize your custom layer into the layer property and set a name, visible and type = 'custom'.

Good luck,

@xandros6
Copy link

Hi I try with follow custom layer:

var poi = {
          name:'POI',
          type: 'custom',
          visible: true,
          layer: L.geoJson(data, {
            pointToLayer: function(feature, latlng) {
              return L.marker(latlng, {icon: 
                L.AwesomeMarkers.icon({
                  icon: 'icon-wine',
                  markerColor: 'red',
                  prefix: 'icon'
                }), opacity:0.8, fillOpacity: 0.3});
            }
        })
        };

but when I add it to layers with :

$scope.map_layers.overlays.poi = poi;

I receive a

RangeError: Maximum call stack size exceeded at equals (ionic.bundle.js:14421)

If I use

geoJSONAwesomeMarker

all is OK but I not have my custom settings.

Can you help me please?

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