hawkesley

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • in reply to: Generate Map from PHP #15675
    hawkesley
    Participant

    Ok I will try that.
    I am using twenty ten.
    Site is just localhost at present.Wordpress of course.
    If it fails again I will email the source.

    As a seperate attack on this problem I have also tried to programmatically create a post with my custom field to generate a Map.
    The post is generated but not the map.
    I first create a draft post, update the custom field and then update the post status to publish.
    Any thoughts on this approach appreciated.
    //create a new post to create a new map.
    $postcode= ‘KT17’;
    global $user_ID;
    $my_post = array(
    ‘post_title’ => ‘Epsom’,
    ‘post_content’ => ‘Postcodes’,
    ‘post_status’ => ‘draft’,
    ‘post_date’ => date(‘Y-m-d H:i:s’),
    ‘post_author’ => $user_ID,
    ‘post_type’ => ‘post’,
    ‘post_category’ => array(0)
    );
    $new_post_id = wp_insert_post( $my_post );
    if ($new_post_id == 0) {
    echo ‘Could not create the post.’;
    }
    else {
    echo ‘New post created.’;
    }
    update_post_meta($new_post_id, ‘postcode’, $postcode);//add the custom field
    $status= ‘publish’;//set status to publish

    in reply to: Generate Map from PHP #15673
    hawkesley
    Participant

    Just thought I would check the arrays and this
    echo “

    ";
                                    print_r($mypoi_1);
                                    echo "

    “;
    echo “

    ";
                                    print_r($mypoi_2);
                                    echo "

    “;
    gives
    Mappress_Poi Object
    (
    [address] =>
    [body] => Epsom, Surrey
    [correctedAddress] =>
    [iconid] =>
    [point] => Array
    (
    [lat] => 51.34
    [lng] => -0.24
    )

    [poly] =>
    [kml] =>
    [title] => Poscode KT17
    [type] =>
    [viewport] =>
    [postid] =>
    [url] =>
    )
    Mappress_Poi Object
    (
    [address] =>
    [body] => Epsom, Surrey
    [correctedAddress] =>
    [iconid] =>
    [point] => Array
    (
    [lat] => 51.31
    [lng] => -0.26
    )

    [poly] =>
    [kml] =>
    [title] => Poscode KT18
    [type] =>
    [viewport] =>
    [postid] =>
    [url] =>
    )

    in reply to: Generate Map from PHP #15672
    hawkesley
    Participant

    Hi Chris,
    Thanks for coming back. I get the same result ie bigger map.
    My code is in a custom wordpress and I have not copied any of the mappress templates into it. I am using NETbeans which has always been fine for ” $”
    I must have missed something?

    in reply to: Create Mash Up #14277
    hawkesley
    Participant

    Thanks Chris, that works.
    Can you tell me how the Mash Up query works or point me to the code.
    My gravity form gives a post id and this is referenced in the map press posts table so I am wondering if I can amend the query a little.
    Thank you.

    in reply to: Create Mash Up #14246
    hawkesley
    Participant

    Thanks for that.
    I tried the following thinking if I could get a straight forewarns mash up I could move from there.:-
    <?php echo do_shortcode(‘[mashup query="p=259,261"]‘);?>
    which gave me one POI on the map and not two.
    The maps are valid as ordinary posts with the maps inserted in the posts and the data is in the posts database.
    How to debug/fix?

    in reply to: Create Mash Up #14238
    hawkesley
    Participant

    Thanks.
    I dont use categories or tags.When the map is created I have a post form gravity forms to which I could add category or tag or post type.
    How would I then produce a mash up?

    in reply to: Save PHP generated Map #13965
    hawkesley
    Participant

    Just to add it should be useful to capture the map id when the poi is created from the custom field.Is it this function and if so where is it called?function create_meta_map($postid)
    I am trying to understand how the gravity form post data is captured from the map press geocode options.

    in reply to: Save PHP generated Map #13964
    hawkesley
    Participant

    Hi Chris,
    Just to say the approach with custom fields works.
    I created custom fields in the GF submission form for Post Code entry and a post and map are created and stored in the database.
    I now need to associate the map id with the post code so I wondering if it is possible to save the post code (and maybe other custom fields) with the map id either in the maps table or in a new table.
    Would you have a view on this?
    Thanks

    in reply to: Save PHP generated Map #13957
    hawkesley
    Participant

    Thanks Chris,
    I will try that approach.Custom Fields can only be a single entry not multiple fields in GF from what I understand so I am hoping that a Uk postcode (in my case) will suffice to generate the map.

    in reply to: Save PHP generated Map #13947
    hawkesley
    Participant

    HiChris,
    Thanks for coming back. Yes I want to save the map I generated.
    I am not using posts directly in my application, but I am entering data to generate the map (address) in the front end through Gravity forms.
    For each address I want to save a Map and later display selected content.
    I hope thats a bit clearer.

Viewing 10 posts - 1 through 10 (of 10 total)