facebook

Simple Map Tutorial (w/ marker) – Updated Whitespace Fix

  1. MobiOne Archive
  2.  > 
  3. Examples, HOW-TOs
Viewing 15 posts - 31 through 45 (of 52 total)
  • Author
    Posts
  • #327613 Reply

    Brandon
    Member

    The first one that jumps out at me is this:

    var latlng = new google.maps.LatLng(56.481975, -2.956910;
    
    should be 
    
    var latlng = new google.maps.LatLng(56.481975, -2.956910);

    Let me know if that works.

    #327614 Reply

    robert65
    Member

    Thanks again for the quick response but no difference,I just don’t know what is different from last night when it worked fine

    #327615 Reply

    Brandon
    Member

    Also Here:

    
    
    //Create a new marker with a title//
    var marker = new google.maps.Marker({
    position: latlng,
    map: map
    title:"Caird!"
    });
    
    
    //Create a new marker with a title//
    var marker = new google.maps.Marker({
    position: latlng,
    map: map,
    title:"Caird!"
    });

    I will look at it again later when I have a little more time if this doesnt work.

    #327616 Reply

    robert65
    Member

    Still no difference,thanks for now

    #327621 Reply

    Brandon
    Member

    I tested this code and it works:

    
      function DisplayMap(){
    //The lat and long you want to show on the map//
    var latlng = new google.maps.LatLng(56.481975, -2.956910);
    
    //Map Options//
    var myOptions = {
    
    //Zoom - how close to the destination//
    zoom: 15,
    
    //Your center point//
    center: latlng,
    
    //Show default controls or not, best not to on phones as ot takes up a lot of room//
    disableDefaultUI: true,
    
    //Street view controls//
    streetViewControl: false,
    
    //Map Type//
    mapTypeId: google.maps.MapTypeId.ROADMAP
    
    };
    
    //COPYRIGHT WHITE SPACE FIX, needs to point the map element, the same as the onebelow//
    document.getElementById('m1-map-map').style.lineHeight = '1';
    
    //Create a new map and assign it to our map panel. You will notice the screen namestarts with m1-name, you must use the m1-//
    var map = new google.maps.Map(document.getElementById("m1-map-map"),
    myOptions);
    
    //Create a point for our map marker//
    var point = latlng;//new GLatLng(56.481975, -2.956910);
    
    //Create a new marker with a title//
    var marker = new google.maps.Marker({
    position: latlng,
    map: map,
    title:"Caird!"
    });
    
    //Create the marker on the map//
    marker.setMap(map);
    
    }

    The only changes I did was the same ones, also Im not sure if it was like this in yours, but when I copied this code the comment lines went two lines, using the // to comment them out only allows a single line to comment out. This could have been the problem, so if you cant copy and paste make sure you have them on a single line or another set of // before them.

    #327641 Reply

    robert65
    Member

    Hi Cincy, I will try again later if all else fails could you oblige by sending this in a zip file and I can look to see what may be different from what I am typing to what you have

    #327643 Reply

    Brandon
    Member

    As long as your screen is named map and your panel is named map and you are calling the DisplayMap function you should be good. Thats pretty much all that is in my test project for this. But, yes, if you need me to let me know and i will zip it up for you.

    #327649 Reply

    robert65
    Member

    Hi Cincy, did it all again and still nothing?

    #327685 Reply

    Brandon
    Member
    #327689 Reply

    robert65
    Member

    cincy, this contains the same info that i previously downloaded,its when i type in my code the problem starts, i was looking for the code inserted so i can see where i am going wrong, if that is possible, i have even tried to copy and paste into dreamweaver and still cant get it to work, it must be something that i am overlooking as it worked the first time i tried it

    #327690 Reply

    Brandon
    Member

    Ok, so you just need one with your code so it shows your map location. I can upload one for you later this evening.

    #327691 Reply

    robert65
    Member

    Thankyou, that will let me see where I am going wrong, it’s appreciated

    #327703 Reply

    robert65
    Member

    Cincy, i think i have managed to get it to work, cheers

    #327706 Reply

    Brandon
    Member

    robert,

    try this, it has the original code (as DisplayMapOriginal) along with your map, it works in both mobione and I tested it in safari also:

    http://cincyplanet.com/map/new_map.zip

    #327725 Reply

    robert65
    Member

    Cincy,what I have found out is that you cannot copy a map file once created, the copy file or save as reverts to the basic file without the added code which means you have to either enter all the code again or copy and paste via dreameraver or similar, I managed the map on one occasion since you sent me the code to get it to work but have been unable to replicate it for the other 10 locations. Maybe the loss of code is something the Mobione team can investigate, have you found similar issues.

Viewing 15 posts - 31 through 45 (of 52 total)
Reply To: Simple Map Tutorial (w/ marker) – Updated Whitespace Fix

You must be logged in to post in the forum log in