• Resolved yb881

    (@yb881)


    When adding markers, after filling the information in, setting the marker location, and assigning categories, I click the ‘Get the marker’ button and nothing happens. I cannot add any markers to my map because of this.

    Also is there a way to import markers from .csv?

Viewing 1 replies (of 1 total)
  • Plugin Author dgamoni

    (@dgamoni)

    Hi @yb881

    1 if the button does not work, you may have an error JS
    https://locateandfilter.com/support/how-to-find-javascript-errors-with-your-browsers-console/

    2 import markers from .csv this function that is not supported in the plugin but you can import the data with any the import plugin, the coordinates are stored in custom fields ‘locate-anything-lat’ and ‘locate-anything-lon’

    3 you can do this using snipet
    parse csv file

    $fileResource = fopen('/path/to/file.csv', 'r');
    while(($data = fgetcsv($fileResource, ',')) !== false)
    {
       // $data is numeric indexed array
       // do stuff with $data
    }

    save to custom fields

    
    	$all_places = get_posts(array(
    	    'post_type'   => 'place',
    	    'post_status' => 'publish',			
    	    'fields'          => 'ids', 
    	    'posts_per_page'  => -1
    	));
     
    	foreach ($all_places as $key => $place_id) {
    
                $lat = $csv['lat'];
                $lng = $csv['lng'];
                update_post_meta($place_id, 'locate-anything-lat', $lat)[0];
                update_post_meta($place_id, 'locate-anything-lon', $lng)[0];
    	}

    4 You can use the coordinates into any fields and then use the option different source for coordinates
    https://locateandfilter.com/docs/locateandfilter-wp-plugin/pro-version/set-different-source-for-coordinates/

    5 you can use paid support by email [email protected]

Viewing 1 replies (of 1 total)
  • The topic ‘‘Get the marker’ button not working’ is closed to new replies.