Hi
Can i request official wisej control?, or some advice/tutorial/guideline to start to create a wisej leaflet advanced control (events-properties, methods…) for :
http://leafletjs.com/
Has a great plugins to integrate too, would be amazing to have some samples with plugins to start with wisej control, personally i was using googlemaps/ajax/aspnet some time ago with some plugins like markercluster…, but leaflet markercluster plugin is a winner, smooth animations, small js file…
http://leafletjs.com/plugins.html
For reference here are some samples for leaflet markercluster plugin, has cluster feature, events like marker click to zoom pan and declutter, dinamic cluster/declustering … try change zoom…
http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html
http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-zoomtobounds.html
You can using leaflet too, with openstreetmap provider to avoid some polices and save some cost like others (googlemaps…)
Thanks in advance!
You’ll need to create a Widget. (see https://docs.wisej.com/docs/controls/content/widget )
I would recommend following the Leaflet Quick Start Guide when you are trying to figure out what Javascript you need to write to get a simple implementation of Leaflet.
A similar question was recently asked, about implementing a different JavaScript widget (Lottie Web Player). It’s a very similar process to implement Leaflet. For Leaflet, you will need a different Javascript source code file. (For Leaflet, I believe it is “https://unpkg.com/leaflet@1.9.3/dist/leaflet.js”). Additionally, the Javascript to initialize the component will look a little different.
Hello Wisej Community,
I’ve created a Github repository for a Wisej LeafletJS widget called WjLeaflet. This widget provides advanced control features such as events, properties, and methods.
The repository can be found at: https://github.com/Opzet/WjLeaflet
I would greatly appreciate it if the Wisej community could review the repository and contribute to help implement the full feature set of LeafletJS from Wisej C#.
Thank you for your time and support!
Does anyone know why OnWidgetEvent(WidgetEventArgs e) reports 0,0 instead of coordinates, works with same event in VsCode?
The repository / source code can be found at: https://github.com/Opzet/WjLeaflet
This works in js
map.on('click', function(e) {
alert(e.latlng);
} );
but calling the same via WidgetEvent return dynamic is faulty?
protected override void OnWidgetEvent(WidgetEventArgs e)
{
switch (e.Type)
{
case "click": //Mapclick
case "rightclick":
// latlng
OnMapClick(new MapMouseEventArgs(e));
break;
LeafletjsMap -> LeafletMap.cs
/// <summary>
/// Fired when the user clicks on the map or a marker.
/// </summary>
public event MapMouseEventHandler MapClick
{
add { base.AddHandler(nameof(MapClick), value); }
remove { base.RemoveHandler(nameof(MapClick), value); }
}
Wired up
this.leafletMap1.MapClick` += new LeafletjsMaps.MapMouseEventHandler(this.leafletMap1_MapClick);
Line 60: frmWjLeafletjs.cs
// C# Event -> reports co ordinates 0,0 ?
private void leafletMap1_MapClick(object sender, MapMouseEventArgs e)
{
// To Do : MapMouseEventArgs not bubbling up, always shows as Lat:0 , Lon:0 ?
// Works in VsCode?
if (e.Marker == null)
AlertBox.Show("You clicked location: " + e.Location.ToString());
Please login first to submit.