Support » Plugin: Block for Apple Maps » How change marker icon

  • Hi,
    I have installed the plugin “Block for Apple Maps”.
    The plugin allows me to set the color of the marker icons, but I need to show different marker icons depending the type of locations.
    How can I modify the plugin’s code to show different marker icons?

    Thanks,
    Luca

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Jeffrey Paul

    (@jeffpaul)

    @lninci the current marker is the default and only option currently in the plugin is the pin glyph image. It does appear that MapKit could allow for alternate images (see: https://developer.apple.com/documentation/mapkitjs/mapkit/markerannotation), so if you could share some details about how you would expect to change the marker icon and the types of things you’d want to select as the icon that will help us determine how best to handle that in the plugin… thanks!

    Thread Starter lninci

    (@lninci)

    Hi Jeffrey,
    the plugin saves the settings of each location in the field “post_content” of the table “wp_posts”. For example:
    —–
    <div class=”marker-annotation” data-latitude=”39.03818913010655″ data-longitude=”16.297985196875004″ data-title=”Catanzaro”></div>
    <div class=”marker-annotation” data-latitude=”39.5266391695102″ data-longitude=”16.14043223934022″ data-title=”Pizzo”></div>
    —–
    Is it possible to insert into “<div…” an attribute “data-icon=image1.png” to specify the icon?

    I have many locations in my map. Each location belongs to a category. Each category has an icon.
    Thanks!

    Thread Starter lninci

    (@lninci)

    Hi Jeffrey,
    I’d like to know if the solution written in my previous post is possible. Or if there are other solutions.
    Thanks!
    Luca

    Plugin Contributor Tung Du

    (@dinhtungdu)

    Hey @lninci,

    Unfortunately, custom pin icon isn’t supported yet in Block for Apple Maps, so you can’t use your custom icons at the moment.

    I created a GitHub issue for this, you can follow its status here: https://github.com/10up/maps-block-apple/issues/92.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.