bing map Icon field

kyle shapiro asked on February 27, 2015 19:45

I am trying to use a custom image for pins and I can see that the web part already provides a property for this "Icon field". My question is: How do I format my image link to work with "Icon field"? I have tried a million variations of both the direct path "/Kentico82/myWebsite/media/myWebsite/BluePushPin.png" and the permanent link "/Kentico82/getmedia/400b69f2-f5ef-4fae-b3d0-8c62022c632c/BluePushPin.aspx".

Correct Answer

Charles Matvchuk answered on February 27, 2015 22:49

What I typically do is to create a field called MapIcon in the page type (document type). I then Default the value to the path in my medial library. I also split up (make directories) in the media library for Inventory (media I am not using) and Production. ~/HOD/media/Assets/MapIcons/Production/MapIcon_Partners.png

In the map in the icon field then just reference the field name, in my case it is MapIcon.

Now I can have different map icons for different page types.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on February 27, 2015 19:57

If your site is at the root of IIS then it should simply be /media/mywebsite/bluepushpin.png. If you have your site setup as an application within the root of iis, then you'd need to include the application alias. When you're locally browsing to your site, it would either display http://localhost/ or http://localhost/kentico82. If it shows /kentico82, then your url should be /kentico82/mywebite/bluepushpin.png.

Are you using the media library or the content tree? Either way, if you select the image you want to use, it will give you a URL to use.

0 votesVote for this answer Mark as a Correct answer

kyle shapiro answered on February 27, 2015 20:28

I am using the media library. The two links in orange are the paths that it provides, but neither are working. Are you able to successfully use "icon field"?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 2, 2015 14:31

Yes I can use the Icon property without issue, but as Charles mentions, it requires a field name and not an actual URL. So in your dataset or page type, create a field that has that URL in it and set the field name in that map icon property and you should be set.

0 votesVote for this answer Mark as a Correct answer

kyle shapiro answered on March 2, 2015 19:45

Thank you for the responses. By setting a field on the page type that the map uses, equal to the image path, (/Kentico82/myWebsite/media/myWebsite/BluePushPin.png), I was able to get the images to change. However, my site has multiple page types for maps and many maps. Is there a way I can set up data source for the image as Brenden suggested? I tried to set up a Media Files Data Source webpart, but I don't think it was configured correctly. The only documentation I was able to find on data sources were all for Products Data Source. what would I write for the repeater/datalist transformation? I will keep trying with this, but any resources or suggestions on how to learn this material, or any kentico material in general, are greatly appreciated. This forum has been my greatest resource thus far, but I really would like to master Kentico some day.

0 votesVote for this answer Mark as a Correct answer

Charles Matvchuk answered on March 2, 2015 20:35

Can you explain a bit more in detail what you are trying to achieve ? If I am understanding you correctly you want different icons for different page types? Or us a selector for the field ? Remember you can use a Macro for the default value in the page type or just use the url text. That way it doesn't need to be selected each time for a new page you create.

0 votesVote for this answer Mark as a Correct answer

kyle shapiro answered on March 2, 2015 21:19

All I was trying to do is have blue bing map pins. I have many maps on my site, and different page types that the maps use, but I would like for all of the maps on my site to have blue pins.

0 votesVote for this answer Mark as a Correct answer

Charles Matvchuk answered on March 2, 2015 21:27

If you are using a field in the page type, just set the default value when you create the field to the URL path. Then every new page (document) will have that map icon by default.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.