Can you plot a single point on a scatter map to indicate my office location vs my data plots
Hi everyone,
I am wondering if anyone has any widget script that allows you to plot a single point on a scatter map widget that allows you to easily see how your usual plot points are located compared to that specific location?
For example, if my office is based at a specific set of co-ordinates, I would like to add a marker to that location to easily see where it is on the map, compared to the points that are plotted from my data.
I know that you can use set and center a map using the article here: https://community-old.sisense.com/hc/en-us/community/posts/221227568-Center-Zoom-Scatter-Map but just wondered if anyone had managed to ever add a plot instead
Thanks,
James
Hello,
Based on the following:
https://leafletjs.com/examples/custom-icons/
You can use any of the publicly available image URLs, here is an example.
const officeCoordinates = { latitude: 65.5859012851966, longitude: -105.75059585651 }; var greenIcon = L.icon({ iconUrl: 'https://leafletjs.com/examples/custom-icons/leaf-green.png', shadowUrl: 'https://leafletjs.com/examples/custom-icons/leaf-shadow.png', iconSize: [38, 95], // size of the icon shadowSize: [50, 64], // size of the shadow iconAnchor: [22, 94], // point of the icon which will correspond to marker's location shadowAnchor: [4, 62], // the same for the shadow popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor }); widget.on('beforeviewloaded', (scope, args) => { const { latitude, longitude } = officeCoordinates; if (!L.Icon.Default.imagePath) L.Icon.Default.imagePath = '/plugins/images/'; L.marker([latitude, longitude]).addTo(args.options.map); L.marker([51.5, -0.09], {icon: greenIcon}).addTo(args.options.map); })