KML with Shortcode

Home Forums MapPress Support KML with Shortcode

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #10683
    darrylschmidt
    Participant

    is it possible to specify a kml file for use with the mappress shortcode?

    I’m having a person create a map with a point (poi) and would like to via the display shortcode also include my pre-made kml file.

    #10686
    Chris
    Keymaster

    Hi,

    You can’t add KML in the shortcode, but you can add KML files to the map.  You’ll need one of the beta versions for KML support:

    http://mappresspro.com/betas

    Then create a map and type the KML http: address where you would normally type the street address for a new POI.  That will add the KML overlay to the map.

    You can also combine multiple KMLs on the map, along with shapes and regular POIs.

     

    #10688
    darrylschmidt
    Participant

    Hmm, it’s just not feasable to have the client add the kml file to each map

    #10689
    Chris
    Keymaster

    You can’t do it with the shortcode, but you can use PHP.  See the documentation for some examples; in the Mappress_Poi object you can set the property kml:

    $poi->kml = “http://www.mykml.com”

    #10723
    lalate
    Participant

    Hi, could you elaborate more on this last option…by editing the PHP, will it make it more user friendly to ad the kml?

    #10724
    Chris
    Keymaster

    Hi,

    You can just type a KML address (or addresses) into the map editor when you’re creating a map, which is pretty easy.

    I think the question was about whether you could also add KML to the map by adding it into the map shortcode.  That isn’t supported, but as an alternative you can create a map using PHP in the blog template.  See the do_shortcode() examples in the docs.

     

    #10726
    lalate
    Participant

    So adding it to the map editor is fine, and I apologize this is all proving tougher for me than it should!

    I am trying to just add the url http:… to the POI: section instead of an address. Its telling me it is Invalid when I hit ok. If I enter the full code from the KML export, it tells me there is no matching address. This is with the newer beta. What am I doing wrong here?

    Thank you!

    #10727
    Chris
    Keymaster

    Hi,

    What is the URL of your KML file?  Please post it here or send it to me with the contact form.

    Please also try this KML, which is a working sample file, and let me know how it works for you:

    http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml

    #10728
    lalate
    Participant
    #10729
    lalate
    Participant

    I found this and using this workaround it works. Guess the kml exported from Google Maps is incorrect, which I gathered anyway since the previous url tried to download as .js

    http://www.gearthblog.com/blog/archives/2011/07/cant_export_to_kml_from_google_maps.html

    #10730
    lalate
    Participant

    Thank you so much for the quick response..especially given the time! It was a life saver, really.

    #10731
    Chris
    Keymaster

    Hi,

    I’m glad you got it working, and for the link to the workaround – hopefully it’ll help someone else with a similar issue.

     

    #10736
    lalate
    Participant

    So I do have one more related question. Since the KML url brings in the title, and I enter a title in the map (which is necessary b/c I will have about 100 of them), it is showing both on the page in the info bubble.

    Is there a way to hide the title I enter from displaying on the website? Maybe something in the css?

    #10737
    lalate
    Participant

    Sorry, my fault…you can disregard that last one!

    #10747
    lalate
    Participant

    Hi, So all of my maps with the KML are working perfectly (thank you!) but now I need to make a page with a mashup. I need to show all published posts here, so it seems like the [mashup] shortcode should work. It brings in a map, but no formatting or locations show up.

    Here’s my url. Any ideas? Also, is there a way to show these in Google Earth?

    http://www.rowhouseco.com/grantmassie/google/

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.