partial-screen MapView on BlackBerry - blackberry

I am currently working on an application that requires a mapview. The thing is I do not require the screen to be completely taken up by the map view. I would like to place a few buttons on the bottom of the screen.
I tried using the VerticalFieldManager to get it working but that didn't work.
This is the code used to call the VerticalFieldManager for the MapView:
private VerticalFieldManager startpageTab()
{
set=new LabelField("Start Map");
add(set);
MapView map = new MapView();
map.setLatitude(4542349);
map.setLongitude(-7569792);
map.setZoom(1);
// Invoke maps application with specified MapView
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments(map));
return maptabArea;
}

put your buttons in one FlowFieldManager and put this FlowFieldManager in status,using setStatus(field); method.

Related

Unable to Add UI elements on top of AGSMapView

I have an app that I'm trying to migrate from Google Maps to ArcGIS maps because I need to use the maps offline.
I'm using the ArcGIS iOS 100.6 SDK and am trying to place a UIbutton on top of AGSMapView. In the View Controller "MapView" and the UIButton are under "View". The UIbutton is not a subview of MapView. I also have three other elements that should overlay the map that I hide and unhide using "isHidden = true/false" and these cannot be displayed either. The app is written in Swift 4.2 and I'm using Xcode 10.3.
Here is the view in the view controller:
View
Safe Area
Btn Satellite Toggle (outlet name: "btnSatelliteToggle")
View Mark Location
View Verify Location
View Pic Detail
MapView
Constraints
This is the code where I show the map and try to add the button on top:
let viewMap = AGSMapView(frame: .zero)
viewMap.map = AGSMap(basemapType: .navigationVector,
latitude: currentLocation.latitude, longitude: currentLocation.longitude,
levelOfDetail: zoomLevel)
viewMap.graphicsOverlays.add(overlay)
viewMap.touchDelegate = self
view = viewMap
view.bringSubviewToFront(btnSatelliteToggle)
The map is displayed along with the graphics overlay, but I am unable to show any UI elements on top of the map. This works fine with Google maps, but not with ArcGIS maps.
How do I get these UI elements to be displayed on top of the AGSMapView generated map?
Thanks in advance for your help.
It appears your MapView is at the top of the view hierarchy and thus obscuring its sibling views.
Try rearranging the view hierarchy to place the MapView at the bottom:
View
Safe Area
MapView
Btn Satellite Toggle (outlet name: "btnSatelliteToggle")
View Mark Location
View Verify Location
View Pic Detail
Constraints
I actually just solved this. Here is the updated code that works:
viewMap.map = AGSMap(basemapType: .navigationVector,
latitude: currentLocation.latitude, longitude: currentLocation.longitude,
levelOfDetail: zoomLevel)
viewMap.graphicsOverlays.add(overlay)
viewMap.touchDelegate = self
I removed:
Setting AGSMapView(frame: .zero)
as this prevented the map from being displayed in MapView.
Also, by not setting a view (thus using the default view controller "view") all siblings are available for display and can be controlled via "isHidden."

iOS Google Maps API - Views and Labels will not Overlay Over the Map

I have created a Google Map view using the Google Maps SDK for iOS and the map displays fine. Then I added a label on top of the Map. When I run this the label will not show on top of the map. I've tried moving the label to different positions, messing with constraints, but nothing seems to make the label show. I've also tried putting the label in the View instead of it being a child of Map. It still will not show.
Here is the relevant code:
import UIKit
import GoogleMaps
class MapViewController: UIViewController, GMSMapViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
let camera = GMSCameraPosition.cameraWithLatitude(37.4987309,
longitude: -77.4700891, zoom: 10)
let mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera)
mapView.delegate = self
self.view = mapView
}
}
Here is the storyboard:
Try this. Drag a new view
into your storyboard and place it under your label like the picture.
Then CTRL+drag from the "Map View" to the "View" and shift+click the following options and click "add constraints"
This is simply setting the simple autolayout constraints. CTRL+drag the "Map View" into your view controller's class.
Replace self.view = mapView, with self.theMapView.addSubview(mapView).
(where theMapView is the "Map View" in the storyboard)
Now, instead of your actual main view adding the map as a view, you're just creating a subview that does the same, and you have full control of what goes on top of what!
I encountered the same situation and here is how I solved it.
In your storyboard you have a view named 'Map'
You created the following camera :
let camera = GMSCameraPosition.cameraWithLatitude(37.4987309,
longitude: -77.4700891, zoom: 10)
Control drag the 'Map' View onto your view controller and name it whatever, such as mapView
self.mapView.camera = camera
self.mapView.bringSubview(toFront: yourLabelToBePlacedOnTop)

Xamarin IOS storyboard scrollview doesn't scoll

I'm trying to create a signup form in a storyboard in the Xamarin Studio editor, but I can't get i to scroll.
I have set AutoLayout to false.
My Document outline can be seen at the picture:
And in my CreateUserViewController I have the following:
public override void ViewDidLoad ()
{
ScrollSignup.ContentSize = new CoreGraphics.CGSize (1000, 1000);
base.ViewDidLoad ();
}
The view is set to 700 in height
Solved it myself. Just needed to a a view in the scroll view and let that view contain the elements

how to move view from mapkit in xcode

I use mapkit framework in my app and I want move in my app with code not finger.
I create mapView and 4 buttons (up - bottom - left - right) that these buttons doing these works (go to top - go to bottom - ...) with code.
important notice : my friends I want moving specific part view (for example my specific part has 320px width and 100px height)
So I want when click top button my part (320*100) of my map move to top...
please guide me...
If each button moves to a static position (and zoom) on the map then you can create a configuration something like:
each button has an associated MKMapRect / MKCoordinateSpan
when a button is tapped, get the associated area information
call setVisibleMapRect:animated: on the map view
Note that you don't really need to think in terms of top / bottom, just specify exactly what area the map view should be displaying following selection of each button.
Alternatively, if the zoom level never changes, you can use setCenterCoordinate:animated:. Let's take this option for an example and using CLLocation to make life easy:
Create an array containing your locations:
configArray = #[ topLocation, bottomLocation, .... ];
Create the buttons, and set the tag of each to the appropriate array index:
topButton.tag = 0;
bottomButton.tag = 1;
...
When a button is tapped, get the tag to get the location to update the map:
CLLocation *location = self.configArray[sender.tag];
[self.mapView setCenterCoordinate:location.coordinate animated:YES];

BlackBerry map with multiple markers

I want to create a blackberry application which displays a custom map with many markers.
Each marker should be clickable and when clicking on it, more information will display. Also, the map should allow the user to navigate around.
You could extend the class
net.rim.device.api.lbs.MapField
and implement the paint method to display your custom markers.
Overriding navigationMovement and keyChar will help you to implement the navigation as you want it to be .
To make the markers clickable on non-touch devices, you'll need some kind of cursor.
On touch devices you can work with pointerReleased.
you could use this code in mapfield touchEvent class,this will allow you to navigate thru mapfield on moving ur finger on touchscreen,hope this will solve your problem
public boolean touchEvent(TouchEvent message){
int x=message.getX(1);
int y=message.getY(1);
if(message.getEvent()==TouchEvent.MOVE){
XYPoint _xyIn = new XYPoint();
XYPoint _xyOut = new XYPoint();
_xyIn.x=x;
_xyIn.y = y;
convertFieldToWorld(_xyIn,_xyOut);
map.moveTo(_xyOut.y,_xyOut.x);
return true;
}
return false;
}

Resources