• Resolved JohnnyB3

    (@johnnyb3)


    I am trying to make a form so i can add markers inside a wordpress page i have (was going to use it in the form for registration page of a job lead)
    I have been adding markers to the map here is the code to show others

    <?php
    function calculate_signature($string, $private_key) {
    $hash = hash_hmac("sha1", $string, $private_key, true);
    $sig = rawurlencode(base64_encode($hash));
    return $sig;
    }
    $api_key = "test1234";
    $private_key = "testabcd";
    $expires = strtotime("+60 mins");
    $string_to_sign = sprintf("%s:%s", $api_key, $expires);
    $sig = calculate_signature($string_to_sign, $private_key);
    var_dump($sig);
    ?>
    <br>
    Current map:
    <!--
    <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://somedomain.com/wp-content/plugins/leaflet-maps-marker/leaflet-api.php?key=<?=$api_key;?>&signature=<?=$sig;?>&expire=<?=$expires;?>&action=view&layer=1"></iframe
    -->
    <form action="" id="myform" method="POST">
    <input type="hidden" name="key" value="<?=$api_key;?>"/>
    <input type="hidden" name="signature" value="<?=$sig;?>"/>
    <input type="hidden" name="expires" value="<?=$expires;?>"/>
    <br>
    Add (default: add): <input type="text" name="action" value="add"/><br>
    Layer Number (default: 1): <input type="text" name="layer" value="1"/><br>
    Type (default: marker): <input type="text" name="type" value="marker"/><br>
    Marker Name (default Headquarters): <input type="text" name="markername" value="Headquarters"/><br>
    Lat (gets overwritten if parameter geocode is used!): <input type="text" name="lat" placeholder="lat" value=""/><br>
    Lon:(gets overwritten if parameter geocode is used!): <input type="text" name="lon" placeholder="lon" value=""/><br>
    <div style="width: 800px;">
    Icon URL (Note for johnny: need to expand this like mapmarker has){uses maps in map marker directory}: <input type="text" name="lcon" placeholder="lcon URL" value="workoffice.png"/><A HREF="http://somedomain.com/wp-content/uploads/leaflet-maps-marker-icons/workoffice.png" title="opens in new Tab/Page" target="_blank"><IMG SRC="http://advanceyourskill.com/wp-content/uploads/leaflet-maps-marker-icons/workoffice.png" ALT="Work Office" style=" align:middle; text-align:middle;" BORDER=0></A><br>
    </div>
    Popuptext (need to test html here): <input type="text" name="popuptext" placeholder="popuptext(html{WORKS})" size="275" value='<h3><a title="Web Designer" href="http://somedomain.com/job/web-designer/">somedomain.com</a></h3><b> testing bold html<b>'/>
    
    <br>
    Created by (Persons name): <input type="text" name="createdby" placeholder="createdby" value=""/><br>
    Created On date (defualt today {auto}): <input type="text" name="createdon" placeholder="date" value="<?=date("Y-m-d H:i:s");?>"/><br>
    Address (gets overwritten if parameter geocode is used!):<input type="text" name="address" placeholder="address" value=""/><br>
    geocode (value gets geoencoded via Google Places API and overwrites parameter lat, lon and address): <input type="text" name="geocode" size="75" value="2 Main Street, Park Ridge, IL 60068, USA"/><br>
    <input type="submit"  id="submit4" name="submit" value="submit"/><br>
    </form>

    im having a few problems

    1: the icon weather i give it a path or just a file name it does not use the value(in the next json output the icon value is blank. {is this pro only feature maybe? – if so you need to update the docs}

    2: the show map is that possible from the api if not how can i show the map in the same domain but not inside wordpress? is the iframe url correct? it does not work says it has a signature error {yet the map marker saves just fine with same credentials}

    3: is there any docs{examples} for using this with the json reply, as i have been having problems with getting the form to submit via ajax to show the error/works replies.

    thanks in advance for any help anyone may help with.

    https://wordpress.org/plugins/leaflet-maps-marker/

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter JohnnyB3

    (@johnnyb3)

    the examples can simply be added to the already note column as Notes/Examples heading and then in notes at the bottom of existing notes Example: blah blah

    I feel bad I have so much on my plate[to-do list] too as i have how to use google places address autocomplete, your form example, and url api calls working i even hacked a wp theme to make it work too, again 90% of the code is above.

    outside wp – just a thought this code is to good not to expand it to other places. can we say NEXT project!! (altho from the work load you have this maybe a while *smile*

    🙂

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Icon question(not saving) post save marker and other’ is closed to new replies.