PDA

View Full Version : Google map in a panel


ABC123

kingcarol
06-16-2013, 06:52 PM
I have been attempting to use the Open Web Page Super Control (Google Map) to open a map to a contact's address shown in the current panel. I have a list control that has the fields with the address and used those. If I select to open it in a window, the map opens to the correct address, but is too big to see on an IPhone. I thought that selecting to open it in a Panel might work better, so I created another empty panel for that. When I select to open the web page in a Panel, and then select the empty panel name, and then run it all, I get a script error message that says 'panelld is undefined'.

Screenshot of the error: http://screencast.com/t/vUBcGBOWTL
Screenshot of the Action Javascript genie stuff for the super control: http://screencast.com/t/xnIH3dssa

Any thoughts for me?

Clipper87
06-16-2013, 07:44 PM
Why would you use a supercontrol ? That is unless I'm mistaken old legacy stuff. Use a UX map control

kingcarol
06-16-2013, 08:23 PM
I would be happy to use a UX map control if that's what I need, but I'm too much of a newbie to ux to figure out how to do that. Looked for a video or help and am not finding. All the javascipt action stuff I click on that might be something that sounds like a map control wants a map id or name... And I'm not sure where that's supposed to come from. Frank, do you know where help can be found for this?

kiwibruce
06-16-2013, 08:25 PM
Hi Carol,

Maybe these will be of help
http://news.alphasoftware.com/v11preview/videos_v11.htm#Mapping

kingcarol
06-16-2013, 09:41 PM
Thanks, Bruce. I started watching the video, but it seems like you have to have some named map first (right away Selwyn is selecting a map in the video), and then it seems like you have to have latitude and longitude to place a marker. In my case, I have an address (street, city, state, zip) in fields and I want to just open a map that finds that address. Can someone suggest the best tool for this?

kingcarol
06-16-2013, 09:43 PM
Well, my bad... I am watching farther and see that you can use an explicit address. I'm still puzzled about selecting a map name, tho.

kingcarol
06-16-2013, 10:00 PM
OK, I'm getting it now. Had to put a Map control into a panel first, so I can refer to it. Thanks so much for the pointers all!

kiwibruce
06-16-2013, 10:19 PM
I have dug this out http://wiki.alphasoftware.com/geocode_address+Function
But sounds like you have it sorted.

Clipper87
06-17-2013, 10:27 AM
Carol,

Yep that's it! You're on your way now!

Clipper87
06-17-2013, 12:58 PM
Carol,

Just created this component that does what you want; v12 mobile stuff really is amazing!

35839

kiwibruce
06-18-2013, 02:52 AM
That is a nice little sample Frank, thanks for sharing

See I always go " That is cool ... but now I want it to do this..."
And this is where I hit walls.

That demo looks great in Iphone vertical preview but of you change to horozontal... or ipad... the map does not change size.
So I thought 'cool I can do this'
http://www.youtube.com/watch?feature=player_embedded&v=8hcue-j71l4#at=79
But that is for Charts and that feature has only JUST been added.

Am I missing something? does anyone know a way to resize maps to fit their container?
I asked this same sort of question way back here in v11 Seems to me there is no way to make a map resize to the pannel or what ever container it is in.
http://msgboard.alphasoftware.com/alphaforum/showthread.php?100818-Resize-Tabbed-UI-and-its-elements-based-on-the-Client-Screen-area&highlight=resize+Map

Thanks

Bruce

Clipper87
06-18-2013, 03:46 AM
Bruce,

This was just a quick & dirty sample created in no more then 3 minutes (!) to hint Carol away from the old legacy stuff. I'm flooded with work now but in a free minute I'll update it to more detail; I can only learn from doing that!

kiwibruce
06-18-2013, 03:57 AM
Bruce,

This was just a quick & dirty sample created in no more then 3 minutes (!) to hint Carol away from the old legacy stuff. I'm flooded with work now but in a free minute I'll update it to more detail; I can only learn from doing that!
Hi Frank,

Sorry I know it was a quick and dirty, it is it just lead me to the pondering this. We are all learning this new UX stuff.

Clipper87
06-18-2013, 04:05 AM
>>We are all learning this new UX stuff

Yeah! Especially the mobile part, I find it so intuitive & easy that I can hardly believe it.

kiwibruce
06-18-2013, 11:49 AM
Hi All,
Here is a little mod to the sample posted by Frank

After getting some sample code from Selwyn on re-sizing maps in a dialog... I find out that there is an even better method when using panes and containers!
There is a property called "Fill Container" that Map controls have... like List controls
35847

Works a treat! except that then I found I could not swipe back to panel_1 as the map was taking control so all I was doing was moving the map...
But then remembered one of Selwyns videos...I added a little custom onSwipe code

if(e.swipeDirection == 'right') {
{grid.object}.panelSetActive('PANELCARD_1');
}
(Which is part of the template code in the builder help)

So now map re-sizes and you can swipe back nicely
Anyway, I thought I would share the results of my playing.

I would have re-posted the modified component but it seems I can upload files, just images



Bruce

Clipper87
06-18-2013, 12:03 PM
Bruce,

That's the spirit! Sharing & learning from one another! Thx!

kingcarol
06-19-2013, 08:03 AM
Just popped into message board and found the added posts here. Did not get an email about these. ANYWAY, thanks so much for the info. The Fill Container was an excellent pointer, Bruce! And, Frank, I couldn't have done this without your nudges.

compuaid
06-25-2013, 03:41 AM
I took things a bit further and I agree that the new interface is extremely intuitive.

What I did was insert a container with static text "GOOGLE MAP" just above the [map1] component and set the sub-type of the container to PANELHEADER.

My UX looks like this for the second panel card section containing the map:


...
[Panel Card[PANELCARD_2]
[PanelHeader[Container_1]
[StaticText:Google Map]
[PanelHeader_End[Container_1]
map1
[Panel Card End[PANELCARD_2]]

Now you get a map that fills the screen in either orientation and still have a header that you can use to swipe back to the previous panel. I'd upload a graphic but the message board seems to be struggling with allowing uploads at the present time.

bhrt60
06-25-2013, 07:35 AM
I added the code for swipe at Panelcard_2 and also tried at Navigator, Panelcard_1
but does not take me back!

compuaid
06-27-2013, 07:18 PM
Now that attachment uploading is fixed, here's the changes I made to the carol_test in order to allow swiping back to the list from the map panel.
36105

compuaid
06-28-2013, 12:26 PM
Here's the updated component file which allows swiping to and from the full map screen. Special thanks to Alpha for adding the "fill container" option for maps!

36109

Neville
01-03-2016, 12:38 PM
If I might chip in here, I am sitting with the same scenario. I would like to populate a google map with longitude and latitude from a table. I am new to Alpha and I have gone straight to using ux controls for all my lists and details views. I have now created a panelcard where the google map is located.
My problem now is that how do I get the markers onto the map from the mssql table, and how do I put my present location onto the map as this will be running on a mobile device.
All the videos show grids with alternate views. Is there a video that shows a UX example?

Any pointers...appreciated

Regards

Neville

CharlesParker
01-03-2016, 12:58 PM
Add a button, look in the onclick event for javascript actions related to maps, that should get you started.

Neville
01-03-2016, 01:53 PM
Thanks Charles,

Got it going set up data series etc. Record set only returns 30 records but when I click the button I get an error "Message from Webpage" - "Stack overflow at line: 47"
Any ideas?

Neville
01-03-2016, 03:05 PM
I can center the map to a lat long and place a marker there. That works fine.
But trying to add markers from a data series crashes with the stack overflow.
Is this a bug?...