Git Product home page Git Product logo

Comments (6)

kuzkok avatar kuzkok commented on May 29, 2024

Hello.
WFS layer extends L.FeatureGroup layer and have all its methods and events. You can use .bindPopup or onclick event as in quick start guid. I check this and its work

var boundary = new L.WFS().addTo(map).bindPopup('I am popup')

or

var popup = new L.Popup();
boundaries.on('click', function(e){
  popup
    .setLatLng(e.latlng)
    .setContent('You clicked on boundary layer at '+ e.latlng.toString())
    .openOn(map);
});

Also you can use Leaflet.ToolBar plugin as we did in polygon example

from leaflet-wfst.

mtravis avatar mtravis commented on May 29, 2024

Thanks for getting back to me.

I actually tried .bindPopup(feature.properties.id) but the console gave
an error saying:

Uncaught ReferenceError: feature is not defined

Is it possible to access features properties?
On 24 Jun 2015 8:30 pm, "kuzkok" [email protected] wrote:

Hello.
WFS layer extends L.FeatureGroup layer and have all its methods and
events. You can use .bindPopup
http://leafletjs.com/reference.html#featuregroup-bindpopup or onclick
http://leafletjs.com/reference.html#featuregroup-click event as in quick
start guid http://leafletjs.com/examples/quick-start.html. I check this
and its work

var boundary = new L.WFS().addTo(map).bindPopup('I am popup')

or

var popup = new L.Popup();
boundaries.on('click', function(e){
popup
.setLatLng(e.latlng)
.setContent('You clicked on boundary layer at '+ e.latlng.toString())
.openOn(map);
});

Also you can use Leaflet.ToolBar
https://github.com/Leaflet/Leaflet.toolbar plugin as we did in polygon
example http://flexberry.github.io/Leaflet-WFST/examples/polygon.html


Reply to this email directly or view it on GitHub
#8 (comment)
.

from leaflet-wfst.

mtravis avatar mtravis commented on May 29, 2024

It appears not, as its a FeatureGroup and has a shared bindPopup method.

Is there a way of getting the data into a L.geoJson layer?

from leaflet-wfst.

kuzkok avatar kuzkok commented on May 29, 2024

There is no way to get L.geoJson layer in this plugin. You can access to layer feature in onclick event:

 boundary.on('click', function (e) {
    popup
      .setLatLng(e.latlng)
      .setContent('You clicked at '+ e.layer.feature.id)
      .openOn(map);
  });

but now it's not work with "Multi" classes such as MultiCurve and MultiSurface

from leaflet-wfst.

mtravis avatar mtravis commented on May 29, 2024

That's great thanks. Exactly what I needed.
On 25 Jun 2015 07:44, "kuzkok" [email protected] wrote:

There is not way to get L.geoJson layer in this plugin. You can access to
layer feature in onclick event:

boundary.on('click', function (e) {
popup
.setLatLng(e.latlng)
.setContent('You clicked at '+ e.layer.feature.id)
.openOn(map);
});

but now it's not work with "Multi" classes such as MultiCurve and
MultiSurface


Reply to this email directly or view it on GitHub
#8 (comment)
.

from leaflet-wfst.

kuzkok avatar kuzkok commented on May 29, 2024

example at http://flexberry.github.io/Leaflet-WFST/examples/popup.html

from leaflet-wfst.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.