wmbeers / cmv-app

CMV - The Configurable Map Viewer - A community supported open source mapping framework built with the Esri JavaScript API and the Dojo Toolkit
https://demo.cmv.io/
MIT License
1 stars 2 forks source link

Print fails after using Find Address or Place to zoom to an area #52

Closed wmbeers closed 4 years ago

wmbeers commented 4 years ago

Description:

Steph reports:

Print feature doesn't work when using 'find address or place' to zoom to area

I used the 'Zoom to Region' feature to go to Sarasota and panned over to Galvin Park and added some layers. Print worked as expected that route. Also tested loading projects and AOIs and then printing and that worked as expected too.

Bugzilla #5809

Steps to reproduce:

  1. Open the map.
  2. Optional: Use the print function to print the map, just to verify no other problem is causing the behavior.
  3. Enter a place name or address in the search box overlaid over the map, in the upper left.
  4. After map zooms to the selected place, select Print

Expected results:

  1. Setup
  2. Optional: no error
  3. Marker is shown on map
  4. Map prints.

Actual results:

Uncaught TypeError: this.symbol.toJson is not a function
    at Object.toJson ((index):1279)
    at Object._createFeatureCollection (PrintTask.js:23)
    at Object._createOperationalLayers (PrintTask.js:48)
    at Object._getPrintDefinition (PrintTask.js:27)
    at Object._execute (PrintTask.js:9)
    at Object.execute (PrintTask.js:5)
    at Object.print (Print.js:216)
    at Object.<anonymous> ((index):64)
    at Object.<anonymous> ((index):64)
    at Object.c [as onClick] ((index):120)
wmbeers commented 4 years ago

This issue doesn't appear on CMV's demo site. Either it's been addressed and I need to port the fix over, or look at how we've configured it. Most notable is that on CMV's demo, address search places a marker: image

But on our site it's just a blue box. Since the error involves a problem with the symbol, this is where I'm going to look first.

Leaving the core CMV tag on here for now until I can compare to see if anything in either of these widgets differs.

wmbeers commented 4 years ago

Note lines 610-613 of viewer.js:

highlightSymbol: { /*TODO this isn't showing up*/
    url: 'https://js.arcgis.com/3.27/esri/dijit/Search/images/search-pointer.png',
    width: 36, height: 36, xoffset: 9, yoffset: 18
}

Commenting this out causes the default symbol to appear, and printing works. Removing coreCMV tag because it's clear this is an issue on our implementation. Ours differs significantly from the default configuration in viewer.js, adding a special locator to filter on country code = US.

wmbeers commented 4 years ago

See also revision ef41ed6

wmbeers commented 4 years ago

Verified per testing notes.

Tested in IE and Chrome. Used Wakulla Springs via the 'find address or place' functionality, added additional layers and printed in various states. Verified nothing got inadvertently broken by loading projects and AOIs as well.