Change Leaflet Map Zoom control style using Drupal Leaflet module - javascript

I am unable to find settings where I can make Zoom Control Style "Large" for Leaflet map.
Current system
My Page is coming from View, where view format is "Map (Leaflet API, via IPGV&M)". I am displaying custom markup on map using Leaflet marker.
I am using following modules for D7
Leaflet
Leaflet views
Leaflet More Maps
ip_geoloc
Edited
I need to change Zoom control style from Small to Large. This is a small Zoom control: prntscr.com/9eeq41 and This is a Large prntscr.com/9eeqqu

You can achieve this by including Zoomslider JS and CSS in your theme's js and css folder respectively.
Bind it with leaflet.map and then add zoomslider control to map.
Your code should look something like this :
jQuery(document).bind('leaflet.map', function(event, map, lMap) {
L.control.zoomslider().addTo(lMap);
});
This will add zoomslider control to your map.
You can find Reference here : Leaflet Zoomslider

Go to admin/structure/types/manage/YOUR_CONTENT_TYPE/display.
At Geofield (field) format choose leaflet and click the settings
icon on the right.
There you can change min/max view settings like in the pic.

Related

react google maps render custom html on map

I'm using #react-google-maps/api ^2.12.1 in my react project. I want to create an interactive HTML component as a marker on the map. Still, on every documentation of google maps, I only find how to change a marker icon to set as a static icon image or how to set a label text, but not how to add an HTML component to a specific coordinate on the map. Could anyone help me?

Tools for creating an interactive embeddable map with zoom and tooltips

Does anyone know of any tool or plugin where I can create an embeddable interactive map similar to the image below? We are looking to have each of the blue numbers open a popup or tooltip with an image and more info. We would also prefer if we could style the map similar to our static map or just use the map as a background image and add the points with the tool.

Display ECharts map using OpenStreetMap without Leaflet

I would like to render a geographical map inside my web page using the ECharts library.
ECharts needs a third party service to retrieve the images of the geographical region that it must display and I would like to use OpenStreetMap.
The only available implementation that does something similar to what I need is this echarts-leaflet repository, which uses ECharts + Leaflet + OpenStreetMap and is not really up to date (it targets ECharts 3.6.2 while the current version is 5.2.2).
However, using both ECharts and Leaflet seems unnecessary to me (and increases the final bundle size) since ECharts and Leaflet should (?) do the same things and - as far as I can see - Leaflet and OpenStreetMap are two separate projects that does not depend on each other (am I wrong?).
Is there a way to use just ECharts and OpenStreetMaps avoiding Leaflet?
Bonus: the geographical map must be embedded inside a web page built with Angular 12. I tried to merge the code contained in ngx-echarts together with the one from echarts-leaflet but there are two issues:
my code still requires Leaflet to run
when I load the code inside echarts-leaflet I cannot manage to avoid Angular/Zone to hook into the event listeners set by Leaflet and this triggers a lot of unnecessary change detection cycles (it triggers on each mousemove event)

adding popup on features in leaflet geojson-vt

I have a map where i used the leafet-geojson-vt plugin (https://github.com/brandonxiang/leaflet-geojson-vt/tree/leaflet1.0.0) to draw GEOJSON data in a canvas layer with geojson-vt.
I'm able to add the layer to the map, however, I don't know how to add popups on click for each polygon/tile/feature in the layer. I've tried searching for examples but cannot find ones using the geojson-vt plugin.
How can I add such functionality using the example in the link above?
Any help is appreciated.

how to highlight markers on click in mapbox

I'm doing a mapbox project, where I have a list of projects on the right side of the screen. Each time I click on the list of a project name, the map will zoom to the location of the project.
I imported the markers to mapbox and used mapID to show them on the map.
Now I want to highlight the marker for each project that I click on. The mapbox highlight examples are based on geojson or csv, but I imported the markers from mapbox editor. Can anyone show me how to do the highlight?
The code will be generally the same: see the L.mapbox.featureLayer documentation: instead of using setGeoJSON or loadURL like the examples do, initialize it like L.mapbox.featureLayer('mapid'), replacing 'mapid' with your mapid.

Categories