Giter Club home page Giter Club logo

leaflet-list-markers's Introduction

Leaflet List Markers

#What A Leaflet Control for listing visible markers/features in the map

Tested in Leaflet 0.7.1

#Where

Demos:
opengeo.tech/maps/leaflet-list-markers

Source code:
Github

Image

#How Include leaflet-list-markers.css to page

Adding the List control to the map:

map.addControl( new L.Control.ListMarkers({layer: markersLayer}) );
//markersLayer is a L.LayerGroup contains listing markers

short way:

var map = new L.Map('map', { listMarkersControl: {layer: markersLayer} });

#Build

Since Version 1.4.7 this plugin support Grunt for building process. Therefore the deployment require NPM installed in your system. After you've made sure to have npm working, run this in command line:

npm install
grunt

leaflet-list-markers's People

Contributors

stefanocudini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

leaflet-list-markers's Issues

adding layerGroup

Is it possible to insert a layerGroup instead of one single layer to the markerlist?
e.g.:
var markerlist = new L.Control.ListMarkers({layer: myLayergroup});

Map markers dissolving an reapearing randomly on zoom and pan

Hi Stefan, big thanks for this plugin.
I'm making great use of it. One thing that i can't get my head around is the the behavior that sometimes map marker just disappear, and then on interaction with the map element reappear again.
It happens on zoom and pan.
Do you perhaps know where the problem here is?

List outside

Hey,
is it possible to get the marker list outside the map?

I am at my mobile at the moment, will have a closer look later at Home.

Great work, thanks Stefano!!

Does only work on desktop

Someone in my forum asked about such a feature like leaflet-list-markers. So I created an example page. But it does work only on desktops, with Android doesn't. I can't test on an iPhone.

Do you plan to continue working on leaflet-list-markers?

Thank you very much.

Show/hide list markers on filtering with Layer Groups

Im using the native Leaflet filtering (Layer Groups and Layers Control): https://leafletjs.com/examples/layers-control/
When I hide/show the different groups, the marker list it's not updating. How can I achieve this?
I've also tried this with the demo-project for this plugin - same results as in my project.

I've made a function that checks if each filter is checked of that helps:
let checkboxTest = document.querySelectorAll('.leaflet-control-layers-selector'); for(let i = 0; i < checkboxTest.length; i++) { checkboxTest[i].addEventListener('change', function(){ console.log(checkboxTest[i].parentElement.textContent + ' is: ' + checkboxTest[i].checked); }); }

Here is my Layer control:
`
const overLayMap = {
'Group A': groupA,
'Group B': groupB,
};

  const filter = L.control.layers(null, overLayMap, {collapsed:false}).addTo(map);

`

Mark list item when hovering/clicking marker

Great plugin!
So if i get it right:

  • On hovering a list item, it's map marker is changes color
  • On clicking that list item, it's map marker is centered

What would be cool:

  • On hovering a map marker, its list item is changing color
  • (Plus, on clicking a map marker, the description from #9 is opened)
  • (Plus, on clicking a map marker, for long lists with overflow-y=scroll, the list item is scrolled to the visible viewport)

Would that be complex?

List marker options

Hello,
I would need some information on list markers:

  • how can I change the opacity of the list and also the background color
  • how can I set the overflow so that if the markers in the list increase, they scroll through the scrollbar?
    Thanks

Use of deprecated properties

After using this plugin within my Leaflet app, I keep on seeing the following warning:

leaflet.js:5 Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead. Error
    at y (https://unpkg.com/[email protected]/dist/leaflet.js:5:2048)
    at Function.v.extend (https://unpkg.com/[email protected]/dist/leaflet.js:5:14706)
    at http://localhost:63342/CS3821/lib/leaflet-list-markers/dist/leaflet-list-markers.min.js:17:45
    at http://localhost:63342/CS3821/lib/leaflet-list-markers/dist/leaflet-list-markers.min.js:17:2811

The code I have in my script is the following:

let list = new L.Control.ListMarkers({layer: markersLayer, itemIcon: null});

list.on('item-mouseover', (e) => {
    e.layer.setIcon(L.icon({
        iconUrl: '../lib/leaflet-list-markers/images/select-marker.png'
    }));
}).on('item-mouseout', (e) => {
    e.layer.setIcon(L.icon({
        iconUrl: getPath() + 'marker-icon.png'
    }));
});
map.addControl(list);

What I did

I tried finding a way to fix that but I can't seem to find anything unlike the marker icon issue which I'm trying to fix (incoming issue or PR on that) (everything else on the map works fine).

Environment

I have this issue on both Opera, Chrome and Firefox (using either ArchLinux or Windows 7).

EDIT: I found a fairly simple work-around to restore the correct icon on the markers after "mousing-out" but I still get the warning.

Support accordion-style item description

What a super plugin! I'd love to have descriptions for the item titles, and on clicking a list item, have the description open below the item (accordion style). Would that be complex?

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.