- This topic has 51 replies, 8 voices, and was last updated 12 years, 1 month ago by support-octavio.
-
AuthorPosts
-
fbod383Membernot sure what you mean by form. The screen name is map, and so is the panel name. The screen with the button is called dmdrinksapple, and the button name is AroundMe.. not sure why that one relevant. lol
BrandonMember@ fbod383
I have edited the original post to include a zip file of the map screen that works.
Note: Make you do not rebuild the file or you will have to reinsert the head script that calls the map api.
fbod383MemberMy map works fine, its just the button isnt calling it up. It does nothing when I click on it
fbod383Memberphoneui.js:825 Page m1-map not found
dmdrinksapple.js:268 ReferenceError: Can’t find variable: DisplayMap
BrandonMemberDo you have other javascript in the app, it sounds like it is not loading correctly, and I know (from experience) that if it messes up before that it wont load the rest of it correctly. Thats my best guess without seeing the entire thing.
fbod383Memberhere is the screen with the call button http://www.keepandshare.com/doc/4102877/dmdrinksapple-mobi-june-7-2012-2-37-pm-362k?da=y
and here is the map http://www.keepandshare.com/doc/4102880/map-mobi-june-7-2012-2-38-pm-6k?da=y
BrandonMemberI cant see them. I have an account but you need to enable sharing for my username: brandonbatie
fbod383Membersorry, set them as public.
BrandonMemberOk, I think I might have the solution. The screens I got, for some reason, didn’t include the javascript. But, if you said the map is working but just not the button to load the map screen I think I know why. There is no direct call to the map screen in your dmdrink screen. An easy fix. Use a Link widget set it to open the map screen, then double click to edit the link and take all the test out. This will give it the code it needs to include the map screen in the build.
Another thing you can do. would be to set your whats around me button to call the map screen and in the javascript for the map page call the DisplayMap when the screen is loaded ( I actually had to do this because it was trying to load the map before the screen was done and I was only getting a partial map image until I reloaded the page).
Let me know if this would for you.
Carson89Member@CincyPlanet wrote:
Alright, one more thanks to Douger, for the CSS fix, and here is how to do it without having to find and edit the info in the css file, I also fixed the code in the original script above:
I call everything with a button, the map is on a new screen. Here is the code for the javascript the button calls:
//Set the style of the linHeight to 1, to get rid of the control - thanks Douger //NOT NEEDED NOW // document.getElementById('m1-map-map').style.lineHeight = '1'; //Open the new page that has the map on it phoneui.gotoPage("m1-map"); //Call the DisplayMap(); script that will show the map and marker DisplayMap();
It should now load the map page, and the copyright notice will be small and in the corner like it should be…
Hi Cincyplanet and tech support team,
May I know where should the above code be pasted to?
Thank you.
support-octavioMemberCincyplanet commented that he used that code for the action in a button. You should use the code in the onClick action in Run Javascript property of you button.
BrandonMemberYes, it was in the button. However, if you want to call it from another function and or not have it go to another page you rally only need the DisplayMap call, it is best to call it before the page loads.
robert65MemberHi Cincy, looking for some help, i managed to copy in the code and got my map to work, then i lost the whole thing i have re-typed in all the code as it will not let me copy and paste and now i cannot get it to work any ideas?, thanks in advance
BrandonMemberI would have to see the code. I have seen mobione get a little picky with the copy and pasting, not sure why. Usually I will close and restart Mobione and it works fine after that. Otherwise you could do a screen grab or something so I can see it.
robert65MemberCincy, i dont know how else to send the code, her it is as i typed it in
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 one
below//
document.getElementById(‘m1-map-map’).style.lineHeight = ‘1’;//Create a new map and assign it to our map panel. You will notice the screen name
starts 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);}
-
AuthorPosts