Versions

Leaflet.fwaction (2018-10-13) (Downloaded 17 times)

Contains:

  • Leaflet (item-action) - v. 1.0.0
  • LeafletMarker (action) - v. 0.2

Compatible: Pro 6 and Pro 7

Leaflet.fwaction (2014-04-26) (Downloaded 244 times)

Contains:

  • Leaflet (item-action) - v. 0.3
  • LeafletMarker (action) - v. 0.2

Compatible: Pro 5.5 and Pro 6

Leaflet.fwaction (2014-04-09) (Downloaded 3 times)

Contains:

  • Leaflet (item-action) - v. 0.2
  • LeafletMarker (action) - v. 0.2

Compatible: Pro 5.5 and Pro 6

Author: Walter Davis

map

This Action allows you to use the Open Street Map service wherever you might use Google Maps. The resulting map is pleasantly-colored, and is very mobile-friendly. It works well in flexible or responsive layouts, too.

To use, draw or insert an HTML box where the map should appear, and apply the Leaflet Action to that box. If you know the latitude/longitude that you would like to center the map on, you may enter it directly, or you can use the address lookup service to find it. Zoom goes from 1 to 18, with illegal values ignored.

To add markers to the map, use the included Leaflet Marker Action. This is a “draw it on the page” Action, accessible from the Action tool in the application toolbar. The marker element may be drawn anywhere you like on the page, the resulting HTML will be removed anyway.

Choose which map it belongs to (you may have multiple maps, or multiple markers per map).

Use the address/latitude/longitude interface fields to enter the location of the pin, then enter the text you would like to see on the marker tooltip. If you want to split the text across multiple lines, just add <br> tags where needed.

8 Comments

Can the wheel scroll zoom function be disabled as in Google maps ? - Which uses "wheelscroll:false"

Richard

As a refugee from Google Maps (not happy about giving credit card details to the big G) this looks an ideal replacement, especially as I love OpenStreetMap and am a contributor.

I've had a try running this action (running FreewayPro 7.1.3 but can't get it to accept any address or Long/Lat details. Is there a guide for what the action expects to receive? I'm in the UK so have tried postal (number/street/town) and postcodes plus N50º W005º type Long/Lat numbers but get an error box every time. Error underlines in red: "location=eval(location.toString())[0];" as near as I can make out (very small type)

Thanks for any response.

Try using https://nominatum.openstreetmap.org to calculate these. They need to be in the format 39.9604402,-75.1597701.

Walter

Walter, thanks for responding so quickly. I tried to open https://nominatum.openstreetmap.org but all i get is "server not found". I'm on a private connection so there shouldn't be any access problems.

I've just tried the example coordinates you posted and I've now got a nice map of Philly! I'll try and sort out my coordinates and see what happens.

Much appreciate your help! Thanks

Sorry, I spelled the subdomain incorrectly. It’s https://nominatim.openstreetmap.org/

No worries - I used the Open Street Map editor to find the coordinates I needed. Works a treat. One last thing - is it possible to have the blue marker without text (or style the text to make it smaller)? At the moment the text balloon is taking up a good chunk of my small map! If it's not possible, I can make the map bigger so clients can see enough context map around the edges. ;-)

Thanks so much for your help.

Hi Walter I can't get this to work at all even with your coordinates, it does not show any "Map" options at the end of the actions details. I'm trying to apply it to an old site Upon trying to upload I get an error message with the following underlined

var id =‘osm_’ + param-safe(map.toString{});

Am I applying it wrong perhaps

Cheers Anthony

Try starting over on a completely new site, with no other sites open. Draw an HTML box on the page where you want the map to appear. While the box is selected (corner handles showing) apply the Leaflet Action to that box. In the Actions palette, enter the address you want to map and use the "Find Coordinates" button to look it up. This will take a few moments, and there will be no feedback while it is working. When the lookup service is done, the Action will fill in the latitude and longitude settings. Preview in a browser, and you should see the map directly.

If that works (and it does here), then move back to your "broken" document, and try first removing all vestiges of Leaflet from the pages and publishing once. Confirm that the Action is not in use by opening the Edit / Actions dialog, and checking for it there. If you find a stray lodged in the document somewhere, that dialog will tell you which page is the culprit. Make sure you publish once without the Action.

Then go through the first set of steps again, and it should work.

If you are getting this error from the Leaflet Marker Action, then go through these steps, ensuring that there are no stray instances of the marker inserted in your page anywhere. It can be helpful to enable the option "Action Labels" in the View menu. Otherwise, Action-items are fairly hard to see in the existing page. Go through the steps above, substituting Leaflet Marker for Leaflet, and ensure that you publish once before trying to re-apply the Action by using the Insert / Action-item / Leaflet Marker command.

Walter

Sign In or Sign Up to comment.