Multiple viewports in ToggleWindow - ocean

I have a toggle window (with 2D graphic) with several Viewports. How do I now which Viewport that is active? Is there an API where I can get access to the Viewports? I haven't found any documentation about this.

There is no Ocean API yet to access the Viewports. There is, however a new API introduced in Ocean 2012.1 which makes it possible to extend available Viewports, i.e. add your custom toggle windows to 2D Plot window.

Related

Image Panel that Displays Images Based on Spatial Extent in ArcGIS WebAppBuilder

Does anyone know of a way of possibly making a side panel in a webapp for ArcGIS Online that would allow images to be displayed that are either attached to point location data, or have a URL in the table. I would like to images to appear based on the current extent of the map and disappear when no longer in view on the map.
I'm not aware of any widgets that would do this out-of-the-box, but I think it would be a great case to create a custom widget for use with Web AppBuilder Developer Edition.
As you start working with Web AppBuilder more, some other useful resources include the GIS StackExchange, and the Web AppBuilder Custom Widgets GeoNet Group.

Google Map Integration in OS X Application

I would like to use use Google Map in my MAC application.
I found the iOS SDK of Google Maps but not for OS X.
I want to show two annotation and a line connecting them on Google Map. Coordinate of both annotation are dynamic as per user selection.
Below is the way I find out that can work:
Call a API and pass the location coordinate for both annotation.
Now Server side a html form is generate using javascript and create a page which is showing the 2 annotation and line connecting them.
In Api Response I will get the URL of that html page.
I will show this page in UIWebView.
I want to know is there any other way I can achieve this.
I want to distribute application outside the mac app store and to distribute outside mac store I need to sign app with Developer ID which does not support the MAPs.
I didn't find anything related to this that's why I created this thread.
Thanks in advance.
I recently ported the Mapbox iOS SDK over to OS X. It has a lot of the features of MapKit, but it’s open source and should also work in a developer-signed application such as yours. To use the Mapbox OS X SDK, download the latest release from the GitHub repository (look for releases beginning with “osx-”) and follow the instructions in README.md. An API reference is included.
I want to show two annotation and a line connecting them on Google Map. Coordinate of both annotation are dynamic as per user selection.
To display the annotations on-screen, you’ll need the MGLPointAnnotation and MGLPolyline classes. You can move the point annotations dynamically by setting their coordinate properties. The polyline, however, is immutable; to change its path, remove the existing polyline and add a new one with the new coordinates.
You will have to make it with WebKit and the Google Maps API.
MapKit is available in OS X 10.9 Mavericks: https://developer.apple.com/library/mac/documentation/MapKit/Reference/MapKit_Framework_Reference/index.html
There are of course many ways of hiding the fact that you're using WebKit but if they violate Apple's or Google's TOS then submission to the App Store won't be possible.
Hope this will be helpful!

Identify the monitor with the browser window in FireBreath

I am using FireBreath to create a cross browser plugin which makes use of some native libraries for the respective platform (some .NET based DLLs for Windows and Objective-C based dylibs/frameworks for Mac). Native libraries display UI screens. In order to improve usability, if the user has a multi/extended monitor setup, i would like the native UIs to appear on the same screen as the browser window is currently on.
If an identifier to the monitor with the browser window can be retrieved, that can be passed down to the native components which can be configured to display their UIs on that monitor. I have used FireBreath's getWindowPosition() method to get the rect coordinates of the plugin and used that info to identify the correct monitor in the Windows platform.
However, the coordinates returned in Mac seems to be always 0 (or 1) irrespective of monitor on which the browser window currently resides. I understand that we have to configure an event model and a drawing model in order for this to work in Mac. I have tried following event/drawing model combinations without much success.
1) Cocoa/CoreGraphics
2) Carbon/CoreGraphics
Any help in this regard is much appreciated. Also please do share if there are other approaches to achieve the same. What i want to achieve is to identify the monitor on which the current active browser window resides in Mac. I am unsure at this point, but it maybe possible to achieve this at Objective-C level (without any changes at FireBreath level). Also please note that i want to support Safari, Firefox and Chrome browsers.
You won't like this answer, but simply put you can't do that on Mac. The problem is that with CoreGraphics you are only given a CGContextRef to work with, and it doesn't know where it will be drawn. It was technically possible in older browsers to get an NSWindow by exploiting some internal implementation details, but many browsers that's no longer possible and it was never supported.
Other drawing models are the same; CoreAnimation you have a CALayer but it doesn't know which screen or monitor it is drawn to. I personally think it's a bit annoying as well, but I do not know of any way to find out which monitor your plugin is rendered to, particularly since most of them actually copy the buffer to something else and render in a different process.
I did manage to come up with a workaround and i am just replying here for the completeness of the thread. As #taxilian explained, it is not possible to retrieve plugin coordinates using the window reference. As an alternative approach, Javascript 'Window' object has 2 properties called 'screenX' and 'screenY' that return X and Y coordinates of the browser window relative to the screen. If the user has an extended monitor setup, these are the absolute coordinates with respect to the full extended screen. We can use these values to determine the monitor with the browser window (if the X coordinate is outside the bounds of the primary monitor's width, then the browser should essentially be on the extended monitor). We can retrieve DOM properties from Firebreath as explained in the following link:
http://www.firebreath.org/display/documentation/Invoking+methods+on+the+DOM

Android how to clustering markers on map v2

I am writing an apps about google map v2
i have around 6000 makers to add into the map,
and to hide and show them with the camera change,
and also on info window click event include.
I have done the above functions, but i have no idea on how to clustering the markers,
as i search in GOOGLE, i found that there is a library call CLUSTERKARF, it works,but i got some problem on it,
I dont know how to change the markers' icon, infowindow function disabled....
Do anyone of you had working on that library? or maybe another library or method that i can use?

Is it possible to use "Styled Maps" with MKMapView?

Cheers,
for about a year now Google allows you to adjust the styling of their maps according to your needs. They offer a tool which allows for the easy creation of styles too:
Google Maps API Styled Maps Wizard
What I'd like to know is: can this feature of their API be used with MKMapView as provided in the Map Kit Framework? If so, how and at which point would I feed the JSON code which the wizard produces to the API?
If this doesn't work with MKMapView: What's the next best way to include Googles Styled Maps in an app?
Thanks alot!
As far as I'm aware, MKMapView doesn't provide this functionality "out of the box" as the Google Maps API does; the class reference, seems to support this hypothesis. You could re-implement some of the styles using annotations and overlays (see the class reference), but that assumes you have access to the point of interest data. Your success will likely depend on what styles you want to use.
As for the next best way, I opened your link, the styled maps wizard, on my iPad and it seems to work flawlessly. Perhaps you could host a pre-styled map somewhere online and simply show it in your app using a UIWebView? That would obviously limit you in some ways, but at least it would be styled!