Thank you for the explanation.

I decided to tidy everything up a bit. I made a separate js file for
the javascript http://www.pinkpigeon.net/wp-content/themes/kava/js/map.js

and then made my WordPress shortcode only the divs:

function wpmap() {
  return '<div id="map_canvas" style="width:632px; height:323px;
margin-left:40px">
</div>';
}
add_shortcode('map', 'wpmap');

It's easier to see what's going on this way.

It works really well, I'm very happy, I only started looking at this
just over a day ago and now I have a google map that loads really
fast, a custom marker, a "home" button, street view pegman and a
dropdown menu. I've achieved much more than I could have done with any
wordpress plugin, it's neater, I learnt more because I did all myself,
and I wrote my first wordpress shortcode to boot!

Thank you for the help and useful documentation for the API :-)

On Jul 16, 2:10 pm, Rossko <[email protected]> wrote:
> > changed back to double quotes around the image path, I guess using
> > single quotes must have caused a problem with the WordPress shortcode
> > function?
>
> No, its basic php syntax.
>
> You have written a php function that boils down to
> function wpmap() {
>     return 'some enormous long string';
>
> }
>
> If you try
>     return 'some enormous 'long' string';
> php will break because it can't guess that the ' at long is not the
> end of the intended string, and then it doesn't know what to do with
> the rest of the text left over.
>
> Not a maps or javascript issue.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to