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

TypeError: this._adjustTilePoint is not a function #49

Open
gmarshall56 opened this issue Apr 29, 2021 · 4 comments
Open

TypeError: this._adjustTilePoint is not a function #49

gmarshall56 opened this issue Apr 29, 2021 · 4 comments

Comments

@gmarshall56
Copy link

In a React functional component, my code:
` var style = {
"clickable": true,
"color": "#00D",
"fillColor": "#00D",
"weight": 1.0,
"opacity": 0.3,
"fillOpacity": 0.2
};
var hoverStyle = {
"fillOpacity": 0.5
};

    const geojsonURL = 'https://dla-maps-storage.s3.amazonaws.com/geoJSONFiles/testFAA.json';
    const geojsonTileLayer = new L.TileLayer.GeoJSON(geojsonURL, {
            clipTiles: true,
            unique: function (feature) {
                return feature.id;
            }
        }, {
            style: style,
            onEachFeature: function (feature, layer) {
                if (feature.properties) {
                    var popupString = '<div class="popup">';
                    for (var k in feature.properties) {
                        var v = feature.properties[k];
                        popupString += k + ': ' + v + '<br />';
                    }
                    popupString += '</div>';
                    layer.bindPopup(popupString);
                }
                if (!(layer instanceof L.Point)) {
                    layer.on('mouseover', function () {
                        layer.setStyle(hoverStyle);
                    });
                    layer.on('mouseout', function () {
                        layer.setStyle(style);
                    });
                }
            }
        }
    );
    map.addLayer(geojsonTileLayer);`

On the line:
const geojsonTileLayer = new L.TileLayer.GeoJSON(geojsonURL, {....

I get:
TypeError: this._adjustTilePoint is not a function

Thank you

@MarinaDrozdovskaya
Copy link

I have the same issue.

@darkwood-studios
Copy link

same here...

@sirst07
Copy link

sirst07 commented Mar 30, 2022

same here...
_adjustTilePoint was removed at leaflet>1.0

@jurrian
Copy link

jurrian commented Aug 31, 2023

The same problem is mentioned in #39 but it wasn't fixed. As we speak the last change is 7 years ago so it looks rather stale.
Leaflet has changed after >0.7 so some changes are needed to make it work.

For whoever feels like continuing on this, start with commenting out these lines:
Line 6: this._tiles[tilePoint.x + ':' + tilePoint.y + ':' + tilePoint.z] = tile;
Line 26: this._adjustTilePoint(tilePoint);
Line 256: L.TileLayer.Ajax.prototype._tileLoaded.apply(this, arguments);

This made it render for me, however it seems that _reset is never triggered so it will keep rendering things on top of each other.

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

5 participants