2011-05-24, 03:26 PM
(This post was last modified: 2011-05-25, 08:23 PM by querschlaeger.)
This is a very simple MyCode but useful when you want position of a location (party, meeting, event, ...) inline of posts and calender events.
Title
Regular Expression
Replacement
Example
Use CSS class map to style it (maybe as block element with border, ...).
If you want to show a route between 2 locations you have to create a second MyCode:
Title
Regular Expression
Replacement
Parse Order
Have to be a smaller parse order value than the single map MyCode!
Example
Whenever someone uses 2 [map] MyCodes in a row (it can be 'nothing', line breaks, spaces and/or tab stops between the MyCodes) a route will be shown instead of 2 single maps.
Title
Map
(or whatever you like)Regular Expression
\[map\](.*?)\[/map\]
Replacement
<object data="http://maps.google.com/?q=$1&output=embed" type="text/html" width="640" height="480" class="map">
<a href="http://maps.google.com/?q=$1">$1</a>
</object>
Example
[map]1600 Amphitheatre Parkway, CA 94043[/map]
Use CSS class map to style it (maybe as block element with border, ...).
If you want to show a route between 2 locations you have to create a second MyCode:
Title
Trip
(or whatever you like)Regular Expression
\[map\](.*?)\[/map\][\s]*\[map\](.*?)\[/map\]
Replacement
<object data="http://maps.google.com/?saddr=$1&daddr=$2&output=embed" type="text/html" width="640" height="480" class="map">
<a href="http://maps.google.com/?saddr=$1&daddr=$2">$1 - $2</a>
</object>
Parse Order
Have to be a smaller parse order value than the single map MyCode!
Example
[map]Washington DC[/map]
[map]New York[/map]
Whenever someone uses 2 [map] MyCodes in a row (it can be 'nothing', line breaks, spaces and/or tab stops between the MyCodes) a route will be shown instead of 2 single maps.