Hello,
I am currently working with a client, a transportation company, that works with the local port authority. We are using version 7.0 of the MVC Edition to implement our maps and are using the OpenStreetMap as the base layer for all our maps. The client recently asked for a new feature, adding a layer displaying certain bus stops to the maps. This layer is in addition to other existing layers that may or may not be toggled on by the user. The client receives a database table biannually with all the stops. The client wishes a certain subset of stops designated “Feeder Stops”, which can change daily, to be displayed on the map along with the ability to get additional information by interacting with the stop. We do not want to have to regenerate the shapefile every time a change occurs. I have created a method to read in the data from the database and create a shapefile (point features) of all the stops (~7600 in my test data). I have also created a method for creating an index of the shapefile base on the Feeder Stops, so that only they get rendered (~1700 in my test data), and prevents the shapefile from needing to be regenerated. I suspect there will be some performance issues that I may need assistance resolving in the near future due to the number of features, but right now I am more concerned with basic implementation than performance tuning.
The client looked at some of the MapSuite demos, and they like the context menus for interacting with a stop. It looks to me like there are two options for implementing this. Though I am not sure which would be better given the number of features.
Option 1:
Given the number of features, and the fact that OpenStreetMaps has many icons and labels, I would like the user to be able to easily tell when they are hovering over a feature that they can interact with. Using the highlight overlay as in HighlightAFeatureWhileHovering and using the context menu as in ContextMenuToHighlightOverlay. would seem to be logical and is visually appealing. I assume it should be possible to combine both methods, though I have only thus far attempted the highlighting. It works well but I am encountering two issues.
- The highlight layer is always visible. Is it possible to tie this to whether the overlay containing the stops is toggled on in the overlay switcher?
- The other issue, which seems more problematic is that the highlight overlay does not seem to use the index file for the shapefile, causing it to render all the features in the shapefile. Does the highlightoverlay not support using an index or am I possibly setting it up wrong? Using the collection of featureIDs to exclude of the featuresource is probably going to be impractical to the number of records that would need processed.
Option 2:
I have seen mention of a FeatureSourceMarkerOverlay that might also work. There are two issues with this method that I am seeing in some very brief testing.
- Once again the index file seems to be getting ignored and all the features are being rendered.
- This is more minor, but the absence of highlighting the individual feature makes the map less visually appealing and possibly harder for the user to tell when they are hovering over something that they can interact with. Is it possible to achieve a highlighting effect with markers?
Finally, I have a general question after looking at these samples. Is it possible to use the built-in highlightOverlay with multiple featuresources/layers or would I need create multiple custom layers and making use of AJAX calls to replicate this behavior if there are multiple layers visible that I desire highlighting on?