The Pushpin API Blog was created to help track new releases, updates and features, bug fixes, and upcoming developments to the Pushpin API. As well, common API and JavaScript / AJAX problems and techniques will be discussed. All posts will be submitted by our development team. Feel free to send feedback or questions to our
support team.
We've come up with a new set of stylish maps that we're calling ProView!
Check it out fully here. These new layers will be part of the default maps in the API from now on, so as a result, we've incremented the API version to 1.3. To access the old styles, you can use the renamed map types and layers in the
catalog. You'll also see that there are new default map controls that look and work better than before. New
key signups will automatically get version 1.3 and the new maps, but as always, developers can choose to use the version they want (
example).
PIndicator properties have been replaced by
methods, due to the new support for time periods for indicators. Certain indicators are available for different time periods and you can display data for the different periods by using
setPeriod(), which will also automatically refreshes the map.
This impacts a few properties such as description, since they sometimes vary across different periods. Using
getDescription() will ensure you retrieve the correct description for the current period the indicator is set to. Methods
getPeriods() and
getPlaceTypes() return the periods and place types available for the indicator.
Some of you may have noticed the new version of the Pushpin API that we snuck in last week. The biggest feature is the addition of what we call "geographic breadcrumbs" or "geo-breadcrumbs" and the ability to query place containments. Geo-breadcrumbs work in similar fashion to "breadcrumb" trails that are often used in applications to keep track of your location or path. Check out the
example and notice how the breadcrumbs update as you pan or zoom! We've also got some preliminary charting capabilities in there but we still need to finalize the documentation. Stay tuned...
To summarize, here are all the new features in this release:
- Find the closest
PPlace given a point and place type and return a list of places that contain that place using getPlaceContainment() in PClientGeocoder.
- Use the
PPlaceContainmentWidget to display and control geo-breadcrumbs at different zoom levels. Control for what place type to use per zoom level is done by using the new class PPlaceTypeConfig.
- Introduction of absolute zoom levels, to alleviate customizing zooms. Here are the additional methods that support this:
- Get absolute zoom of current map with
getAbsoluteZoom() in PMap.
- Set absolute zoom of current map with
setAbsoluteZoom() in PMap.
- Enable absolute zoom levels in map types with
enableAbsoluteZooms() in PMapType. This was previously done by setting scales with setScales() which required knowing what scales were available.
- Get enabled absolute zoom levels for map types with
getEnabledAbsoluteZooms() in PMapType.
- Get all available zoom levels for map types with
getAbsoluteZooms() in PMapType.
A few more functions have been added to the
PPlace object:
getVertices() returns an array of PLatLng arrays that contain the points for the place. These points can then be used with PPolyline or PPolygon to highlight or shade these places.
getPopulation() returns the population of the place.
getState() returns the abbreviated US state for the place.
The
example in the previous post has been updated to show off these new functions.