Leaflet maps plugin changing the default map

I’m using the Leaflet maps plugin. In my use case I’m using the GeoTiddler approach so I only have to assign and color and point coordinates to have a map included in the tiddler.

Occasionally I need to change the default map (from osm to sat), but there does not seem to be a geoSyntax option for tile as there is for color, marker, point etc.

How can I achieve this?

@myfta Review the Memory Keeper. When I found this same issue I added a configuration setting to Memory Keeper’s configuration. This saves the users selection in tiddler $:/config/cls/collection in field default-leafmap.

Then I pass this value to the tile parameter of the leafmap macro.

<$leafmap tileControl tile={{$:/config/cls/collection!!default-leafmap}} places='{"filter":"$filter$"}' cluster='30' />

I think my issue is I’m not using the $leafmap macro, but the GeoTiddler method. That way I only need add point and color as fields in a tiddler. The map that is the rendered is defined in one of leafmap’s config tiddlers $__plugins_sycom_leaflet_mapWidget.tid.js

Hi there,

Sorry for the delay. I think this will do the job (if I didn’t misunderstand your request) :

  • In your wiki, edit the tiddler $:/plugins/sycom/leaflet/templates/geoTiddler
  • the tiddler defines a call to the leafmap plugin. Add a tile parameter to the widget, calling the tile attribute of the tiddler (and defaulting to osm) : tile={{{ [get[tile]else[osm]] }}}. See full code of the tiddler below.
  • save the tiddler

Cheers

Sylvain

<$list filter="[all[current]has[point]] [all[current]has[points]] [all[current]has[polyline]] [all[current]has[polylines]] [all[current]has[polygon]] [all[current]has[polygons]] [all[current]has[places]] [all[current]has[geojson]]">

<$leafmap places='{"tiddler":" "}' height='240px' tile={{{ [get[tile]else[osm]] }}}/>

</$list>