How to Refresh the Google Map in my application using Swift? - swift

I have made a tab bar application, in which one tab(MapTab) consist of an GoogleMap and in another one(ImageTab) all the images are saved. now, when the image get saved in ImageTab it get displayed on a MapTab in the form of Marker.
Now my question is, when i delete the image from ImageTab it gets deleted but how to remove it from MapTab i.e. GoogleMap.

First clear the all the mapView's previous markers with:
mapView.clear()
And then refresh your image array. Now again draw the markers for the refreshed array of images.

Related

How do you auto zoom maps marker on Thingsboard?

So I have 2 Table widgets and a Maps Widget on the Thingsboard, when I click an item in the list table, I want the maps to auto zoom to the marker in the second Maps Widget on the Thingsboard?
How to auto zoom on Maps Thingsboard with type openstreetmaps?
I would make two dashboards.
First one is the one you already have, so the map of all Devices/Assets and Table. On click of some table row set and action to navigate to new dashboard state.
Second dashboard is the one that opens up upon that previous action, and also has alias that will take dashboard state and point to clicked Device/Asset. With that, you can have a map that will show only that clicked Device/Asset and therefor zoom onto it.

three button using one image picker, the image is not update

I start learning Swift and try to fulfill using one image picker change button image when users trigger one of three buttons.
I watch online resource and understand how to use one image picker for changing one button image
But now I have three buttons, and each of them should have the ability to use image picker and change their own button image.
My solution for this is every time when the button is clicked and image picker is called, I set the UIImage outside the function equal to the info image
At meanwhile, knowing that image picker has triggered because the button was pushed down, I put a line for set-button-image with that UIImage in the button (IBAction function).
Below is my source code. Somehow the way I wrote will not update the button's image correctly.
Let me know if any information is missing or confused. Any advice or knowledge will be helpful, thanks.
sourceCode1
sourceCode2
main page
after clicking the add button the library shows
after select image, the button image shows all white
after clicking the white part, the image somehow shows
If I click another button, the button change like the first button???

How to get ecm.widget.viewer.ContentViewer items

I have a page where first half (vertical) of the page has a gridx and second half of the page has a contentViewer. When a user clicks on an item from the grid, I'm loading the respective image and is working fine. When the user clicks on the second item from grid, the viewer is loading the second image but the issue is it is retaining the first image as well (images are opened as a tab). So I need to remove the first image when loading the second image. Is there a way to get items from ContentViewer so that I can close the previous one before loading the new one?
The getViewersStatus() method of ContentViewer will return to you a structure that includes all the currently open items. You can then iterate through this and call closeItem() on each one.
But if you are using Navigator 2.0.3.3 or later, what you probably want to do is call closeAllViewers() on the ContentViewer widget to close all open items without prompt to save changes.
Ref: https://www.ibm.com/support/knowledgecenter/en/SSEUEX_2.0.3/com.ibm.developingeuc.doc/doc/JavaScriptdoc/symbols/ecm.widget.viewer.ContentViewer.html
Ok here is what I did to achieve this.
if(this.imgViewer.mainTabContainer.getChildren().length>0){
array.forEach(this.imgViewer.mainTabContainer.getChildren(),function(child){
this.imgViewer.mainTabContainer.removeChild(child);
});
}

Positioning ListViews in WinJS Metro apps using scrollIntoView

I am building a jscript-based Windows 8 Metro app. The main screen of this application is a scrolling "panorama" view with several list views showing various aspects of the app's state. In some cases the user will select something on the page which results in a navigation to another page (using the WinJS.Navigation.navigate method.
When the user hits the back arrow on the other page, it returns to the main screen, and I use "scrollIntoView" on to position the screen to the section that the user was working on before the navigation occurred.
Unfortunately this hardly ever results in correctly positioning the view. It seems random. I suspect that the page isn't finished being built yet and that the scroll values are set based on the state at some snapshot in time.
Now the question:
Is there some what to be notified by WinJS ListView objects that they are completely rendered and layed out? Or is this the job of the page's ready function?
Thanks for any insight!
Putting multiple list views side by side is Not A Good Idea(TM). I would recommend putting one list view, and placing your content in a grouped data source to get the groups. If the items have different templates, then you can use a custom item Template selector to dynamically select a template.
Additionally, to ensure that the list view is scrolled to the right position, you need to use the indexOfFirstVisible to set the items the name suggests.

Refresh google map of my application

I have added a googleMap to my application successfully. Now i need to add a refresh button to the map so that it gets refreshed. I have added the button, but i don't know how to refresh the map.
Is there any predefined method that i could use to refresh the map. Help ??
there is nothing predefined for REFRESH - what you are looking for in the MapKit. you need to remove old annotations and have to add the new ones manually(from your own code) for zooming you need to create a span on your own to set it to any value you like (that's also to be done by your own code).