UGM and tablet or smart phone

New home Forums Visitor Generated Markers Troubleshooting UGM and tablet or smart phone

Tagged: 

This topic contains 17 replies, has 3 voices, and was last updated by  Dylan 2 years, 2 months ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #22121

    rjasilionis
    Member

    Hi,
    visitors can’t add the marker in frontend using tablet or smartphone. They can enter marker name or description, but coordinates does not appear when they press on the map.

    #22127

    Dylan
    Moderator

    Hi there,

    Our sincere apologies for the issues you are having with the VGM add on.

    Would it be possible for you to send me a link to your site? This would allow me to debug the issue from my side.

    Thank you for your time.

    #22128

    rjasilionis
    Member

    Hi,
    thanks for so quick reply. The link is http://tavotaskas.lt/zemelapis/
    Looks like it is the same problem in your demo page too: https://www.wpgmaps.com/demo/visitor-generated-markers/ – I loaded site with the smartphone, clicked in the location row and after on the map. GPS coordinates was not automaticaly entered.

    • This reply was modified 2 years, 9 months ago by  SupportTeam.
    #22129

    Dylan
    Moderator

    Hi there,

    Thank you so much for getting back to me on this one.

    I believe the issue you are having is that the ‘touch/tap’ is not processed at all when using VGM.

    We are in the process of releasing an update which will add the touch handler, allowing users to add a marker with a mobile device.

    However if you are comfortable with making some minor code changes, I would be happy to guide you through the changes required to resolve this?

    Thank you for your time.

    #22130

    rjasilionis
    Member

    Thanks for reply,

    I’ll do needed changes as this feature is must. 50% of visitors use mobile devices. Please let me know what I should change

    #22131

    Dylan
    Moderator

    Hi again,

    Not a problem at all, happy to help.

    Please follow the steps below to resolve this issue:
    1. Hover over the button labelled ‘Plugins’ -> Click on the button labelled ‘Editor’
    2. This will open the WordPress code editor, from here select WP Google Maps – Visitor Generated Markers from the list of plugins on the right hand side of the screen. (Within a dropdown box)
    3. Click the button labelled ‘Select’ (Next to this dropdown) to load the main file of the VGM plugin.
    4. From the list of files on the right hand side, select the file labelled wp-google-maps-ugm/js/ugm-core.js – This will open the JavaScript file we need to change.
    5. Once this file has loaded, simply replace the following

    
                
            for (var entry in wpgmaps_localize) {
                google.maps.event.addListener(MYMAP[entry].map, 'rightclick', function(event) {
                if (marker_added === false) {
                    
                    var marker = new google.maps.Marker({
                        position: event.latLng, 
                        map: MYMAP[entry].map
                    });
                    marker.setDraggable(true);
                    google.maps.event.addListener(marker, 'dragend', function(event) { 
                        jQuery("#wpgmza_ugm_add_address_"+entry).val(event.latLng.lat()+','+event.latLng.lng());
                    } );
                    jQuery("#wpgmza_ugm_add_address_"+entry).val(event.latLng.lat()+', '+event.latLng.lng());
                    marker_added = true;
                }
    
            });
    

    With this instead:

    
    var touch_fix = jQuery(window).width() < 1000 ? 'click' : 'rightclick'; //Add mobile touch/tap support
            
            for (var entry in wpgmaps_localize) {
                google.maps.event.addListener(MYMAP[entry].map, touch_fix, function(event) {
                if (marker_added === false) {
                    
                    var marker = new google.maps.Marker({
                        position: event.latLng, 
                        map: MYMAP[entry].map
                    });
                    marker.setDraggable(true);
                    google.maps.event.addListener(marker, 'dragend', function(event) { 
                        jQuery("#wpgmza_ugm_add_address").val(event.latLng.lat()+','+event.latLng.lng());
                    } );
                    jQuery("#wpgmza_ugm_add_address").val(event.latLng.lat()+', '+event.latLng.lng());
                    marker_added = true;
                }
    
            });
    

    Save the file, and the touch fix will now be in place. Please remember to clear any site/browser caching before testing this functionality.

    Our new update will add this functionality as well for future updates 🙂

    • This reply was modified 3 years ago by  Dylan.
    #22136

    rjasilionis
    Member

    Changed, but looks like it still didn’t working. Could you check it again?

    Thanks

    #22144

    Dylan
    Moderator

    Hi there,

    I have had a look at the code for you and it appears the following line has been altered during the copy/paste:

    
    var touch_fix = jQuery(window).width() & l t ; 1000 ? & # 0 3 9 ;click& # 0 3 9 ; : & # 0 3 9 ;rightclick& # 0 3 9 ; //Add mobile touch/tap support
    

    (Spaces added to avoid them being decoded within out forums)

    As you can see the HTML entities have been encoded, most likely by our forum posts.

    Please replace each code with it’s respective symbol:
    & l t ; = >
    & # 0 3 9 ; = '

    Alternatively, I could assist you with these changed remotely?

    🙂

    • This reply was modified 3 years ago by  Dylan.
    • This reply was modified 3 years ago by  Dylan.
    #22150

    rjasilionis
    Member

    Thanks,
    marker now appear on the map, but coordinates does not appear in the address/GPS row. The row still blank.

    #22162

    Dylan
    Moderator

    Hi there,

    Please confirm that your geolocation and geocoding services are enabled on your API key project?

    Unfortunately I cannot test this from my side as the page http://tavotaskas.lt/php/zemelapis/ is no longer available. Please send me a new page link so that I can look into this for you?

    Thank you so much for your time on this one.

    • This reply was modified 2 years, 9 months ago by  SupportTeam.
    #22165

    rjasilionis
    Member

    Hi,

    here is address: http://tavotaskas.lt/maistoprekes/
    Both api services are enabled.

    Regards,
    Rolandas

    • This reply was modified 3 years ago by  rjasilionis.
    • This reply was modified 2 years, 9 months ago by  SupportTeam.
    #22173

    Dylan
    Moderator

    Hi Rolandas,

    As mentioned earlier, applying these changes on my side does appear to resolve the issue.

    Please send me a link to your test page so that I can check for any JavaScript conflicts/errors from my side?

    The link originally provided does not seem to be valid anymore?

    Thank you for your time, I would really like to get this sorted for you. 🙂

    #22176

    rjasilionis
    Member

    Hi,

    i sent link in my previous post, but the color of the link is white
    Here it is again: map

    P.S> it is white again. It disapears in white background

    #22181

    Dylan
    Moderator

    Hi again,

    So sorry for overlooking the link earlier. We will be sorting out the link colors soon.

    It appears that the references are incorrect within the jQuery statements. This may be a bug, but will be resolved in our next update if I am not mistaken.

    Please change all the following code within the ugm-core.js files:

     
    jQuery("#wpgmza_ugm_add_address").val(event.latLng.lat()+','+event.latLng.lng());
     

    To this instead:

     
    jQuery("#wpgmza_ugm_add_address_" + entry).val(event.latLng.lat()+','+event.latLng.lng());
     

    I hope this helps?

    #22183

    rjasilionis
    Member

    Perfect, everything is working now.

    Thanks

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.