Code Monkey home page Code Monkey logo

google-vector-layers's People

Contributors

jasonsanford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-vector-layers's Issues

layerBounds

We should have layerBounds as an option. If a map is panned or zoom outside of this bounds, no more feature requests are made.

var myAGSLayer = new vectors.AGS({
    url: "http://my-arcgis-server.com/arcgis/rest/services/schools/mapserver/10"
    fields: "*",
    uniqueField: "OBJECTID",
    layerBounds: new google.maps.LatLngBounds(new google.maps.LatLng(34, -80) /* SoutWest */, new google.maps.LatLng(36, -78) /* NorthEast */)
});

Add error handling

We should return an error JSON object if there was a problem creating the vector layer. Something like:

{
    "error": true,
    "message": "A \"url\" parameter is required when creating an ArcGIS Server Layer."
}

Then a user could easily check to see if there was an issue creating the layer:

var myAGSLayer = new vectors.AGS({
    aBadOption: "oops",
    uniqqueField: "spelled unique wrong"
});

if (myAGSLayer.error){
    // Handle error
}else{
    myAGSLayer.setMap(myMap);
}

Support Yelp

Yelp's API supports bounding box searches. This would be fun to add, not sure it's worth the extra KB though.

Add "showAll" parameter

If the "showAll" parameter is true then all features are requested immediately instead of after each pan or zoom. The would be beneficial for datasets with tens of features that can be easily downloaded and rendered all at once.

default would be false

Check for map in _processFeatures

Sometimes feature requests take a long time to return and the user could have already turned this layer off. We should initially check for this.options.map when we start to process features.

Support GeoCouch

A spatial extension for CouchDB, GeoCouch supports bbox searches which make it a candidate for a new layer type.

It would be good to have a GeoCouch instance to use for demos. I think PDX API, created by @maxogden would work.

Requested in #16.

Icons from esriOptions aren't centered on icon

Google assumes all icon's anchor points are at the bottom center of the image. Typically Esri marker icons aren't modeled after a pushpin like Google. We'll need to read the esriOptions JSON to create a custom marker to get better results.

Specifically look for symbol.xoffset and symbol.yoffset.

There should be working code over at JasonSanford/leaflet-vector-layers to do this.

esriOptions documentation

It's not clear how to use the esriOptions parameter for gvector.AGS. This should be added to the docs.

Make setOptions work

This is just a placeholder for now. We should make this set the options passed in the function variable.

Add new geoweb services

It would be quite easy to add new geoweb service providers to what's here currently (AGS, A2E, GeoIQ). Some other options are:

Separate EsriJSON and GeoJSON from layer.js

These should be in their own files so that people who build without AGS don't need the _esriJsonGeometryToGoogle method and likewise with other layers which use the _geoJsonGeometryToGoogle method (GeoIQ, CartoDB).

DRY up the code

I'm finding lots of places where I'm repeating code (with slight variations for different providers). I'm tired of rewriting code 4 times.

Getting Started page

There should be a getting started page to let user know exactly what is needed to use this library and maybe how to build a custom library without certain layers.

signleInfoWindow option

It's sometimes annoying to close a bunch of infoWindows. This option would have a single infoWindow for the layer that would close and open when you clicked a different feature.

Add CartoDB

CartoDB - PostGIS based hosted web services that support bbox search and GeoJSON output

Support MapFish Protocol

As suggested at #16, add support for MapFish protocol. The data will need to be (I think) in the WGS 84 Lat/Lng reference system (SRID 4326).

Don't use jQuery

I'm using jQuery's .getJSON (.ajax) and .extend. It should be easy enough to work around using .extend but .ajax will take some work.

InfoWindows for AGS/A2E layers

I think the default InfoWindows should be left as-is where the dev can set the exact content/style using a local template. however, AGS and A2E allows users to define InfoWindows in design mode and many users would expect these templates (well, the results of the template) to be used automatically. This makes their InfoWindow experience uniform over many different cleint apps (ArcMap, the AGS javascrip API, eventually ArcGIS.com, Google Earth etc)

so, a good option would be to use HTML generated at the server for the infowindow and use Ajax to fetch the html for the popup (or maybe an iframe for better css support?) The REST api supports feature based HTMLPopups:
http://atlas.resources.ca.gov/arcgis/SDK/REST/fs-htmlPopup.html

examples:
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/1/1/htmlPopup?f=html

http://sync.arc2earth.com/9280826/ArcGIS/rest/services/tfs/1920753/FeatureServer/0/1/htmlPopup?f=html

these Urls could easily be created by the framework, so all we would need is a simple option like "serverInfoWindows":true

Any feature edit triggers symbology change

We're currently assuming if a feature's properties changed that the icon needs changed. We should only check to see if the attribute that is used to assign symbology has changed.

Code Comments

There should be lots more code comments to explain what's happening and why things are structure the way they are.

infoWindowTempate as function

infoWindowTemplate currently accepts a simple string with mustached attributes ({STATE_NAME}). We should also accept a function that returns a formatted string (or HTML). This function gets passed the properties (or attributes) object so lots of cool things can be done with the values. Think Google Charts.

Add click parameter

We should let the user pass a click parameter which is a function that would be fired when someone clicked features in this layer. We could pass Google's click event object as well as the actual features (GeoJSON or EsriJSON) to this function.

InfoWindows for AGS/A2E layers

I think the default InfoWindows should be left as-is where the dev can set the exact content/style using a local template. however, AGS and A2E allows users to define InfoWindows in design mode and many users would expect these templates (well, the results of the template) to be used automatically. This makes their InfoWindow experience uniform over many different cleint apps (ArcMap, the AGS javascrip API, eventually ArcGIS.com, Google Earth etc)

so, a good option would be to use HTML generated at the server for the infowindow and use Ajax to fetch the html for the popup (or maybe an iframe for better css support?) The REST api supports feature based HTMLPopups:
http://atlas.resources.ca.gov/arcgis/SDK/REST/fs-htmlPopup.html

examples:
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/1/1/htmlPopup?f=html

http://sync.arc2earth.com/9280826/ArcGIS/rest/services/tfs/1920753/FeatureServer/0/1/htmlPopup?f=html

these Urls could easily be created by the framework, so all we would need is a simple option like "serverInfoWindows":true

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.