none
Built-in MapIcon icons for UWP Map RRS feed

  • Question

  • How do I use some of the other built in map icons? For example, I want to use the coffee cup icon instead of the food icon? I didn't see a coffee shop option under MapStyleSheetEntries. Are there hidden entries?

    BasicGeoposition snPosition = new BasicGeoposition { Latitude = 47.620, Longitude = -122.349 };
    Geopoint snPoint = new Geopoint(snPosition);
    
    var myCoffeeShop = new MapIcon
    {
        Location = snPoint,
        Title = "My Coffee Shop",
        MapStyleSheetEntry =  MapStyleSheetEntries.FoodPoint,
    };



    • Edited by MosheGS Wednesday, February 6, 2019 5:09 PM
    Wednesday, February 6, 2019 3:33 PM

Answers

  • It is not currently possible to do what you want.  A style sheet entry applies its properties to multiple types of icons for the purpose of applying style changes, however, when you use an entry for your own icon, it can only map to one of those (in the case of FoodPoint, that is the knife and fork).  We may expose more detailed style entries in the future, so it is good to know that you want to do that.  If you must have a coffee cup icon, your only option at this point is to create your own.
    • Proposed as answer by Duncan LawlerModerator Wednesday, February 6, 2019 8:57 PM
    • Marked as answer by MosheGS Wednesday, February 6, 2019 9:00 PM
    Wednesday, February 6, 2019 8:55 PM

All replies

  • Hi Moshe,

    There are built-in styles shown here but they are traffic related rather than Point of Interest: https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/pushpin-syntax-and-icon-styles#icon-styles

    Sincerely,

    IoTGirl

    Wednesday, February 6, 2019 4:59 PM
    Owner
  • Hi IoTGirl,

    Unfortunately, those only apply to the Bing Maps REST API service and not Bing Maps for UWP. I should have specified that in the text of my post.

    -Moshe

    Wednesday, February 6, 2019 5:06 PM
  • Hi Moshe,

    Please take a look at this GITHUB Sample (https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/MapControl) You will note that it is documented here https://docs.microsoft.com/en-us/windows/uwp/maps-and-location/display-poi

    Sincerely,

    IoTGirl

    Wednesday, February 6, 2019 5:23 PM
    Owner
  • Yes, that is where I started. I understand how to add a MapIcon to the map, and even how to set the MapIcon.Image property to display my own image. What I was looking for was how to use the built-in icons that seem to be part of the UWP Map Control itself.

    By setting different MapStyleSheetEntry, it looks like there are some built-in icons. Like in the screenshot I created, I was able to make the "food" style icon. But there isn't a way to make a "cafe" or "marina" icon. Although it seems like it should be possible.

    https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.maps.mapstylesheetentries

    • Edited by MosheGS Wednesday, February 6, 2019 5:29 PM
    Wednesday, February 6, 2019 5:28 PM
  • It is not currently possible to do what you want.  A style sheet entry applies its properties to multiple types of icons for the purpose of applying style changes, however, when you use an entry for your own icon, it can only map to one of those (in the case of FoodPoint, that is the knife and fork).  We may expose more detailed style entries in the future, so it is good to know that you want to do that.  If you must have a coffee cup icon, your only option at this point is to create your own.
    • Proposed as answer by Duncan LawlerModerator Wednesday, February 6, 2019 8:57 PM
    • Marked as answer by MosheGS Wednesday, February 6, 2019 9:00 PM
    Wednesday, February 6, 2019 8:55 PM
  • Yeah that's what I was afraid of. I figured that since the MapStyleSheetEntry.FoodPoint is just a string "foodPoint", I was hoping there might be some hidden strings like "foodPoint.cafe" or something like that. Is there a proper forum where I can request this?
    Wednesday, February 6, 2019 9:00 PM
  • For the current list of supported entries (strings), please take a look at the MapStyleSheet JSON API Reference here. We try to keep MapStyleSheetEntries up to date, but the reference should always be the latest.
    Wednesday, February 6, 2019 9:49 PM
  • That's great! I see there are some missing point entries that are on the JSON reference page, that aren't in MapStyleSheetEntries

    • educationPoint
    • entertainmentPoint
    • essentialServicePoint
    • lodgingPoint
    • realEstatePoint

    Just to name a few. I'll keep this list in mind, thank you again!

    Wednesday, February 6, 2019 9:57 PM
  • The easiest way to navigate the available entries is using the Map Style Sheet Editor app from the store: https://www.microsoft.com/store/productId/9NBHTCJT72FT
    Tuesday, February 12, 2019 9:30 PM