Unfortunatly i can't, i am running the site on a localhost. But i can
paste the code of what i have done.
I have the following pice of code in a .js file that i have included
in my theme:
-----------------------------------------------------------------------------------------------------------------
var map;
var markersArray = [];
function initialize() {
var haightAshbury = new google.maps.LatLng(37.7699298,
-122.4469157);
var mapOptions = {
zoom: 12,
center: haightAshbury,
mapTypeId: google.maps.MapTypeId.TERRAIN
};
map = new google.maps.Map(('#map_canvas'), mapOptions);
google.maps.event.addListener(map, 'click', function(event) {
addMarker(event.latLng);
});
}
$(document).ready(initialize);
---------------------------------------------------------------------------------------------------------------
My .module file that is suppose to contain the map looks like this:
---------------------------------------------------------------------------------------------------------------
<?php
function gooMaps_block($op = 'list', $delta=0, $edit=array()) {
$print_id_tag = TRUE;
if($op=="list") {
$block = array();
$block[0]["info"] = t("gooMaps");
$block[1]["status"] = TRUE;
$block[2]["visibility"] = 1;
return $block;
}
else if($op=="view") {
drupal_set_html_head('<meta name="viewport" content="initial-
scale=1.0, user-scalable=no" />
<script type="text/
javascript" src="http://maps.google.com/maps/api/js?sensor=false"></
script>
');
$block = array();
$block['subject'] = t('Map');
$block['content'] = "<div style=\"width:600px;
height:800px\"><div
id=\"map_canvas\" style=\"width:100%; height:100%\"></div></div>";
return $block;
}
}
-------------------------------------------------------------------------------------------------------------------------
I hope this can make things a bit clearer. I am greatful for all help
i can get.
Sincerely,
Markus
On 9 Apr, 20:49, Luke Mahé <[email protected]> wrote:
> Would you be able to supply a link to your example?
>
> Thanks
> Luke
>
>
>
> On Fri, Apr 9, 2010 at 10:56 AM, Macke <[email protected]> wrote:
> > Hello!
>
> > I have been trying to create a module in Drupal that can show a google
> > map but i can't get it to work. I get the following error message:
>
> > "uncaught exception: [Exception... "Could not convert JavaScript
> > argument arg 0 [nsIDOMViewCSS.getComputedStyle]" nsresult: "0x80570009
> > (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame ::
> >http://maps.gstatic.com/intl/sv_se/mapfiles/api-3/0/36/main.js::
> > nj :: line 33" data: no]"
>
> > I would appreciate some help with this, i have no idea what the
> > problem is.
>
> > --
> > 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]<google-maps-js-api-v3%2b[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.- Dölj citerad
> >text -
>
> - Visa citerad text -
--
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.