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

Is it possible to GEOJSON open popup by GET param in the url? #1196

Open
OmegaSkiller opened this issue Jan 24, 2022 · 0 comments
Open

Is it possible to GEOJSON open popup by GET param in the url? #1196

OmegaSkiller opened this issue Jan 24, 2022 · 0 comments

Comments

@OmegaSkiller
Copy link

I need to open a popup on geoJSON feature by GET. I cant find how is this possible
here is my geojson layer setup code:

                angular.extend($scope.layers.overlays, {
                    sold: {
                        name: 'Sold Land',
                        type: 'geoJSONShape',
                        data: data,
                        visible: true,
                        layerOptions: {
                            style: {
                                color: '#ff0000',
                                weight: 1,
                                fillOpacity: 0,
                                opacity: 1,
                            },
                            onEachFeature:
                                function (feature, layer) {
                                layer.on('click', function (e) {
                                    $http.get("/ajax.php?landId=" + feature.properties.id).success(function (data, status) { //var landData =
                                        var landDiv = document.getElementById('sold-detail-' + feature.properties.id);
                                        landDiv.innerHTML = data;
                                        return data;
                                    });
                                });
                                const popup = L.responsivePopup({className: 'buyPopup'}).setContent('<div class="buyPopup" id="sold-detail-' + feature.properties.id + '">Loading...</div>');
                                layer.bindPopup(popup);
                            },
                        },
                    },
                    selectedLand: {},
                });
                    // Put the cells on an associative array
                $scope.cells = {};
                for (var i = 0; i < data.length; i++) {
                    var cell = data[i];
                    $scope.cells[cell['properties']['type']] = cell;
                }
            });```
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

1 participant