Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken in leaflet .44 #3

Open
PHP-Point-Of-Sale opened this issue Aug 28, 2012 · 0 comments
Open

Broken in leaflet .44 #3

PHP-Point-Of-Sale opened this issue Aug 28, 2012 · 0 comments

Comments

@PHP-Point-Of-Sale
Copy link

When attempting to use this plugin in leaflet .44 I get the following error:

leaflet-src.js:55TypeError: 'undefined' is not an object (evaluating 'obj[key]')

Below is my code:

<!doctype html>
<html lang="en">
<head>
    <link rel="stylesheet" href="leaflet.css">
    <script src="leaflet-src.js"></script>
    <script src="leafpile-src.js"></script>

</head>
<body>
<div id="map" style="width: 600px; height: 600px;"></div>
<script>
    // normal map init stuff
var map = new L.Map('map');
var tilesUrl = 'http://{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png';
var subDomains = ['otile1','otile2','otile3','otile4'];
var attrib = 'Data, imagery and map information provided by <a href="http://open.mapquest.com" target="_blank">MapQuest</a>, <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> and contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/" target="_blank">CC-BY-SA</a>';
var tiles = new L.TileLayer(tilesUrl, {maxZoom: 18, attribution: attrib, subdomains: subDomains});
map.setView(new L.LatLng(40.423, -98.7372), 8).addLayer(tiles);

// setup the leafpile

var leafpile = new L.Leafpile();
map.addLayer(leafpile);

// add some markers to the pile
var m1 = new L.Marker(new L.LatLng(47.81, -124.18)),
    m2 = new L.Marker(new L.LatLng(39.33, -93.81)),
    m3 = new L.Marker(new L.LatLng(42.37, -121.90));
leafpile.addMarker(m1);
leafpile.addMarker(m2);
leafpile.addMarker(m3);

</script>

</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants