POST
|
Any takers? Is there documentation on the parameters that I've missed?
... View more
05-24-2016
09:54 AM
|
0
|
0
|
171
|
POST
|
I'll try to play with Q4 and verify this. If I'm successful, I'll post the code in case it helps others. With regard to Q1, the I should have said map, instead of document. I'm working with regional data, and I was curious if it might be possible for me to allow the user to download two regions of mmpk's and show the layers from both of them on a single, coherent map. Thanks for the help on all my questions/posts. I had to step away from my project for a few days. I should be back on it Monday, and I'll do my best to respond/confirm solutions as I work on it.
... View more
05-18-2016
07:02 PM
|
1
|
1
|
1396
|
POST
|
I'm not sure if you can PM on here, but if you can, let me know and I'll see about getting a couple of mmpks to you to work with.
... View more
05-18-2016
06:57 PM
|
0
|
0
|
979
|
POST
|
I hate to ask this question -- I feel like it should be glaringly obvious -- but hours of searching have netted no results. I have an external website that sends me JSON information. The url looks like: http://servername/jsonQuery/GetInfo/DTM=YYYYMMDDHHMMSS/Time=XX I'm wanting to create an input using the "Poll an External Website for JSON" connector that grabs data every 30 seconds, but inputs the current date/time in the DTM= section. http://servername/jsonQuery/GetInfo/DTM=20160518145204/Time=30 However, I can't figure out how. It looks like there is a Parameters field in the Advanced section of the configuration that would enable this, but I can find no examples and no documentation as to how this is used. Any guidance is greatly appreciated. Thanks!
... View more
05-18-2016
12:53 PM
|
0
|
1
|
2644
|
POST
|
Well, I feel like I'm the only one developing with the iOS SDK right now -- kinda quiet on the forum. There's not much in the way of examples utilizing the beta SDK, but after doing a little experimenting, I thought I might have come across a way to do this: // respond to touch event
func mapView(mapView: AGSMapView, didLongPressAtPoint screen: CGPoint, mapPoint mappoint: AGSPoint) {
if self.mapView.callout.hidden {
let callout = self.mapView.callout
callout.title = "Location"
callout.detail = String(format: "x: %.2f, y: %.2f", mappoint.x, mappoint.y)
callout.accessoryButtonType = UIButtonType.DetailDisclosure
callout.accessoryButtonHidden = false
let completionBlock: (([AGSIdentifyLayerResult]?, NSError?) -> Void)! = {
(layers, error) in
if (error != nil) {
callout.detail = "There are no layers where you pressed. Got error: \(error.debugDescription)\n"
} else {
let details = "There are \(layers?.count) layers where you pressed."
print(details)
for layer in layers! {
print("Layer: \(layer.layerContent.name)=\(layer.layerContent.subLayerContents.count)")
print("-->sublayers: \(layer.sublayerResults)")
}
callout.detail = details
}
callout.autoAdjustWidth = true
callout.showCalloutAt(mappoint, screenOffset: CGPointZero, rotateOffsetWithMap: false, animated: true)
}
mapView.identifyLayersAtScreenPoint(screen, tolerance: 5, maximumResultsPerLayer: 2, completion: completionBlock)
} else {
self.mapView.callout.dismiss()
}
}
However, this returns all of the layers in the mapView.operationalLayers array -- not the layers at the given map-point (line 29). I might be missing something obvious in the logic, but after looking at this for two days, I'm still striking out. Any ideas/suggestions would be greatly appreciated.
... View more
05-05-2016
08:02 PM
|
0
|
1
|
409
|
POST
|
Is it possible to create a callout that shows information for layers in the map.operationalLayers list?
... View more
05-04-2016
02:37 PM
|
0
|
2
|
3921
|
POST
|
I need to export a mobile map package that spans an entire state. It appears that a basemap is required, and everything I've tried has really bloated the file size significantly. The layers dataset I'm wanting to export is around 500k -- not really large. What's the best approach to use so that I can include a basemap that allows zooming to level 20, yet doesn't take up much user space? I've seen lots of posts on blank basemaps, but none offer a solution that has worked for me so far. If I've overlooked a thread, please point me in the right direction. Thanks in advance!
... View more
05-03-2016
09:02 AM
|
0
|
1
|
2476
|
POST
|
What are the limitations for utilizing MMPK's? Specifically, here are several questions I have: Q1: How many MMPK's can you reference in a document? Q2: Can you legally point to a specific layer in an MMPK and add it to a map? Q3: Is it legal to have a MMPK with no basemap? Q4: If you have no basemap, then how to you set the default color of a map created by the mmpk? Regarding Q1 & Q2, If I have two MMPK's, and I'd like layer "A" off of a.mmpk and layer "B" off of b.mmpk, is this possible? If I add the layers via the mmpk, the layers appear: self.mapView.map = mobileMapPackage.maps[0] However, if you try and utilize the individual layers from the mmpk to a default AGSMap, but the layers don't appear. Here's the complete function for clarification:
if let filepath = NSBundle.mainBundle().pathForResource("mobile", ofType:"mmpk") {
print("found map")
let mobileMapPackage = AGSMobileMapPackage(path: filepath)
mobileMapPackage.loadWithCompletion { (error) -> Void in
if let error = error {
print(error.localizedDescription)
}
else {
// In this case the first map in the array is obtained
print ("setting map")
print("The mobile map package contains \(mobileMapPackage.maps.count) maps")
if (mobileMapPackage.maps.count > 0) {
var map = mobileMapPackage.maps[0]
print ("There are \(map.operationalLayers.count) layers.")
self.mapView.backgroundColor = UIColor.whiteColor() // will be hidden by basemap
self.mapView.map = AGSMap(basemap:AGSBasemap.lightGrayCanvasBasemap()) // required?
for obj in map.operationalLayers{
if let layer = obj as? AGSLayer {
print("Adding layer \(layer.name).") // the log shows them loading...
self.mapView.map!.operationalLayers.addObject(layer)
}
}
}
}
}
} Q3 & Q4 are related, I believe. I'm trying to minimize the data footprint distributed to my mobile devices, which all have to work completely offline. I'm really not wanting to include a basemap (to reduce size), and all I care about is showing the data from a few layers. Although there are no constraints on the mmpk export, the data is clipping weirdly on the device, and it's showing up on a solid black background: Attempts to change the background color do not work -- the mmpk is actually inserting the black background on top of a mapview that has a solid green background color set. This leads me to believe that a basemap is required to set extents properly. Thoughts? Suggestions?
... View more
05-03-2016
08:44 AM
|
0
|
6
|
6990
|
POST
|
That's the page that gave me the original information for the mxd. What wasn't readily apparent to me from the documentation was how to reference the current document in ArcGIS Pro. The documentation says the input is a map or basemap to include in the mmpk, but it doesn't explicitly say how to reference the map or basemap. I tried typing in the specific layer name, but that didn't work. I gave it the .mxd file and it processed, thus my workflow of utilizing both ArcGIS versions. The only version of the file I had for ArcGIS Pro was the project file. I eventually put it in model builder and realized that you can give it the name of a map tab and the process will work -- and that makes perfect sense in hindsight, but I'm still not sure how to best approach my problem. But that's a topic for a different thread. What I've done so far is to either use the model-builder to select the map and export it, or use the python command and pass the name of the map tab. So for anyone else who's a Pro newbie like myself, if you create a new project named MyProject, and you have a map tab named Map1, you can use the model builder to select Map1, or you can utilize the CreateMobileMapPackage_management (in_map, output_file, {in_locator}, {area_of_interest}, {extent}, {clip_features}, {title}, {summary}, {description}, {tags}, {credits}, {use_limitations}) and insert "Map1" in place of the in_map variable. arcpy.management.CreateMobileMapPackage("Map1", r"c:\data\mymap.mmpk", None, None, "DEFAULT", "SELECT", "My Map Title", "My Map's Summary", "Description", "tag1, tag2", "Credit Information", "Use Limitations") I have also used it to generate a mmpk for a mxd file like: arcpy.management.CreateMobileMapPackage(r"c:\data\mymap.mxd", r"c:\data\mymap.mmpk", None, None, "DEFAULT", "SELECT", "My Map Title", "My Map's Summary", "Description", "tag1, tag2", "Credit Information", "Use Limitations") You can also click on a map tab, then under the Share toolbar, click Map file in the "Save as" group to save a mapx version of the map. Then the documentation example given in Dan's link works perfectly. You can then utilize the following to generate the mmpk file for the mapx file you just created: arcpy.management.CreateMobileMapPackage(r"c:\data\mymap.mapx", r"c:\data\mymap.mmpk", None, None, "DEFAULT", "SELECT", "My Map Title", "My Map's Summary", "Description", "tag1, tag2", "Credit Information", "Use Limitations") I hope this is helpful!
... View more
05-03-2016
06:48 AM
|
0
|
0
|
369
|
POST
|
I'm having a hard time trying to figure out exactly what to send. My map has six layers, all of which are simple feature classes. Some are polylines and some are points. I've had success exporting just the points, and just the individual polylines, however, if I group the polylines in a layer group, or if I include both the polylines and the points, the resultant mmpk file crashes. In addition, the working mmpk files are imposing a background that I don't think I defined. I don't have a basemap layer in the mmpk, and my assumption is that the layers would draw on top of the background color defined for the view. However, the SDK is drawing a black background instead. I'm continuing to try and experiment so I can give you a file to play with, but until then, if you think of other suggestions, please let me know.
... View more
05-03-2016
06:40 AM
|
0
|
2
|
979
|
POST
|
What are the input types for the CreateMobileMapPackage function? So far, I've only been able to get it to work with MXD files, however, I can't modify MXD files in ArcGIS Pro, which is the only version in which I can run the function. This means I have to have two versions of ArcGIS open just to do simple modifications. It's maddening. Please tell me I'm missing something and it's really easy. 😉 Thanks!
... View more
05-02-2016
03:11 PM
|
0
|
2
|
1969
|
POST
|
I can't share that particular mmpk. Let me export another mmpk without the proprietary information and verify that the error is still there. If it is, I'll upload it for your verification. I'll respond back regardless.
... View more
05-02-2016
02:34 PM
|
0
|
0
|
979
|
POST
|
Interesting. I exported a secondary file, and deleted all unused layers, and made the rest of the layers that had been previously selected as non-visible to visible. Running the code with the new mmpk still generates an error: creating map found map setting map The mobile map package contains 1 maps (lldb) bt * thread #4: tid = 0xc7e0a, 0x000000011514545c libsystem_pthread.dylib`pthread_mutex_lock, queue = 'com.apple.root.default-qos', stop reason = EXC_BAD_ACCESS (code=1, address=0x560) * frame #0: 0x000000011514545c libsystem_pthread.dylib`pthread_mutex_lock frame #1: 0x000000010fd8a98f libc++.1.dylib`std::__1::mutex::lock() + 9 frame #2: 0x000000010c7bf5ab TransPatrol`Esri_runtimecore::Mapping::Geodatabase_feature_table::load_sync() + 171 frame #3: 0x000000010c9746b4 TransPatrol`std::__1::__function::__func<Esri_runtimecore::Mapping::Task<void>::Task<Esri_runtimecore::Mapping::Geodatabase_feature_table::load_or_retry_(Esri_runtimecore::Mapping::Loadable::Load_or_retry_mode)::$_86>(Esri_runtimecore::Mapping::Geodatabase_feature_table::load_or_retry_(Esri_runtimecore::Mapping::Loadable::Load_or_retry_mode)::$_86, pplx::cancellation_token_source)::'lambda'(), std::__1::allocator<Esri_runtimecore::Mapping::Task<void>::Task<Esri_runtimecore::Mapping::Geodatabase_feature_table::load_or_retry_(Esri_runtimecore::Mapping::Loadable::Load_or_retry_mode)::$_86>(Esri_runtimecore::Mapping::Geodatabase_feature_table::load_or_retry_(Esri_runtimecore::Mapping::Loadable::Load_or_retry_mode)::$_86, pplx::cancellation_token_source)::'lambda'()>, boost::any ()>::operator()() + 52 frame #4: 0x000000010c99bb91 TransPatrol`std::__1::__function::__func<Esri_runtimecore::Mapping::Task_implementation::Task_implementation(std::__1::function<boost::any ()>, pplx::cancellation_token_source)::$_502, std::__1::allocator<Esri_runtimecore::Mapping::Task_implementation::Task_implementation(std::__1::function<boost::any ()>, pplx::cancellation_token_source)::$_502>, boost::any ()>::operator()() + 177 frame #5: 0x000000010c99b5b1 TransPatrol`pplx::details::_PPLTaskHandle<boost::any, pplx::task<boost::any>::_InitialTaskHandle<boost::any, Esri_runtimecore::Mapping::Task_implementation::Task_implementation(std::__1::function<boost::any ()>, pplx::cancellation_token_source)::$_502, pplx::details::_TypeSelectorNoAsync>, pplx::details::_TaskProcHandle>::invoke() const + 369 frame #6: 0x000000010ca0a703 TransPatrol`pplx::details::_TaskProcHandle::_RunChoreBridge(void*) + 19 frame #7: 0x000000010be11559 TransPatrol`Esri_runtimecore::Common::Constrained_scheduler::bridge_proc(void*) + 41 frame #8: 0x0000000114e0a3eb libdispatch.dylib`_dispatch_client_callout + 8 frame #9: 0x0000000114df2b2f libdispatch.dylib`_dispatch_root_queue_drain + 1829 frame #10: 0x0000000114df2405 libdispatch.dylib`_dispatch_worker_thread3 + 111 frame #11: 0x00000001151474de libsystem_pthread.dylib`_pthread_wqthread + 1129 frame #12: 0x0000000115145341 libsystem_pthread.dylib`start_wqthread + 13 (lldb)
... View more
05-02-2016
02:24 PM
|
0
|
5
|
979
|
POST
|
Sure: (lldb) bt * thread #12: tid = 0xa3b9b, 0x000000010f91e45c libsystem_pthread.dylib`pthread_mutex_lock, queue = 'com.apple.root.default-qos', stop reason = EXC_BAD_ACCESS (code=1, address=0x560) * frame #0: 0x000000010f91e45c libsystem_pthread.dylib`pthread_mutex_lock frame #1: 0x000000010a56398f libc++.1.dylib`std::__1::mutex::lock() + 9 frame #2: 0x0000000106f985ab TransPatrol`Esri_runtimecore::Mapping::Geodatabase_feature_table::load_sync() + 171 frame #3: 0x000000010714d6b4 TransPatrol`std::__1::__function::__func<Esri_runtimecore::Mapping::Task<void>::Task<Esri_runtimecore::Mapping::Geodatabase_feature_table::load_or_retry_(Esri_runtimecore::Mapping::Loadable::Load_or_retry_mode)::$_86>(Esri_runtimecore::Mapping::Geodatabase_feature_table::load_or_retry_(Esri_runtimecore::Mapping::Loadable::Load_or_retry_mode)::$_86, pplx::cancellation_token_source)::'lambda'(), std::__1::allocator<Esri_runtimecore::Mapping::Task<void>::Task<Esri_runtimecore::Mapping::Geodatabase_feature_table::load_or_retry_(Esri_runtimecore::Mapping::Loadable::Load_or_retry_mode)::$_86>(Esri_runtimecore::Mapping::Geodatabase_feature_table::load_or_retry_(Esri_runtimecore::Mapping::Loadable::Load_or_retry_mode)::$_86, pplx::cancellation_token_source)::'lambda'()>, boost::any ()>::operator()() + 52 frame #4: 0x0000000107174b91 TransPatrol`std::__1::__function::__func<Esri_runtimecore::Mapping::Task_implementation::Task_implementation(std::__1::function<boost::any ()>, pplx::cancellation_token_source)::$_502, std::__1::allocator<Esri_runtimecore::Mapping::Task_implementation::Task_implementation(std::__1::function<boost::any ()>, pplx::cancellation_token_source)::$_502>, boost::any ()>::operator()() + 177 frame #5: 0x00000001071745b1 TransPatrol`pplx::details::_PPLTaskHandle<boost::any, pplx::task<boost::any>::_InitialTaskHandle<boost::any, Esri_runtimecore::Mapping::Task_implementation::Task_implementation(std::__1::function<boost::any ()>, pplx::cancellation_token_source)::$_502, pplx::details::_TypeSelectorNoAsync>, pplx::details::_TaskProcHandle>::invoke() const + 369 frame #6: 0x00000001071e3703 TransPatrol`pplx::details::_TaskProcHandle::_RunChoreBridge(void*) + 19 frame #7: 0x00000001065ea559 TransPatrol`Esri_runtimecore::Common::Constrained_scheduler::bridge_proc(void*) + 41 frame #8: 0x000000010f5e33eb libdispatch.dylib`_dispatch_client_callout + 8 frame #9: 0x000000010f5cbb2f libdispatch.dylib`_dispatch_root_queue_drain + 1829 frame #10: 0x000000010f5cb405 libdispatch.dylib`_dispatch_worker_thread3 + 111 frame #11: 0x000000010f9204de libsystem_pthread.dylib`_pthread_wqthread + 1129 frame #12: 0x000000010f91e341 libsystem_pthread.dylib`start_wqthread + 13 (lldb)
... View more
05-02-2016
10:06 AM
|
0
|
7
|
979
|
POST
|
I was wondering if anyone else is actually trying to utilize mmpk files in their iOS apps. I've seen very little documentation on the feature, and I've not been able to successfully utilize it, yet. I looked at the documentation here: Display a map—ArcGIS Runtime SDK for iOS (Quartz Beta) | ArcGIS for Developers and then generated the mmpk file as "mobile.mmpk" using ArcGIS Pro 1.2.0: arcpy.management.CreateMobileMapPackage(...) My ViewController (in Swift) looks like: import UIKit import ArcGIS class ArcGisViewController: UIViewController { @IBOutlet var mapView: AGSMapView! override func viewDidLoad() { super.viewDidLoad() print("creating map") createMap() } func createMap() { if let filepath = NSBundle.mainBundle().pathForResource("mobile", ofType:"mmpk") { print("found map") let mobileMapPackage = AGSMobileMapPackage(path: filepath) mobileMapPackage.loadWithCompletion { (error) -> Void in if let error = error { print(error.localizedDescription) } else { // In this case the first map in the array is obtained print ("setting map") print("The mobile map package contains \(mobileMapPackage.maps.count) maps") self.mapView.map = mobileMapPackage.maps[0] } } } } } However, when I run the program, I get a crash from what appears to be an invalid thread execution. The log prints normally right up to the crash (showing that I have 1 map in the mmpk file). The error is on the highlighted line. I'm attaching screenshot of the debugger. Has anyone else successfully utilized a mmpk file? Is there a sample somewhere that gives a working example? Thanks in advance, -Glenn
... View more
05-02-2016
09:09 AM
|
0
|
9
|
6280
|
Title | Kudos | Posted |
---|---|---|
1 | 05-18-2016 07:02 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|