Edit:
Browsers don't like width:100% height:100% on div's, thats what my problem was. I changed it too 500px width and 500px height and it worked fine. Once more, thanks for all the replies, took me a while to figure it out tho.
Hi,
I've ran into a problem with a custom module i'm developing. The module is a field you can add too a content type, the field it self is actually a form, address form. User enters zipcode, city, etc.
Now I have a database with all the latitudes and longtitudes of all address in a specific country. Through that I would like to show a google maps map and put in a marker etc on the location the user entered in the form.
The problem is, I thought it would be easy to just use drupal_add_js function with all the neccessary javascript thats needed for google maps api, however this doesnt seem to work. What I have now:
<?php
function my_module_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$element = array();
if($display['type'] == 'my_module_formatter'){
foreach($items as $delta => $item){
$markup = $item['my_module_street'] . ' ' . $item['my_module_homenumber']. '
' . strtoupper($item['my_module_postalcode']) . ' ' . $item['my_module_city']. '
';
$query = db_select('my_module_data');