Callback for loaded page, poi performance and view parameters location
Hi, i've got a couple of questions.
1.
For an app need to modify the data in the interface once a new view is loaded. Among others, I want to create a new interface for selecting map type among others. So when the new view is loaded, I want to add an 'active' class to the loaded map interface select element. Is there a callback function for a loaded page?
2.
Added points of interests take a lot of time to process when compared to shapes. When adding +- 300 shapes, the time it takes to process that (locking map interaction while doing so), is around 5-30 ms. When adding +- 300 shapes and 600 pois, the process time is around 1200-6000 ms.
I've tried using the (expirimental) pois property and the createPoi function, both seemed to perform just about the same. Is there a way to speed up this process?
3.
The documentation on the switchTo function names a viewParams array. Where can I read the contents of this array?
edit: Seems to be nokia.mh5.app.controller.current.page.model.data . Not immediately accessible through the build callback though.
On a more general note, the mh5 framework seems to be really specialized for just the mapping application. This makes the creation of more generic apps a bit difficult. For example, info bubble's provide the functionality to only have the lines specified. Poi's are quite interactive out of the box while you have to build that functionality for shapes. Still loving working with the mh5 framework, but sometimes I feel like I have to find workarounds to have the functionality I need.
Also, it would be fun to have a gallery or something of apps people have already made with this framework. I'm curious as to how other people are using this.
As always,
Thanks in advance!
Addition:
I need data from a clicked image. Neither the 'this' object nor the event data gives me the data-... parameters in a way that is cross browser compatible.
Edit: Nvm the addition, found a workaround :P
Re: Callback for loaded page, poi performance and view parameters location
Hi,
1. Every page has a function visibleDidChange that is called if the page is shown/hidden ("visible" property of the page is udpated):
visibleDidChange: function(visible, oldVisible) {
}
You can find more details in our documentation. [url]http://developer.here.net/mobile_js[/url]. Click "User guide"->"Advanced" on the left hand side menu and scroll down to "MVC (Model-View-Controller) and MH5" section.
2. Yes we aware of this problem and are going to take a look into it.
3. There is not defined structure of this parameter. It depends on the page you want to switch to. Basically that's the start parameter for a new page which usually represent its model. E.g. if it's a route page showing a route from A to B then the parameter should contain coordinates and names of A and B.
Again take a look at the "MVC (Model-View-Controller) and MH5". It should give a basic understanding of the app flow.
If you mean a special page from the framework let me know which page you mean and can provide more specific data.
Regarding your general note. MH5 indeed was created for mapping applications. But I don't see why you couldn't use it for building general applications. The app concept is built based on pages which could contain whatever content you want. Of cause MH5 is just at the beginning and doesn't provide so much funcitonality as Sencha or other API.
BTW the infobubble has "image" property. Just draw your content on HTMLCanvas and assign this one to the image property when you create an infobubble. Look at "User guide"->"Examples" and scroll down to Infobubbles :
new nokia.mh5.components.InfoBubble (poi, {
image: testCanvas,
listeners: {
click: function (e) {
alert (e)
}
}
}, function (b) {
...
});
Br,
Leo
Re: Callback for loaded page, poi performance and view parameters location