Search Results

Search found 233 results on 10 pages for 'pan tian'.

Page 3/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • Zoom on multiple areas in d3.js

    - by t2k32316
    I'm planning to have a geoJSON map inside my svg alongside other svg elements. I would like to be able to zoom (zoom+pan) in the map and keep the map in the same location with a bounding box. I can accomplish this by using a clipPath to keep the map within a rectangular area. The problem is that I also want to enable zooming and panning on my entire svg. If I do d3.select("svg").call(myzoom); this overrides any zoom I applied to my map. How can I apply zoom to both my entire svg and to my map? That is, I want to be able to zoom+pan on my map when my mouse is in the map's bounding box, and when the mouse is outside the bounding box, zoom+pan on the entire svg. Here's example code: http://bl.ocks.org/nuernber/aeaac0e8edcf7ca93ade. (how do I get around the cross domain issue to load the map?) <svg id="svg" width="640" height="480" xmlns="http://www.w3.org/2000/svg" version="1.1"> <defs> <clipPath id="rectClip"> <rect x="150" y="25" width="400" height="400" style="stroke: gray; fill: none;"/> </clipPath> </defs> <g id="outer_group"> <circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" /> <g id="svg_map" style="clip-path: url(#rectClip);"> </g> </g> </svg><br/> <script type="text/javascript"> var svg = d3.select("#svg_map"); var mapGroup = svg.append("g"); var projection = d3.geo.mercator(); var path = d3.geo.path().projection(projection); var zoom = d3.behavior.zoom() .translate(projection.translate()) .scale(projection.scale()) .on("zoom", zoomed); mapGroup.call(zoom); var pan = d3.behavior.zoom() .on("zoom", panned); d3.select("svg").call(pan); mapGroup.attr("transform", "translate(200,0) scale(2,2)"); d3.json("ne_110m_admin_0_countries/ne_110m_admin_0_countries.geojson", function(collection) { mapGroup.selectAll("path").data(collection.features) .enter().append("path") .attr("d", path) .attr("id", function(d) { return d.properties.name.replace(/\s+/g, "")}) .style("fill", "gray").style("stroke", "white").style("stroke-width",1); } ); function panned() { var x = d3.event.translate[0]; var y = d3.event.translate[1]; d3.select("#outer_group").attr("transform", "translate("+x+","+y+") scale(" + d3.event.scale + ")"); } function zoomed() { previousScale = d3.event.scale; projection.translate(d3.event.translate).scale(d3.event.scale); translationOffset = d3.event.translate; mapGroup.selectAll("path").attr("d", path); } </script>

    Read the article

  • WPF Zoom with ScaleTransform overlap all Window

    - by Andrew
    Hi, i want to create Pan & Zoom control Similar thread, so i transform control with ScaleTransform and it overlaps all window, i have ot do it with RenderTransform, becouse with LayoutTransform Pan implemented in example doesn't work. Are there any properties or templates with which i can implement behavior like this: if content of container undergo transformation (or just move), if content doesn't fit, container shows only fitted part, something like this: <Container Height="100" Width="100" DisplayOption="CutAllThatNotFit"> <Content/> </Container>

    Read the article

  • Simple regex split

    - by user1383058
    I have the following string: string = "Peter Pan, Pete Sampras; Little Pete" And I need to split it up by name: split_string = ["Peter Pan", "Pete Sampras", "Little Pete"] I am trying to use re.findall but am having a bit of trouble with it: print re.findall(r'[,;]', string) [";", ";", ";"] What am I doing wrong here and how would I properly use re.findall here or an equivalent to split up the string?

    Read the article

  • Android MapView: Disable auto zoom

    - by Ola Andersson
    Hi. I have made an Android app that shows a MapView with two overlays, one MyLocationOverlay and one custom overlay. I am programmatically zooming and panning to what I want the map to show. It also auto pans to my current location. The auto pan is moving the map away from what I want to show. So my question is simply: How can I disable the auto pan? Thanks, Ola

    Read the article

  • Google Maps: How to add HTML elements to specific coordinates ?

    - by Christian Toma
    I would like to know how and if I can add standard HTML elements (div, button) to a specific set of coordinates on the map ? For example I have a set of coordinates and I would like to attach a custom balloon notification to them and when I pan away from the coordinates the element should disappear and when I pan back to them, the element should reappear. Is it possible to do this with Google Maps ?

    Read the article

  • Silverlight audio components

    - by Shurup
    Do you know any good commertial or free audio / sound components that can be used in Silverlight (better on the client)? Desired features: visualizing (waveform, peakform etc., zoom, editing volume, pan, start and end markers etc.) editing (channels: volume, pan, mute, fading, etc., merge, cut, copy, paste, etc., effects) mixing different sound tracks, creating a downmix exporting result in some in Silverlight usable (compressed) formats Some useful projects that I've founded: Saluse MediaKit for Silverlight (MP3 decoder, AudioPreProcessor, visualizers, effects) Microsoft Design Toolbox sound mixer (incl. source code and video) and Demo

    Read the article

  • String concatenation: Final string value does not equal to the latest value

    - by Pan Pizza
    I have a simple question about string concatenation. Following is the code. I want to ask why s6 = "abcde" and not "akcde"? I have change the s2 value to "k". Public Class Form1 Public s1 As String = "a" Public s2 As String = "b" Public s3 As String = "c" Public s4 As String = "d" Public s5 As String = "e" Public s6 As String = "" Public s7 As String = "k" Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click s6 = s1 & s2 & s3 & s4 & s5 s2 = s7 MessageBox.Show(s6) 's6 = abcde End Sub End Class

    Read the article

  • Why unchecked jQuery UI radio button's label appears "checked" after refresh in FF and IE?

    - by Daj pan spokój
    I've got 2 radio buttons with labels: button A is checked by default in HTML (checked="checked"). They're then processed with jQuery UI Radio Button. When I check button B and refresh the page, B's label is displayed as checked (it has CSS ui-state-active class). And A's label is displayed as unchecked, even though it's A button that is actually checked. It happens in Firefox (3) and IE (8). In Chrome (5) it works fine - after refresh A's label is displayed as checked. <input class="ui-helper-hidden-accessible" id="show-all-hotels" name="radio" CHECKED="CHECKED" type="radio"> <label aria-disabled="false" role="button" class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-left" aria-pressed="false" for="show-all-hotels"> <span class="ui-button-text">All tours</span> </label> <input class="ui-helper-hidden-accessible" id="show-availability" name="radio" type="radio"> <label aria-disabled="false" role="button" aria-pressed="true" class="UI-STATE-ACTIVE ui-button ui-widget ui-state-default ui-button-text-only ui-corner-right" for="show-availability"> <span class="ui-button-text">Only available at</span> </label> Do You know why is it happening and how to make checked button label appear as checked in all browsers?

    Read the article

  • Activerecord-PostgreSQL Adapter Error

    - by Tian
    When running "rake db:migrate", i receive the following error: Please install the postgresql adapter: gem install activerecord-postgresql-adapter (dlopen(/Library/Ruby/Gems/1.8/gems/pg-0.9.0/lib/pg_ext.bundle, 9): no suitable image found. Did find: /Library/Ruby/Gems/1.8/gems/pg-0.9.0/lib/pg_ext.bundle: mach-o, but wrong architecture - /Library/Ruby/Gems/1.8/gems/pg-0.9.0/lib/pg_ext.bundle) Postgres 8.4.4 installed using the pre-built image file. Then ran sudo gem install pg to install pg-0.9.0 Config/database.yml: development: adapter: postgresql Does anyone know what the problem is?

    Read the article

  • Javascript - why do I sometimes fail to read file content with GDownloadUrl?

    - by Daj pan spokój
    Hi everybody. I try to read some file with google's GDownloadUrl and it works only from time to time. failure means fileRows == "blah blah" success means fileRows == (real file content) I've noticed, however, that when I cease (with Firebug) the execution on line 3 for a couple of seconds, it succeeds more often. Maybe it is some kind of threading bug, then? Do You guys have any tip or idea? 1 var fileContent = "blah blah"; 2 availabilityFile = "input/available/" + date + ".csv"; 3 GDownloadUrl(availabilityFile, function(fileData) { 4 fileContent = fileData; 5 }); 6 fileRows = fileContent.split("\n");

    Read the article

  • Email Collector / Implementation

    - by Tian
    I am implementing a simple RoR webpage that collect emails from visitors and store them as objects. I'm using it as a mini-project to try RoR and BDD. I can think of 3 features for Cucumber: 1. User submits a valid email address 2. User submits an existing email address 3. User submits an invalid email My question is, for scenarios 2 and 3, is it better to handle this via the controller? or as methods in a class? Perhaps something that throws errors if an instance is instantiated in sceanrio 2 or 3? Implementation is below, love to hear some code reviews in addition to answers to questions above. Thanks! MODEL: class Contact < ActiveRecord::Base attr_accessor :email end VIEW: <h1>Welcome To My Experiment</h1> <p>Find me in app/views/welcome/index.html.erb</p> <%= flash[:notice] %> <% form_for @contact, :url => {:action => "index"} do |f| %> <%= f.label :email %><br /> <%= f.text_field :email %> <%= submit_tag 'Submit' %> <% end %> CONTROLLER: class WelcomeController < ApplicationController def index @contact = Contact.new unless params[:contact].nil? @contact = Contact.create!(params[:contact]) flash[:notice] = "Thank you for your interest, please check your mailbox for confirmation" end end end

    Read the article

  • GMap in iframe gets off-center

    - by Daj pan spokój
    I have a Google Map (API 2) that used to work fine as a standalone page. However, when I load the map page within an iframe (with Thickbox), the map gets off-center: normally it's centered over Germany and in the iframe it centers on Iran, instead. How to make the map center correctly? My guesses: The problem can result from the iframe loading time. I guess, that the script calculates window size basing on the iframe size when it's still loading. It's strange since I load the map when the document is ready. $(document).ready(function() { setupSearchForm(); setupMap(); setupResults(); }); For instance, when I refresh the already loaded iframe the center comes back to Germany. A sample of code loading the map

    Read the article

  • PHP on Ubuntu autoload_register and namespacing issue

    - by Tian Loon
    I have a problem here. I have created the namespace for all classes. previously i was using windows 7 to develop current app, everything is fine. now i just moved to ubuntu, the problem comes. index.php spl_autoload_extensions(".php"); /*spl_autoload_register(function ($class) { require __DIR__ . '/../' . $class . '.php'; });*/ //provided i have tried the above method, which works on windows 7 but not Ubuntu spl_autoload_register(function ($class) { require '/../' . $class . '.php'; }); //for your info, i do this //require "../resources/library/Config.php"; //it works, no error use resources\library as LIB; use resources\dal as DAL; //instantiation $config = new LIB\Config(); print_r($config->fbKey()); i got this error PHP Warning: require(../resources\\library\\Config.php): failed to open stream: No such file or directory in /home/user/dir1/dir2/index.php i cannot find the error. hope you guys can help me with this. any question don hesitate to comment i will edit. thanks in advance. UPDATE - Extra Info PHP version 5.4.6 LATEST UPDATE any idea how to solve this without using str_replace ?

    Read the article

  • Drupal: how to set up multilanguage Drupal on several domains?

    - by Daj pan spokój
    Hi. I need to set up Drupal 6 as a multilanguage site. 1 installation, several language versions = several domains, i.e. English at englishsite.com French at frenchsite.com German at germansite.com. I've found a Tutorial that suggest that you need access to server's http.conf - this is quite unlikely on shared hosting. Is it really neccesary? Maybe You can set it up with .htaccess or any other way. Namely: what should I do to have such a configuration working ? (after setting Language negotiation to Domain name only on .../admin/settings/language/configure)

    Read the article

  • Gem::Install Error

    - by Tian
    When I try to cleanup my rails versions with sudo gem cleanup rails I get the following error: Cleaning up installed gems... Attempting to uninstall rails-2.3.5 Unable to uninstall rails-2.3.5: Gem::InstallError: cannot uninstall, check `gem list -d rails` Attempting to uninstall rails-1.2.6 Unable to uninstall rails-1.2.6: Gem::InstallError: cannot uninstall, check `gem list -d rails` gem list -d rails results in: rails (2.3.8, 2.3.5, 1.2.6) Author: David Heinemeier Hansson Rubyforge: http://rubyforge.org/projects/rails Homepage: http://www.rubyonrails.org Installed at (2.3.8): /Library/Ruby/Gems/1.8 (2.3.5): /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 (1.2.6): /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 Web-application framework with template engine, control-flow layer, and ORM. Any one know what's wrong?

    Read the article

  • Iterator not accessible because of private inheritance

    - by Bo Tian
    I've created a new class that composes std::deque by private inheritance, i.e, class B : private std::deque<A> { ... }; and in my source code I tried to use iterator of B, i.e., B::iterator it The compiler error is error C2247: 'std::deque<_Ty>::iterator' not accessible because 'B' uses 'private' to inherit from 'std::deque<_Ty>' So the question is, how can I make the iterator accessible?

    Read the article

  • Getting F# on Ubuntu 10.04

    - by Bo Tian
    I followed this to get F# on my Ubuntu machine. However, it returned me an error, saying -- Resigning FSharp.Core.dll with mono.snk ./install-mono.sh: 24: sn: not found -- Installing FSharp DLLS into the GAC Failure adding assembly bin/FSharp.Core.dll to the cache: Strong name cannot be verified for delay-signed assembly

    Read the article

  • Drupal CCK Date: how to set datetime field's default value to a fix date?

    - by Daj pan spokój
    Hi, I have a CCK datetime field and would like to set its default value to 31 May 2011. When I go to the configuration of the field I can set the default value to Now, Blank or Relative. Relative is to be set by a PHP's strtotime argument. However, it fails when I set it to 31 May 2011 last day of May 2011 (that should normally work according to http://php.net/manual/en/function.strtotime.php) Do You have any idea how to set it to default to 31 May 2011?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >