none
New to Bing Maps and Wordpress RRS feed

  • Question

  • I would really appreciate any advice anyone can offer on this. I’m new to Wordpress and Bing Maps but have been tasked with putting together a website. I am trying to create a map that looks/works like http://actionatlas.org/map. I am trying to do this through Ajax v 7.0 control but to be honest have no idea what I am doing. I am confident that once I get the map showing and one pin in that the rest I can do but I can even get the map to show.

    I am pasting in the HTML code from http://www.bingmapsportal.com/isdk/ajaxv7 into the HTML tab in wordpress, including my credentials as follows -  {credentials: 123456} (with my actual key), but nothing appears.

    I am sure I am doing something that is very simple incorrectly but would really be grateful to anyone who can help.

    Thanks - james

    • Moved by Ricky_Brundritt Friday, March 9, 2012 5:33 PM (From:Bing Maps: Map Control and Web services Development)
    Wednesday, May 18, 2011 2:27 PM

Answers

All replies

  • Is this a site hosted at wordpress.com (i.e. http://alastaira.wordpress.com) or a site that you're hosting yourself using the package from wordpress.org ? There are different rules regarding the type of content you can embed using each and, even though you're pasting into the HTML tab, certain characters may be being stripped out of what you paste (notably, the <script> tag, which is kind of critical to making Bing Maps work...) - see http://codex.wordpress.org/Using_Javascript for details.

    Either way, the examples at the interactive SDK are intended to demonstrate complete, standalone webpages with Bing Maps - whereas when you create a wordpress blog post you're creating just a section of a page. Therefore if you post verbatim an example from the iSDK into a wordpress blog post you'll be doing things like repeating the <head> and <body> sections, and generally creating a mess that's certainly not a valid HTML page.

    One thing that you might want to do is copy the iSDK example into a new .html page, and then embed that page into your post via an iframe - see http://wordpress.org/tags/iframe


    twitter: @alastaira blog: http://alastaira.wordpress.com/
    Wednesday, May 18, 2011 2:58 PM
    Moderator
  • Thanks for the quick response. The website I am building is using a package on wordpress.org, Just to be clear the link I provided (http://actionatlas.org/map) is an example of what I am trying to get to.

    I like your idea of the html page and iframe, that sounds like the easiest approach, now all I need to do is work out how to make an html page..

     

    Thanks again for pointing me in the right direction.

    J

    Wednesday, May 18, 2011 3:34 PM
  • @alastaira, the iframe looks like it will work a treat, thanks. Is there any chance you can point me towards some information on how to create an .html page? is this the same as creating a .php with the .html inside? hope this makes sense.

    J

    Wednesday, May 18, 2011 4:21 PM
  • An html pag is just plain text. Take the example from the interactive SDK, and copy and paste it into a new text file (you can use windows notepad). Then save it with the .htm extension.
    twitter: @alastaira blog: http://alastaira.wordpress.com/
    Wednesday, May 18, 2011 4:35 PM
    Moderator
  • @alastaira, thanks again, that worked all i need now is to put them both together. I am guessing that i have to have the html online rather than on my hard disk as the iFrame doesn't like the path to the folder on my computer.

    Really appreciate all the help, i'm learning a lot.J

    Wednesday, May 18, 2011 4:49 PM