I need to be able to tweak / develop on top of Map

I need to be able to tweak / develop on top of Map Background type for region in Upfront.

For example, to add custom markers, to pull data from some custom post meta and add it to map.
How would I approach this best?

  • Tonino

    Of course, Milan, it takes some coding.
    wpmudev says the membership is like having a team of programmers at our disposal,
    so, while I didnt expect anyone to do the coding for me, I would be grateful for some
    pointers, advice about what files will need to be copied / edited, or some actions/hooks in Upfront I can use.

    How I can hook into existing functionality and build on it.

    Some API advice, docs, etc.

    Just some tips so I dont have to get everything from exploring codebase.

  • Milan

    Hello @Tonino,

    I hope you are having a good day and really sorry for not being crystal clear.

    Dear member unfortunately at this moment there isn't any hook or filter available which lets you tweak default map behavior.

    However you can know more about map element via /wp-content/themes/upfront/elements/upfront-maps folder files. This folder represents map element of our upfront theme.

    Here is some brief description of different files and folder of map element.

    /wp-content/themes/upfront/elements/upfront-maps/tpl/editor.html file is the template file of map which used by upfront to render map final output.

    /wp-content/themes/upfront/elements/upfront-maps/js folder contains all map element specific javascript libs which initializes map.

    /wp-content/themes/upfront/elements/upfront-maps/css folder contains css rules for map element.

    Our map element uses google's javascript map api for map rendering and manipulation, you can read more about Google's map javascript api here
    https://developers.google.com/maps/documentation/javascript/?hl=en

    Here are some code examples in case if you want to study,
    https://developers.google.com/maps/documentation/javascript/examples/

    At this moment we don't have any customized php or javascript API of upfront map element.

    I suggest you take backup of default core code of map element before you start modifying it. and I strongly suggest you don't this on your own if you are not sure how to do. User our job portal instead. :slight_smile:

    I hope this helps you.

    Please let me know if there is anything else I can help you with.

    Best Regards,
    Milan.

  • Milan

    Hello @Tonino,

    Hope you are doing well. :slight_smile:

    As I told you in my previous post unfortunately at this moment there isn't any hook or actions through which you can modify existing map element.

    However i do believe this type of flexibility is good for upfront too. Would you mind to issue new thread for this under "features" category ? If you do so it will let our other staff member to show their support for this features request.

    As there isn't any hooks or filter available which lets you tweak default map behaviour I am afraid you need to go with core editing which is of course not advisable. But we don't have any other options here. But I strongly recommend you take backup of core code before you start with core editing.

    I hope this helps you.

    Please let me know if there is anything else I can help you with.

    Cheers,
    Milan.

  • Tonino

    Okay.
    Since this map we're discussing falls into 'background type' for upfront regions, Im leaninig toward developing my own plugin / widget - maybe even using optional Leaflet map library, etc.

    However, I would really like to be able to have the end result available as 'background type' in Upfront / other themes.

    So that I can layer other widgets on top of it.

    Is that a good idea, or should I just create / use my own map widget and stretch it the whole region's width and layer stuff on top of it with z-index and absolute positioning?

    Is there a way to extend or hook into 'background types' that are offered?

    I really like wmudev's Upfront customizer and I'd love to be able to build on top of it
    ( although I never really liked default Wordpress customizer as it comes ).

    Any tips / advices in this area?

  • Milan

    Hello @Tonino,

    I hope you are having a good day and sorry for being late here.

    Is there a way to extend or hook into 'background types' that are offered?

    I've talked with one of our upfront developer and he told me that there isn't any hook or filter available for "background types as map". So unfortunately there isn't any possible way to extend default map type.

    So as you said

    Is that a good idea, or should I just create / use my own map widget and stretch it the whole region's width and layer stuff on top of it with z-index and absolute positioning?

    This is only option you can implement.

    Cheers,
    Milan Savaliya.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.