arnaudleclerc / AzureMapsControl.Components

Razor Components for azure-maps-control
MIT License
34 stars 12 forks source link

Add support for adding IconSprites for symbol layers & clustering #63

Open LeviateK opened 2 years ago

LeviateK commented 2 years ago

Hi Arnaud - Similar to your Symbol example where it is tied to a datasource, I have a need to add custom imageSprites so the data points can be easily assigned. I have a solution in use with 1 custom image sprite using the standard javascript control, but would much prefer to use this package for it's simplicity if this feature were to exist. The ImageLayer requiring 4 points does not work, as my data is LAT/LON.

azure-maps-control reference: https://docs.microsoft.com/en-us/javascript/api/azure-maps-control/atlas.imagespritemanager?view=azure-maps-typescript-latest

Sample Custom Icon javascript located here: https://docs.microsoft.com/en-us/azure/azure-maps/map-add-pin

arnaudleclerc commented 2 years ago

Hi @LeviateK, sorry for the delay. It doesn't look like much to do, I'll try to take a look as soon as I find time to work on this.

LeviateK commented 2 years ago

Thanks @arnaudleclerc - appreciate you taking a look at it. I've used it with the native javascript with 1 custom icon, but struggle to get other icons for different data sets. My full map design would then include a popup per symbol with a link to a details page.

arnaudleclerc commented 2 years ago

This will have to be delayed a little bit more, sorry for that, but I didn't forget about it. I cannot find any time to work on this currently. I will let you know as soon as any progress is made

LeviateK commented 2 years ago

No worries mate, I've got part of it working with the native JavaScript, and am at least 6 weeks out from needed this.

mitikov commented 2 years ago

In desperate need of this feature as well...

arnvanhoutte commented 2 years ago

@LeviateK could you share me the solution you used in native Javascript for this? I really need to get this fixed too

LeviateK commented 2 years ago

@arnvanhoutte Absolutely - I am far from a Javascript expert and constantly ran into syntax issues, but this is what I came up with based on official documentation and some samples. This is in a ASP.NET Core project with Razor pages, so the cshtml.cs OnLoad gets my locations with EntityType as the differentiator passed through via ViewBag, which are then mapped to the iconSprites. I also used clustering, reducing initial data points on load. Let me know if you have any questions.

` Githubissues.

  • Githubissues is a development platform for aggregating issues.