• Resolved mcchrome

    (@mcchrome)


    I have service stores around the country with custom servicing radius for which I have set a custom field per store in kilometers. I would like to have a circle around the marker to show if the store is servicing the customer or not. Does anyone know how to make this posible?

    This is the javascript code I guess I need to use but I’m note sure how to implement it because I don’t know where to hook it into the map.

    var circle = new google.maps.Circle({
      map: map,
      radius: FROM CUSTOM META FIELD,
      fillColor: '#AA0000'
    });
    circle.bindTo('center', marker, 'position');

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    I didn’t test it, but I guess if you add it on line 1640, then it should work. Do minify the code and save it in the wpsl-gmap.min.js file after making any changes to that file.

    If you already included the meta data in the returned AJAX data, then it should be accessible in the infoWindowData object.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    If you haven’t included the custom meta data yet, then you can do so with this filter. The code has to go in the functions.php inside your active theme folder.

    Thread Starter mcchrome

    (@mcchrome)

    Amazing! It totally worked without much hassle at all. I used get_post_meta() in functions.php to add the field to custom_store_meta and then got the value with infoWindow.extra_data in wpsl-gmap.js. Kinda hacky because I have to reapply the custom code when we update the plugin but its not that many lines anyways.

    Thanks for the support.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Circle around marker’ is closed to new replies.