Return to Snippet

Revision: 56551
at April 3, 2012 05:03 by cyberhobo


Initial Code
<?php
/**
 * Load the MarkerWithLabel library in the Geo Mashup map frame.
 */
global $geo_mashup_custom;
wp_register_script( 'googlev3-marker-with-label', path_join( $geo_mashup_custom->url_path, 'markerwithlabel.js' ), array( 'google-maps-3' ), false, true );
GeoMashupRenderMap::enqueue_script( 'googlev3-marker-with-label' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--[if lte IE 6]>
<html xmlns:v="urn:schemas-microsoft-com:vml">
<![endif]-->

	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
	<title>Geo Mashup Map</title>
		<?php GeoMashupRenderMap::head(); ?>

		<style type="text/css">
			v\:* { behavior:url(#default#VML); }
			#geo-mashup {
				width:<?php echo GeoMashupRenderMap::map_property( 'width' ); ?>;
				height:<?php echo GeoMashupRenderMap::map_property( 'height' ); ?>;
				<?php if ( GeoMashupRenderMap::map_property( 'background_color' ) ) : ?>
				background-color: <?php echo GeoMashupRenderMap::map_property( 'background_color' ); ?>;
				<?php endif; ?>
			}
		</style>
	</head>
	<body>
	<div id="geo-mashup">
		<noscript>
			<p><?php _e( 'This map requires JavaScript. You may have to enable it in your settings.', 'GeoMashup' ); ?></p>
		</noscript>
	</div>
	<?php echo GeoMashupRenderMap::map_script( 'geo-mashup' ); ?>
	</body>
</html>

Initial URL
https://code.google.com/p/wordpress-geo-mashup/wiki/JavaScriptApi

Initial Description
This is very close to the default map frame template that comes with Geo Mashup, but it registers and queues the external library.

Initial Title
Load a javascript library (MarkerWithLabel) in a Geo Mashup map frame template

Initial Tags


Initial Language
PHP