I was wondering if it were possible to set a map to initially be centered on the current user's position - at a default set zoom, and limited to a set proximity from the user (so the map isn't trying to load every point)?

I have the examples module installed and have been looking at the options, but I haven't quite been able to figure out how to set it up correctly.

Comments

W0LF created an issue. See original summary.

itamair’s picture

The new 8.x-1.0-beta18 release added the following hooks:
- hook_leaflet_views_feature_alter: Alter Leaflet View Style Point / Marker definition;
- hook_leaflet_default_map_formatter_alter: Alter the Leaflet Map Default Formatter settings;
- hook_leaflet_map_view_style_alter: Alter the Leaflet Map View Style settings;

by which it is possible to alter (and customize) the Leaflet Map settings, server side, before initializing it in js.
But you would be in charge to get the current user location (with server side user geolocation).
There is no logic implemented in the module (and it is not in my roadmap) to filter the initial markers depending on the windows bounding box extension.

At the same time you can interact and get access to the Leaflet map object using jQuery's trigger method (@see leaflet.drupal.js, #73)

itamair’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.