Jump to content

About FieldtypeLeafletMapMarker Module: you don't understand anything


Recommended Posts

Hi, I found out that unfortunately openstreetmap maps are not viewable on mobile, also, the iframe tag is deprecated.I therefore had to resort to a processwire module. Not wanting to use google maps, I turned to https://processwire.com/modules/fieldtype-leaflet-map-marker/, but from the documentation it is not clear.Is there an EXAMPLE OF A WORKING USE OF MAP WITH MORE MARKERS ON PROCESSWIRE TEMPLATE? Maybe I'll copy that

Thank you very much

Link to comment
Share on other sites

I don't think there's any particular problem with OSM maps on mobile devices. For example, see https://leafletjs.com/examples/mobile/.

There are good instructions for the FieldtypeLeafletMapMarker module at https://processwire.com/modules/fieldtype-leaflet-map-marker/, but it might help to note that the basics (not tested) seem to be to include the following in the head section of your template:

<?php
	$map = wire('modules')->get('MarkupLeafletMap');
	echo $map->getLeafletMapHeaderLines();
?>

And in the body where you want the map to appear:

<?php echo $map->render($page, 'NAME_OF_YOUR_MARKER_FIELD'); ?>

To find out more about Leaflet (including markers), take a look at the Leaflet Quick Start Guide https://leafletjs.com/examples/quick-start/.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...